Since SegmentTimeline streams may not have segment numbers, we should
not use segment numbers as reference IDs. These IDs must be unique
for the buffering and streaming systems to function properly.
This also adds assertions to check that reference IDs are unique.
Issue #21.
Change-Id: Ia94a48c68149283f87d27c6595a4f5a6cca07a27
If an event handler throws an exception, this should not affect the
caller of dispatchEvent. This corrects FakeEventTarget's behavior to
more closely resemble EventTarget, and makes many of our asynchronous
processes more resilient to errors in application-level handlers.
Change-Id: I41202aa24650ebdba3310f20864568eea32b74ce
* Rename SegmentIndex functions to shorter names.
* Add first() and last() functions for convenience.
* Throw exceptions for out of range errors.
* Handle more corner-cases in merge().
* Add more unit tests.
Change-Id: If875cd766e7091504c028413694326fcdf2aae5b
FakeEvents, when dispatched twice, have their targets overwritten.
For this to work, the target property needs to be set to writable.
Set all synthetic properties to writable to avoid exceptions.
Change-Id: I91556501bb857ddda69872d87d368cd3aea266e4
This fixes FakeEventTarget and FakeEvent tests for Chrome 43+.
Also improves compatibility with strict mode.
Change-Id: I5ccca6798ff8a5f5b2fa98d6b9e8446378b7fab2
If a stream insertion didn't complete successfully, it was possible an error
would occur during the next stream insertion due to a key (streamId) conflict.
Updated to always take the max next stream id from the indexStore/contentStore
and to try to delete partially inserted streams.
Change-Id: I85c379a6ef17853da28ae873c448873006b1dce4
The clock will be synced, when possible, to the server hosting the
MPD. The synced clock will only be used in places where accurate
time matters, such as in loggable player stats and in live streaming.
Relates to #21
Change-Id: Id9da1cf23a781f2ce07a46e0936695d512a65133
Chrome 42+ is crashing when we insert roughly 64MB of data into the
database at a time. The database now tries to batch up 1MB of
segments, which means only single segments will be inserted for high
bitrate content, but we will still get a performance boost from
batching up segments for low bitrate content.
Change-Id: I3205b108dc089ea2901ea6b9eae5125901535f0c
Tests were failing if an existing database had a greater version
number. This was an artifact of an older version of ContentDatabase
which used a different version number.
Tests would also fail if one of the 'stores a stream' tests was run
several times in a row, such that the stream ID had more than one
digit. The reference matcher now accepts multi-digit IDs.
Change-Id: I8d8949e46bd0720abd761248790b2ee5965ff4a1
Rejected promises now pass an Error object instead of a simple event.
This causes test failures to display useful error messages now.
Change-Id: I9d9a756e84d204185ca9a2e36ca92ef814d05e4d
This removes reliance on MediaKeys.isTypeSupported and instead uses the
supportedConfigurations parameter of requestMediaKeySystemAccess.
A lot of refactoring went into this effort, particularly around
StreamVideoSource, StreamSetInfo, and StreamInfoProcessor.
Closes#2, b/19354928.
Change-Id: Ibf81da909b8207b5babaec5ef0422dd1293d130d
Includes unit tests and covers zero-sized PSSHs, truncated PSSHs, and
various orderings of both v0 and v1 PSSHs.
Change-Id: I79ecc9475d483be610c003b57e831954a1c9800b
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.
Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb