Commit Graph

2275 Commits

Author SHA1 Message Date
Joey Parrish 1a9febc9d1 Reverse nullability of BufferSource
This brings our externs in line with newer versions of the Closure
Compiler, where BufferSource is both defined and defaults to
non-nullable.

b/21559591

Change-Id: I5d51043e54b1b3490c25c4bb362025fa51260c07
2015-07-13 20:54:47 +00:00
Joey Parrish 2ca10eff3a Update catch extern
This updates the extern for Promise.prototype.catch to match the ES6
Promise externs in newer versions of the Closure Compiler.

b/21559591

Change-Id: I796d8293f7be3170e465eaf3f30ceb8c9c5698b6
2015-07-13 20:54:41 +00:00
Timothy Drews 59723f10c3 Add configure/getConfiguration API to Player.
Also deprecates some existing getters and setters.

Closes #93

Change-Id: I167e6764bb26c1d37c88b7fbee4a4880181f9812
2015-07-13 20:07:13 +00:00
Joey Parrish dee2f372a6 Be strict about nullability and scope
This fixes errors in newer versions of the Closure Compiler.

b/21559591

Change-Id: I3b9f08ccca81deb0f2bc0c7f2bb755d91285ec1e
2015-07-13 19:01:51 +00:00
Joey Parrish 146d0c1c14 Stop using @suppress {accessControls} to assert
This suppression no longer works on this scope in newer versions of
the Closure compiler.  In any case, making the assertions in the
class that owns those members is a better design.

b/21559591

Change-Id: I27696b3fd3c5a87bb595e5c6952ca7a523132f5f
2015-07-13 19:01:23 +00:00
Joey Parrish 9ae0c1eee6 Fix linter error
Simply removes trailing whitespace.

Change-Id: I6ebec0966a0d67c1fe4a783ee044c8e283dbf9b8
2015-07-13 11:13:32 -07:00
Timothy Drews bcdbc16ed9 Move 'main' property to correct class.
* Make the order of properties consistent between
  AdaptationSet and StreamSetInfo.
* Mark all MPD related constructors as @struct.

Change-Id: I7016aafb0bf073e6e4972b34e267ad6ef87f810c
2015-07-13 17:17:39 +00:00
Sanborn Hilland 7148fa7d0a Make setPlaybackStartTime comments clearer. 2015-07-13 10:10:42 -04:00
Sanborn Hilland a227988349 Change httpVideoSource setPlaybackStartTime to no-op. 2015-07-10 17:38:10 -04:00
Sanborn Hilland 32a95f91e0 Remove playbackStartTime getter. 2015-07-10 17:27:53 -04:00
Sanborn Hilland 6598d64f16 Add player method to set playback start time ahead of downloading chunks. 2015-07-10 17:04:35 -04:00
Natalie Harris a04bea1f75 Remove deprecated Player methods. Closes #118.
Change-Id: I2888c3b3a2c4bf3c6cdc674af74d636495b529ab
2015-07-09 09:10:11 -07:00
Timothy Drews 301da6b286 Stop robustness params from getting compiled out.
The audioRobustness and videoRobustness properties were getting
compiled out because they were being used like dictionary keys.

Change-Id: I7a2fea7f439c6540bc45126f550eae53858f7f4e
2015-07-08 18:03:17 +00:00
Joey Parrish 7f8eba0704 Fix single-URL SegmentLists
Previously, a SegmentList with a single URL resulted in a reference
with no end time.  Now the library can correctly deduce the end time
of a one-reference SegmentList.

Change-Id: Ia4ed3895e8b3c5da3e8713d944090bbab579f3de
2015-07-08 09:07:14 -07:00
Joey Parrish fc6621c54e Only choose one config per AdaptationSet
This is a more thorough fix for multiple encrypted audio tracks.

Rather than taking all matches for key system and codec, take one
match per AdaptationSet.  Now if there are multiple usable
DrmSchemeInfos for the same language, only one will be chosen per
language.

