Commit Graph

2275 Commits

Author SHA1 Message Date
Timothy Drews ea6d57c232 Reorganize mpd_processor.js
* Make function order in mpd_processor.js match function
  dependencies.
* Make a two line parameter list into a one line parameter list.

Actual code and comments are not changed.

Change-Id: I586b2552601a3c36c5cd1711f4589447213462a4
2015-04-07 18:31:41 +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 79b638fe8d Evict unavailable SegmentReferences.
Issue #21

Change-Id: I137f5e1e38f093e355ace5aaa29780bd93980fad
2015-04-06 15:25:49 -07: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
Natalie Harris 86ffb4fb2b Delete a group of streams from storage functionality. Issue #22
Change-Id: I0318da7adc9cfdb154fb826486718385a771f544
2015-04-06 20:25:12 +00:00
Joey Parrish 489abbffdc Measure MPD fetch latency.
Issue #21.

Change-Id: Id1720fbfb716df414262604d8c1b86c78dd6fe93
2015-04-06 10:54:23 -07:00
Joey Parrish f0f93726ea Add live seek range support to the test UI.
Issue #21.

Change-Id: Ibc338b46e423d8f7ecafdaa7c2397032faabbd1a
2015-04-04 01:40:46 +00:00
Joey Parrish 20c8b0d5b4 Let the application choose streams for offline.
Issue #22.

Change-Id: I38cb1b33d787e2766e3b2d399add4e668d0dc751
2015-04-04 01:40:43 +00:00
Joey Parrish 1818979b02 Bubble-up the pleasebuffer event.
This should just be a normal bubbling event.  There was really no
need to re-dispatch it in the first place.

Change-Id: I1bb5d7bd9d6dfd4cb5db642a3ca3a849f1a1673e
2015-04-03 16:50:22 -07:00
Joey Parrish 55109fd79d Squash an uncaught exception error in the tests.
The error showed up in the JS console, but did not affect the test
results.

Change-Id: I5a4ebae1aaa81414e3682e2c6a56fac3bdc44f56
2015-04-03 23:42:54 +00:00
Timothy Drews eb78046e4a Compute seek ranges; refactor Stream creation/startup.
* Compute a seek range in DashVideoSource and update the
  seek range for live streams.
* Fire an event when the seek range changes.
* Refactor stream creation and startup in
  StreamVideoSource: streams are only created and started once all
  streams are available.
* Correct 5b659acf9a, which set the video's
  current time after the streams have been started. The video's
  current time should be set before the streams start so that the
  correct segment ranges are buffered. Fix buffering issue by
  ensuring the streams do not have disjoint timelines before
  starting.

Issue #21

Change-Id: Ib8f4924b09bfdf0e3b61e25273e16fd313feaf24
2015-04-03 23:40:33 +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 a4ed00b2ac Disallow ClearKey storage in prefixed EME.
This prevents false positives for clearkey license storage using prefixed EME.

Issue #23.

Change-Id: I28e2d460c8fa796f5ee326fd3d01dfa20dd8fc19
2015-04-03 14:18:57 -07:00
Joey Parrish 37befdf70a Fix offline license storage quirks.
This introduces a new heuristic to determine when licenses have
been stored.

Also moves license acquisition before storage of content, so that
failure is quicker on platforms which don't support offline licenses.

Issue #23.

Change-Id: I683690077e134e40285727e6586b0f265f36e7fb
2015-04-02 18:02:57 +00:00
Joey Parrish 5d40798f59 Check for IndexedDB support.
Issue #22.

Change-Id: I334eb6f91894fb13a56911d50827514b504f3c25
2015-04-02 17:47:12 +00:00
Joey Parrish 0b74f0b9f5 Persistent license support error message for v01b.
Change-Id: I34cad444dac4aad555f835ae657c9869da6a290d
2015-04-02 17:47:02 +00:00
Joey Parrish 81ba999c5a Only nudge when the data is buffered.
Change-Id: If1a843ddb1010ade65975465cb1dcf27d2d759e1
2015-04-01 15:58:42 -07: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 7ef435f951 Start AbrManager timer after streams start.
Also converts AbrManager timestamps to milliseconds.

