Commit Graph

3764 Commits

Author SHA1 Message Date
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 027ce8d953 Improve code coverage accuracy.
We have several classes not being tested, and they are now included
in the coverage data.

Change-Id: Ice9d7e2573cf3597882f003b13a5c65c75676823
2015-04-03 23:43:11 +00: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 8ddcd43569 Fix state of test app store button.
The button state is calculated by onMpdChange(), but requires offline
groups to be populated first.  The button state should also be updated
when the custom MPD field is used.

Issue #22.

Change-Id: I58009a4833c61d2db3b176b2f9868b3ae73725a1
2015-04-02 18:03:05 +00: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 7807b73e16 Expand HTTP section in test app.
This gives the HTTP dialog more horizontal space so that it looks
less awkward.

Change-Id: I16f22778952b5171b5a046edd556d60b35100b98
2015-04-02 18:02:44 +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 40298ef028 Upgrade jasmine-ajax and remove some hacks.
Closes #42.

Change-Id: I507b30ac1b6e6a640bed7c81c26b6bedf065e571
2015-04-01 17:17:59 -07: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 1c8e72dede Add new Sintel test asset in 4k.
Change-Id: I018efca4f95f0603190498b4e8360d30166223e4
2015-03-31 16:10:45 -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 e7b5e2f231 Add tests for FakeEvent.
This new test is currently failing with Chrome 43 TOT due to changes
to CustomEvent.  This is causing failures in the prefixed EME
polyfill and other components as well, since FakeEventTarget is used
in lots of places.

Change-Id: I6f217d11f7d1f6917084e5b0c081c55cabed9492
2015-03-31 14:08:38 -07:00
Joey Parrish 7b11de0cd3 Test EventManager with real Events and EventTargets.
Drop duplicate FakeEventTarget from spec.

Change-Id: I367241411d4d9c874ff132f7a9c01c5416926995
2015-03-31 14:01:39 -07:00
Joey Parrish 485c4890ca Fix up OfflineVideoSource docs/exports.
Change-Id: I9fe0dbdb410c92dbd99953b43ef6449eab475af0
2015-03-31 10:54:10 -07:00
Joey Parrish c25cf2a259 Add a note about checking out release versions.
Change-Id: I4f26112ce9770d2995ce1758a54a184e0d85f0b3
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 e2610936cd Restrict test app localStorage to one key.
Because localStorage is shared between pages on the same domain,
the way the test app used an arbitrary number and set of keys
causes a conflict with the documentation, which uses localStorage
to remember preferences.  This manifests in the appearance of an
unusable MPD in the offline list called "show", since this is the
localStorage key used by the docs.

Change-Id: Ie906f9d2f3259dae33d3682ce61e942e27531d26
2015-03-30 23:38:43 +00: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
Joey Parrish 902df7749e Merge pull request #40 from irock/fix-query-decode
Fix query parameter encoding
2015-03-27 15:16:52 -07: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 67deb5b7df Fix LicenseRequest tests by correcting AJAX mock.
The AJAX mock calls onload() and onreadystatechange() in the wrong
order.  This broke the tests when clock sync via onreadystatechange
was added.

Change-Id: I3f55698b6928d5434d1c3edf3bf7cd3b4bdb7eb3
2015-03-23 19:05:30 +00: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