This makes the system more resiliant to ContentProtection callbacks
that ignore all input and return the same DrmSchemeInfo no matter
what.

Fixes #112

Change-Id: I9ed37ba1afdaec6bb5d8abaf285cb36b6e2a3db6
2015-07-07 14:37:57 -07:00
Joey Parrish a4dc7659fb Fix exception when stream limits assertion fails
When our assertion on stream limits fails, the debug code below it
was causing an exception, which broke other things.

This change keeps the original problem from triggering others.

Change-Id: Iacaf5be0134e6c6e0de2b25869013adeba62ba2a
2015-07-07 13:45:50 -07:00
Joey Parrish dddd830913 Update changelog and bump version to v1.4.0
Change-Id: Iaf47e964ffbae597382ec4bc19ed961da4dff674
2015-07-06 17:44:41 -07:00
Timothy Drews 34915527f0 Complete stream rework: refactor seek ranges.
* Move seek range updates into SegmentIndex implementations
  and StreamVideoSource.
* Remove unnecessary sub-class hooks from StreamVideoSource.
* Remove internal LiveSegmentIndex timer: do SegmentReference eviction
  and generation on demand.
* Rework Stream startup again: consider Streams as started when they
  have buffered some minimum amount of content. As part of this, only
  apply a timestamp correction to the SBM when the streams have started.
* Defer stream switches until all SegmentIndexes have been corrected.
* Partially revert optimistic "bufferedAhead" calculations in Stream:
  check if we've buffered enough content at least every second.
* Make LiveSegmentIndex more robust against a "wrong"
  @availabilityStartTime.
* Fix a bug where a positive timestamp correction would trigger an extra
  Stream resync.
* Fix a bug in evict_() where the first segment would never get evicted.
* Check stream started conditions in onUpdate_ instead of after a segment
  has been inserted.
* Tidy-up immediate/clearBuffer naming and other comments.

Closes #51
Closes #109

Change-Id: Ic6f0b96065d3c5dfb5c03ca1c52363bd77b22875
2015-07-06 14:20:01 -07:00
Joey Parrish 1f6e7eee81 Choose all matches for key system & codec
EmeManager should not stop at the first match, since this results in
only one language for multi-lingual content.

Fixes #112

Change-Id: I90109f53e4da38ac0fddc67476b7caab0c852381
2015-07-06 20:39:30 +00:00
Joey Parrish 70e370c7eb Add Porting and Browser Support tutorial
Also:
 - removes outdated isBrowserSupported() check for Node.children
 - adds mention of polyfill.installAll() to polyfill tutorial

Closes #66

Change-Id: I8a633858d2536ecf6110aac1326f58c17ccc5672
2015-06-30 22:44:17 +00:00
Vasantha Rao Polipelli bbd2dd0e28 Add server certificate support to DrmSchemeInfo.
Closes #84

Change-Id: Ifb6144f6cb0b6d3a68dd816a255aa04369fabeef
2015-06-26 20:27:09 +00:00
Timothy Drews 4d96b30ba5 Use @startNumber as specified in new MPD spec.
Reflect modifications made in ISO/IEC 23009-1:2014/Cor 1:2015:
allow @startNumber to be 0 and compute the $Time$ placeholder using
the segment number relative to the start of the Period.

Closes #10

Change-Id: I4a9b0e4e3593c01e2e8d42a74572e78b9fba50d9
2015-06-26 18:46:37 +00:00
Joey Parrish ccb3ed5ae3 Merge pull request #110 from ustudio/old-ie
Load without errors in IE 9
2015-06-26 09:36:37 -07:00
Thomas Stephens 0f914cf953 Removing unnecessary @type annotation 2015-06-26 10:23:10 -05:00
Thomas Stephens 2c7196ca07 Removing unnecessary @type annotation 2015-06-26 09:13:54 -05:00
Timothy Drews e8fdcc2eb3 Enable BandwidthEstimators to allow caching.
Adds an API to IBandwithEstimator to enable BandwithEstimator
implementations to allow/disallow caching.