Change-Id: I241ecd7515dcc4af095c85220106d28a9be30ee9
2015-04-01 12:03:36 -07:00
Joey Parrish 5273d71dc6 Leave unused MKSC fields undefined.
This fixes EME draft spec compliance issues.

Closes #45.

Change-Id: Ida55d5a14da03acdc0120fb5946c33ab42d800c3
2015-04-01 12:03:36 -07:00
Joey Parrish b4b936e630 Make AbrManager less agressive.
We used to wait until 8 seconds after the last adaptation began.
Now we wait until 30 seconds after the last adaptation completed.

Change-Id: Ibb673d1a2ca45d403a77a037fa3eeea9698d3e31
2015-03-31 17:19:05 -07:00
Joey Parrish 9940d96d73 Remove flaky assertion in EME polyfill.
This assertion did not add much value, and it sometimes triggers a
test failure.  Since prefixed EME does not have actual session
management, it's entirely possible for a stray message to come in
for a session we've already destroyed in the polyfill.  Rather than
assert, just ignore it.

Change-Id: I4779d3f36a25bc21ade95c4ea3f25ad1f8a96e7b
2015-03-31 16:34:20 -07:00
Joey Parrish b35a6d8b05 Re-fix b/18597152 (lock up on seek pattern)
This re-fixes an old bug in a new way.  The old bug was reintroduced
by the fix for github issue #15.

This addresses the problem as an MSE implementaiton bug, and should
be more robust than the last fix.

Change-Id: I836801da2d72033dfa8c71a5587a2d836c534034
2015-03-31 15:56:03 -07:00
Joey Parrish 30e560a192 Avoid hasOwnProperty.
If fullscreenElement were defined not on document, but in its
prototype chain, using hasOwnProperty would fail to detect
fullscreenElement.  So use the "in" operator to avoid making
assumptions about implementation details for this property.

Change-Id: I27aa4b0091f7534525f71932e73d18293c848303
2015-03-31 15:19:41 -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 485c4890ca Fix up OfflineVideoSource docs/exports.
Change-Id: I9fe0dbdb410c92dbd99953b43ef6449eab475af0
2015-03-31 10:54:10 -07:00
Joey Parrish 3369b52dad End buffering state on unload/playing.
This fixes perma-buffering on subsequent streams after a live
stream "ends".

Change-Id: Ieb886e8897ba9b42351e7d764f3e06bad9eedb61
2015-03-31 10:25:29 -07:00
Joey Parrish 13a8e9052e Go into a buffering state on 404 or 410.
Change-Id: I8717c60d55e2d10fd5a00da2ca60218d82d52ec5
2015-03-31 09:45:33 -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
Timothy Drews 5b659acf9a Recover from unavailable live streams.
* After updating a manifest restart any streams that failed
  to initially start.
* Seek to the stream start time only after the streams have been
  initialized, seeking before can cause lock-ups with MSE.
* Rename 'bestStartTime' to 'currentSegmentStartTime'.

Issue #21

Change-Id: Ibad91fe2d5171196e93f20961008cdd25ecc437e
2015-03-30 19:19:53 +00:00
Joey Parrish ade8cbeb0d Disallow storing live streams offline.
Issues #21 and #22 collide!

Change-Id: I527e7778ba00569f78fd96b2f759688b43753ff5
2015-03-27 22:52:27 +00:00
Joey Parrish 84b1ee3b07 Refactor SourceBufferManager.
This leverages Task to close some race conditions on abort.

Change-Id: I0089de1484b89734c31aafcd36b16597bde98024
2015-03-27 22:51:57 +00: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 b73e810d16 Close database connection opened in offline load. Issue #22
Change-Id: Icfff8487d4e57fa5fa993506cfb1f3cff4723fe7
2015-03-27 14:56:05 -07: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
Timothy Drews 0f7069588a Change 'segmentNumber' to 'id' in SegmentReference.
* The segmentNumber member in SegmentReference is used as an ID,
  so rename it and update the doc string.
* Tidy up SegmentIndex unit tests.

Change-Id: I888b8cbfd6a198bab09f6ab846cbdbf70cfcaa5a
2015-03-26 19:09:50 +00:00
Timothy Drews 3e9847a7eb Update the manifest only when needed.
For live streams, update the manifest at least every
@minimumUpdatePeriod seconds, but always before the stream exhausts the
list of SegmentReferences.

