Commit Graph

582 Commits

Author SHA1 Message Date
Joey Parrish 51563c118f Use start time as reference ID.
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
2015-04-09 10:10:38 -07:00
Joey Parrish 72046285df Correct FakeEventTarget exception handling.
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
2015-04-09 17:09:35 +00:00
Timothy Drews d414d4eaa7 Fix load stream in compiled mode.
* Move retrieveGroupIds to OfflineVideoSource.
* Quote properties of stored objects to avoid variable
  renaming issues.

Issue #22

Change-Id: I31ca1261411de5ff5ae4859da571d0029ed77f42
2015-04-09 16:16:40 +00:00
Natalie Harris a0aa5e51c6 Retrieve list of currently stored group ids. Issue #22
Change-Id: Ifeaa4085ec289679ccd9cb1fc22bd400c9cd8198
2015-04-07 15:32:36 +00:00
Timothy Drews b8b3ad862b Cleanup SegmentIndex, make merge() more robust.
* 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
2015-04-06 22:07:17 +00:00
Joey Parrish 6bcaa4b568 Fix FakeEvent re-dispatch.
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
2015-04-03 22:32:34 +00:00
Joey Parrish 5d40798f59 Check for IndexedDB support.
Issue #22.

Change-Id: I334eb6f91894fb13a56911d50827514b504f3c25
2015-04-02 17:47:12 +00:00
Joey Parrish 9c0d2db7f6 Persist bandwidth estimators across playbacks.
Also allows application developers to inject new bandwidth estimators
instead of using ours.

Change-Id: Ieef49df05f45dc3ec0f840f9ab12b63824e08884
2015-04-01 13:39:27 -07:00
Joey Parrish a2520ec159 Tweak FakeEventTarget for Chrome 43.
This fixes FakeEventTarget and FakeEvent tests for Chrome 43+.

Also improves compatibility with strict mode.

Change-Id: I5ccca6798ff8a5f5b2fa98d6b9e8446378b7fab2
2015-03-31 15:16:46 -07:00
Joey Parrish deb2100cd1 Ignore 404 and 410 errors on segment fetch.
Relates to #21

Change-Id: Ib834e217aa14b83d2d5e42d05dd65491cab82cb8
2015-03-30 15:08:03 -07:00
Joey Parrish 3e0a9c93f3 Task abstraction.
This will help clean up SourceBufferManager.

Change-Id: I4e551ce089b4830da4bb2b3f85d123afff3199d5
2015-03-27 22:50:06 +00:00
Natalie Harris 6e6e8b4aad Fixing issue with ContentDatabase. Issue #22
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
2015-03-27 13:18:37 -07:00
Natalie Harris 6f573def03 OfflineVideoSource load and addition of offline to test app. Issue #22
Change-Id: Iad9737829c7404443849c48420d2d81d32857bf8
2015-03-27 19:57:49 +00:00
Natalie Harris c97ebf3485 Support for EME offline. Issue #23
Change-Id: I27632f196b6ec65ace67d3ee9794683fd9f639ab
2015-03-25 22:22:42 +00:00
Joey Parrish d481fdc7ec Best-effort clock synchronization.
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
2015-03-19 18:05:20 +00:00
Timothy Drews a1e2e1ddf7 Use MultiMap for streamSetsByType.
* Annotate MultiMap with @struct to catch misuses at compile-time.

Change-Id: I060390862723ce3e2c10aa512f97131b53c69a23
2015-03-18 13:35:20 -07:00
Natalie Harris 18a843eef7 OfflineVideoSource store functionality. Issue #22
Change-Id: Ib55ce40619929f7139a0651f0e0874a0bd4fc054
2015-03-16 17:22:50 +00:00
Joey Parrish 0257d7eed8 Make third argument for FakeEventTarget optional.
This makes FakeEventTarget more like EventTarget.

Change-Id: I5c4dd53e7ce665f98ade5909ac3bf5a90dd818e0
2015-03-09 19:10:23 +00:00
Joey Parrish ae35ac25bb Fix ContentDatabase test crashes on Chrome 42+.
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
2015-03-05 11:41:50 -08:00
Joey Parrish d2d6f67a52 Fix ContentDatabase test failures.
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
2015-03-05 19:34:49 +00:00
Joey Parrish f43cfff622 Fix ContentDatabase error reporting.
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
2015-03-04 13:56:25 -08:00
Joey Parrish 598e042b4a Always use base64url encoding.
This fixes clearkey errors on newer versions of Chrome 42.

Change-Id: I3c0d7336fa21587fe730c747e8aea92657a6cf33
2015-02-28 20:38:00 +00:00
Natalie Harris 4a8d26af9b Support of idb URI's.
Change-Id: Ie964da2d435349be6c2ee9a88202f1c058b8ed05
2015-02-27 23:16:15 +00:00
Natalie Harris c6a74f3171 Additional functionality added to ContentDatabase. Issue #22
Change-Id: Ic00a42b7bfcd0619adf358f4907675e7c7767bb7
2015-02-25 15:52:53 -08:00
Joey Parrish b9d2f6e8cd Fix failed assertion while parsing data-less PSSH.
When there is no data section in the PSSH, we need to skip 0 bytes,
which should not be an issue.

Change-Id: I53ab5d666f6895175a300bcc080a12e0375c3a25
2015-02-23 18:15:23 -08:00
Joey Parrish a253872c8a Update to 9 February 2015 EME spec.
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
2015-02-23 16:51:20 -08:00
Joey Parrish 08bdb3079b Make PSSH parser more robust.
Includes unit tests and covers zero-sized PSSHs, truncated PSSHs, and
various orderings of both v0 and v1 PSSHs.

Change-Id: I79ecc9475d483be610c003b57e831954a1c9800b
2015-02-06 10:57:47 -08:00
Natalie Harris 302f6faf64 Offline storage module.
Change-Id: I6d67faf99d535c0c77764b3c3b6311736ce8f9e1
2015-02-04 01:24:09 +00:00
Joey Parrish da94f7b1d7 Add PSSH v1 support.
Also reject any PSSH version we do not know.

Closes #19.

Change-Id: Ice898f787928341f2547b3254477a6e3145866ca
2015-01-29 09:42:07 -08:00
Joey Parrish f7d9ea5794 Refactor StringUtils into Uint8ArrayUtils.
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.

Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb
2015-01-29 09:41:06 -08:00
Joey Parrish de1495b9e9 Add more details to AJAX errors.
This adds URL, request method, and post DATA to all network errors.

Closes #18.

Change-Id: Ibb42163b341da82ea10c059147a171f34b8b3514
2015-01-28 13:25:52 -08:00
Joey Parrish b3d035be9f Shaka Player release v1.0 2014-12-19 14:26:19 -08:00