Issue #76

Change-Id: I842994981a0821e22de412478f094850414b6289
2015-06-26 03:41:18 +00:00
Thomas Stephens 5abe5b59df Adding missing docs and type annotations 2015-06-25 09:23:20 -05:00
Thomas Stephens 6a235a107e Code review comments 2015-06-24 22:08:14 -05:00
Timothy Drews e8cabb6029 Use the Location element for MPD updates.
Closes #65

Change-Id: I92790ba3502cde5899085f02c6a80a48ba093ee2
2015-06-24 00:59:36 +00:00
Natalie Harris cdb2934a0f Add trick play to the test app. Issue #54.
Change-Id: Icb90675f1f8e7409f53b5a0d9aa50ad92c1e1f12
2015-06-23 14:16:36 -07:00
Joey Parrish 233e3351ee Revert "Do not assign currentTime of video unless MetaData is available."
This reverts commit 93aa2ed0e8,
which broke live streaming.

To reproduce, use: spec_runner.html?spec=Player%20live

Change-Id: I734f36cfc1226d34058e70b723e53d607664fb53
2015-06-19 13:09:44 -07:00
Joey Parrish 472ec24eb9 Merge pull request #103 from nickdesaulniers/firefox
defer assigning to video.currentTime Fixes #101
2015-06-19 09:54:28 -07:00
Thomas Stephens 72608396da Check for Uint8Array in isBrowserSupported 2015-06-19 11:27:33 -05:00
Thomas Stephens 4e14ff8a6f Code review comments 2015-06-19 11:27:18 -05:00
Thomas Stephens b0a8017866 Style fixes 2015-06-19 09:50:12 -05:00
Thomas Stephens 2ed347862e Patching console.assert when it does not exist, or when bind is not implemented on it (IE 9 with F12 Developer Tools open) 2015-06-18 16:47:29 -05:00
Thomas Stephens ec623c6d38 Patching console logging functions when they do not exist, or when bind is not implemented on them (IE 9 with F12 Developer Tools open) 2015-06-18 16:47:09 -05:00
Thomas Stephens b1baaaf33c IE 9 has window.performance, but not window.performance.now, so explicitly checking for it 2015-06-18 16:18:19 -05:00
Nick Desaulniers 93aa2ed0e8 Do not assign currentTime of video unless MetaData is available.
Fixes #101
Required for Firefox's and IE's MediaElement implementations.
2015-06-18 13:58:56 -07:00
Timothy Drews fbea2279b3 Re-work stream switching.
* Allow segments from different streams (Representations) to coexist
  in buffer.
* Only fetch a single segment at a time.
* Remove id field from SegmentReference and remove SegmentRange.
* Only start the Streams once the buffer is "full".
* Stop DashVideoSource from triggering an extra resync during startup.
* Make Task.abort call order deterministic.

A follow-up patch is required to handle certain seek patterns in
live streams.

Issue #51

Change-Id: Ib7c9021471f1ed89323f19764463202b119cb491
2015-06-18 12:54:25 -07:00
Joey Parrish 4114342cba Enhance FakeEvent assert output
This makes it easier to see which key is failing when debugging.

Change-Id: I236219d93c833d2de2a92a232414309e20f09b15
2015-06-13 18:50:37 +00:00
Timothy Drews ee6b3942af Use all members in DrmSchemeInfo.combine().
* Check each member in DrmSchemeInfo.combine().
* Modify the resulting DrmSchemeInfo in-place.

Closes #96

Change-Id: I5eddb29966c4b2ad39f4140c3c87dca96aee28f8
2015-06-12 22:44:11 +00:00
Joey Parrish 8efe577459 Fix offline percentage
This was broken by a bad reduce, in which the initial value of "sum"
was an object.

Change-Id: I3ce2d723e9274dd7c3c86340d321ef8e3d030792
2015-06-12 22:12:55 +00:00
Timothy Drews 22c57e99e4 Rework SegmentIndex functionality.
This patch reworks SegmentIndexes so that any SegmentReference they
contain is guaranteed to be available. This makes SegmentIndexes work
consistently between static content and live content (specifically
content specified using SegmentTemplate with @duration).

* Rework StreamInfo to use a ISegmentIndexSource and a ISegmentInitSource,
  which construct a SegmentIndex and an intiailization segment
  respectively.
* Make ManifestInfo destructible and various async operations in
  StreamVideoSource safer.
* Introduce LiveSegmentIndex, which manages SegmentReference eviction.
* Introduce DynamicLiveSegmentIndex, which manages SegmentReference
  eviction and generation.
* Implement improved segment availability logic for segment eviction.
* Move SegmentIndex construction from MpdProcessor to several
  ISegmentIndexSource implementations.
* Use a SegmentIndex to represent subtitles to simplify Stream creation
  in StreamVideoSource.
* Move manifest update code from StreamVideoSource to ManifestUpdater.
* Move PeriodInfo.duration determination in MpdProcessor to StreamVideoSource.
* Since "forced" manifest updates are no longer required for content
  specified using SegmentTemplate with @duration, simplify manifest update
  code in DashVideoSource.
* Make Stream continue to update even if it runs out of
  SegmentReferences, this simplifies previous resync logic and makes
  DynamicLiveSegmentIndex work seamlessly.
* Refactor SegmentIndex and initialization fetch code in ContentDatabase.
* Download all SegmentIndexes in the background after the initial streams
  have started.

Follow up work is required to remove seek range logic from
DashVideoSource.

Change-Id: I4a908195aba632a911a6e55213fc41d41428162b
2015-06-09 11:46:40 -07:00
Timothy Drews 6d08f0b97a Add a license pre-processor.
Allow applications to pre-process license requests; also makes
the license post-processor an optional parameter.

Closes #62

Change-Id: Idb57f101c3a5f08da85d37ec7e252ffca886a6ae
2015-06-09 15:58:14 +00:00
Timothy Drews 4f54a10f88 Use app provided EME config flags.
This allows an applications to set distinctiveIdentifier,
persistentState, and robustness when the player calls
requestMediaKeySystemAccess().

Change-Id: I1c2f035cfacbf45c8e718fb31c5c0c9a8e55d72b
2015-06-05 23:11:21 +00:00
Joey Parrish 1e400f536f Avoid load-time uses of Uint8Array.
This is inteded to fix a couple of the load-time exceptions seen
when loading the library on IE9.  Eliminating load-time exceptions
will make it possible to use isBrowserSupported() as intended, to
avoid use of the library on older browsers.

Issue #87

Change-Id: I993d4f955e80a7401bea182ae90df43a8a022ca2
2015-06-02 16:31:27 -07:00
Natalie Harris fcbf4da0c8 Update player destroy to return a promise.
I was seeing errors in the integration tests due to setMediaKeys not
finishing before the next test was started. This ensures that the
mediaKeys will be null before each new test run.

Change-Id: Iaaa9dea67b315b1a91ec83668fb0ed9ffaa3f087
2015-06-02 10:21:19 -07:00
Natalie Harris 01abbf5952 Two live integration tests for Segment Duration MPDs.
Change-Id: I1a3489a72ec79c76d4b8de4e376de2cde98cee68
2015-05-28 08:51:26 -07:00
Joey Parrish 5343363168 Fix v01b EME polyfill expiration.
Fix the definition of expiration to be consistent with the details in
w3c/encrypted-media#58 .  In particular, never use infinity.

This means using key status to check if a session is new, rather than
comparing the expiration time to NaN.

Change-Id: Ib1917a34d4dfd0fd29b1c578c6ce60fd996c2698
2015-05-22 19:05:50 +00:00