Issue #21

Change-Id: I71cd75d86ffd342f812621d7d60f4ede4851db83
2015-03-26 11:13:49 -07:00
Timothy Drews a8e567c9db Start live streams near the "live-edge".
* Construct the initial SegmentIndex for a live stream such that it
  includes at least @timeShiftBufferDepth seconds of content before
  the "live-edge".
* Use segment numbers relative to @startNumber instead of relative
  to the start of the Period in SegmentReference to handle MPDs
  with partial segment information.
* Start live streams near the "live-edge", a.k.a., "best start time",
  and start static streams at the latest start time.

Issue #21

Change-Id: I3c553a1b7120a59c68f19cdc85f412f31972c1b8
2015-03-25 15:43:33 -07:00
Joey Parrish 9441c5a720 Calculate buffering based on media timestamps.
The Stream should not rely on the segment index for timestamps, since
this can be inaccurate, especially for live content.

Closes #44

Change-Id: Ie7202e04b6a96c3758541680ceed781bf6bd2ab3
2015-03-25 22:29:23 +00:00
Natalie Harris c97ebf3485 Support for EME offline. Issue #23
Change-Id: I27632f196b6ec65ace67d3ee9794683fd9f639ab
2015-03-25 22:22:42 +00:00
Timothy Drews 069d8c3e6d Write tests and fix bugs with manifest updates.
* Write an initial set of unit tests for
  StreamVideoSource.update().
* Correctly handle new manifests that omit periods, stream sets,
  and streams that existed in the original manifest.
* Make StreamVideoSource.update() synchronous.
* Disallow merging SIDX based SegmentIndexes.

Issue #21

Change-Id: Id2e0b8cf56dd4b878b654732b7a088422163f418
2015-03-25 15:00:06 -07:00
Timothy Drews bc8c2bcf49 Refactor MpdProcessor.
* Expand SegmentTemplates directly to StreamInfos instead of using
  intermediate SegmentBases and SegmentLists.
* Remove "fake" attributes from SegmentBase and SegmentUrl.
* Simplify Period duration derivation.
* Add additional unit tests.

Change-Id: I203e269bd9dfb1fb1cc4ca48be29043c1ee4007b
2015-03-24 18:25:22 +00:00
Joey Parrish 80db83c678 Speed up tests and reduce flake.
Some seek-related tests have been flaky lately.  This reduces some of
the test flake, and speeds up a great number of tests.

This shaves as much as 45 seconds or 30% off of the run time of the
integration tests.

Change-Id: Ic8eab5037808e792344f43793b099183b405c6e3
2015-03-23 16:07:00 -07:00
Joey Parrish a7e2fe5d81 Remove Restrictions from postprocessor callback.
If a postprocessor wants to impose restrictions, it will now have to
talk directly to the Player to do so.

Also closes #41.

Change-Id: Ic5acf63c2572bb440cc53026561b9e98ffb752ec
2015-03-23 19:03:46 +00:00
Joey Parrish d576fa693b Improve rewind accuracy.
This fixes some test flakiness around setPlaybackRate.

Change-Id: I576f7c6d797513d7b3799e38da0421f34e12aab7
2015-03-23 18:21:12 +00:00
Joey Parrish 630745ee83 Remove audio type hack.
This hack seems to work around a piece of broken content, but disables
audio on some legitimate content.

Change-Id: Ia559391ac4446bda2392feb00e3285834792c026
2015-03-22 21:48:19 -07:00
Timothy Drews 7606e3349b Remove unnecessary Stream.getCurrentTime().
Change-Id: I0c9d11d9b74b3d3ecc6317df8194f3e294f3b370
2015-03-20 16:55:09 +00:00
Timothy Drews ac95cdfe14 Correct treatment of StreamInfo.timestampOffset.
* Set SourceBuffer.timestampOffset to StreamInfo.timestampOffset
  directly.
* Compute StreamInfo.timestampOffset in MpdProcessor.

Change-Id: Iea5621bc29df3de29d378e58720d6f71452274cd
2015-03-19 14:55:34 -07: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