Constructor
new EventTimeline(getTime, onRecord)
Parameters:
| Name | Type | Description |
|---|---|---|
getTime |
function | Places a record on the presentation timeline, in seconds, or answers null when it cannot be placed yet. |
onRecord |
function | Receives each record, once, with where it was placed. |
Members
MAX_PENDING_ :number
How many records may wait to be placed.
Type:
- number
- Source:
getTime_ :function(shaka.msf.EventTimeline.Record): ?number
Type:
- function(shaka.msf.EventTimeline.Record): ?number
- Source:
onRecord_ :function(shaka.msf.EventTimeline.Record, number)
Type:
- function(shaka.msf.EventTimeline.Record, number)
- Source:
pending_ :Map<string, shaka.msf.EventTimeline.Record>
The records waiting to be placed, by ID, in arrival order.
Type:
- Map<string, shaka.msf.EventTimeline.Record>
- Source:
reported_ :Set<string>
The IDs of the records already reported and still accessible.
Type:
- Set<string>
- Source:
Methods
hash_(text) → {string}
A short, stable hash of a string (32-bit FNV-1a), for identifiers that
have to tell long strings apart without carrying them.
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string |
- Source:
Returns:
- Type
- string
isLocationIndex_(value) → {boolean}
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* |
- Source:
Returns:
Whether the value can be a Group or Object ID.
- Type
- boolean
parseRecord_(item) → {shaka.msf.EventTimeline.Record}
Reads one record: exactly one index reference and a `data` value.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
* |
- Source:
Returns:
addObject(datanon-null, independent)
Takes in one Object of the track, and reports every record that can be
placed.
The first Object of each Group is independent: it carries every record
still accessible, so a record missing from it has aged out and will not be
sent again. The Objects after it in the same Group carry only what is new
(MSF section 8.3).
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Uint8Array | The Object payload, a JSON document. |
independent |
boolean | Whether this is the first Object of a Group. |
- Source:
resolve()
Reports every pending record that can now be placed, and leaves the
others waiting. Called when what places them -- a media timeline -- has
changed.
- Source:
Type Definitions
Record
One event timeline record.
Type:
- {id: string, index: string, time: number, location: ?shaka.msf.Utils.Location, data: *}
Properties:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string | Identifies the record across the documents that repeat it: its index reference and a hash of its data. | |
index |
string | Which index reference it carries: 'm' for media time, 't' for wallclock time or 'l' for Location. | |
time |
number | For 'm' the media time, and for 't' the wallclock time, both in milliseconds. 0 for 'l'. | |
location |
shaka.msf.Utils.Location |
<nullable> |
For 'l', the Location. Null otherwise. |
data |
* | The record's `data`, as parsed from JSON. Its structure is defined by the track's `eventType`. |
- Source: