Rework event message handling
Created by: davemevans
This PR enhances both in- and out-of-band event message handling functionality available in dash.js.
It does this following as closely as possible the HBBTV v1.3.1 specification, using the TextTrack and TextTrackCue interfaces on the HTMLMediaElement for management and dispatch of events.
There is one deviation from the spec as it stands, but which in practice seems unlikely to cause an issue: when an identical EventStream is available on more than Representation, the code is currently unable to differentiate between the source of each message and hence will process both. This therefore ignores the recommendation in the MPEG-DASH spec that processing one Representation per @schemeIdUri/@value
pair is sufficient.
A simple sample application which exercises the API is provided - see /samples/emsg/index.html. The existing Fraunhofer sample application continues to work, as does manifest updating.
All existing tests and JSHint continue to pass.
I welcome review and comment of this change-set.