These keys cannot always be used as keys, for example on IE11 where
very large init datas are found in PlayReady content. Since there
should not be a large number of unique init datas, a linear
suppression pass and a quadratic removeDuplicates should not be a
problem in practice.
Related to pull #176
Change-Id: I9dd9b5e45422544c86dd95686766625a0b336963
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.
This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.
Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.
The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.
We can re-examine this once we have restructured the license headers.
Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
If a session becomes "ready" more than once, there is a race where
it can wind up in the database multiple times. This eliminates
duplicate session IDs on both load and store, which avoids an
"unexpected completion" error from Chrome's EME implementation.
Change-Id: I749364cb12787a9c72324b2ad95adaf8ce1a00af
This introduces a new method on PublicPromise called destroy(),
which does for Promises what destroy() does for the other classes:
shuts down async processes and cleans up references.
In addition to catching errors and shutting down more cleanly in a
wider array of circumstances, this may also help with GC, since we
no longer leave pending Promises around with handlers attached to
them.
Closes#151
Change-Id: I205c5979418fbc18cd7e35d91d0de2746f337137
Use 'keystatuseschange' events from EME together with cenc:default_KID
from the MPD so StreamVideoSource can determine if the key system
can/will decrypt a stream before it attempts to play it. This enables
the Player to safely (and automatically) switch between streams that
are encrypted with different keys.
Support AdaptationSet @group, which is the preferred approach to safely
use multiple encryption keys over multiple Representations.
* Squash AdaptationSets from the same group into one StreamSetInfo.
This enables support for @group without introducing special case code
into StreamVideoSource and EmeManager.
* Fire 'trackchanged' events when tracks becomes available/unavailable
either from application restrictions or key status changes.
* Pull key IDs out of DrmInfo and put them into StreamInfo so key status
changes can drive per stream availability instead of per StreamSet
(AdaptationSet) availability.
Closes#67
Issue #160
Change-Id: Ife0814deb65715923a572b45880137a99b378035
The final chunk was only being stored when the endTime of the final
segment happened to be null. An index with explicit end times for
all segments, even on one stream, would trigger this bug.
For example, the end time of the final video segment may be null, but
the end time of the final audio segment may be equal to the content
duration. The stored audio would be missing a chunk, causing the
computed stream limit to be too short on playback.
This corrects the off-by-one error in the storage code by explicitly
signalling when a segment is the last one, rather than checking for
a null endTime.
Closes#157
Change-Id: Ic99d53b9e2b071409d4d9472b8bc4ae0cf76f940
Add new ContentProtection interpretation API that allows applications to
return multiple DRM configurations for each ContentProtection element
and to parse raw ContentProtection XML elements.
This patch deprecates DrmSchemeInfo in favor of DrmInfo. Furthermore,
DrmSchemeInfo will be removed post v1.5.0.
* Replace DrmSchemeInfo with DrmInfo.
* Move Restrictions class definition into its own file.
* Populate initData values from explicit PSSHs without application
intervention.
* Allow explicit PSSHs to differ between Representations
Issue #71
Issue #137
Closes b/23428584
Change-Id: Ib8d6ba630b930ee64f923a3f4a3e518abacccf88
This allows the app to intercept media requests to modify its URLs.
The callback accepts the URL for the request and returns a modified
URL or null to use the original.
Closes#148
Change-Id: I08352754ace05f318706fd93910097c0fa7696f0
build.sh now accepts several arguments that will disable features
that will not be needed. The default is to include all features.
Part of #116.
--disable-offline
--disable-dash
--disable-http
Change-Id: Icdaf82b322debbdc1e898e93c539e35894678a8d
* Rename the RangeRequestTimeout option to SegmentRequestTimeout
since the RangeRequest class no longer exists.
* Fix a few unit conversion errors between seconds and
milliseconds and vice versa.
Change-Id: I8695c3bfb79ae0e20ec5bc75d9ae9f941bccd023
Added a new class called FailoverUri which handles multiple URLs and
switches to others when one fails. This is also handles the request
itself. This replaces SegmentMetadata as well as a number of manual
requests.
The MPD parser now produces arrays of URIs rather than just one. The
MPD Processor then converts it to a FailoverUri inside the manifest.
Added unit tests to test the new functionality and updated the old ones
to the new changes.
This does not support failover on subtitles since subtitles are handled
by the browser.
Closes#68
Change-Id: I5410104827b9e4102b243444b1b5a3f01dcaf10d
The circular dependency,
ContentDatabase -> RangeRequest -> AjaxRequest -> ContentDatabase,
causes issues for the upstream Closure compiler. This patch breaks that
cycle by factoring out reading and writing operations from ContentDatabase
into ContentDatabaseReader and ContentDatabaseWriter respectively.
The following minor changes have been made to code that has moved:
* Removed retrieveInitSegment() since it's not used.
* Changed .stream_ids to ['stream_ids'] in retriveGroup().
* Reworked deleteGroup() so that it doesn't depend on retrieveGroup().
* Made deleteStream() private.
* Made minor formatting changes to meet the 80 character limit.
Change-Id: Idfc5d04ad32225a915b1531e0f4205137de5cc73
* Add a URL override and an HTTP method override to LicenseRequestInfo.
* Use LicenseRequestInfo objects as dictionaries so the pre-processor
interface works like the Player.configure() interface.
* Ensure LicenseRequestInfo fields are valid after the pre-processor
is called.
* Improve pre-processor integration test.
* Add @expose to some typedefs so they are included in the documentation.
Closes#134Closes#135
Change-Id: Ia29d36d70fa661d58196d166cbc60b281c679594
These may be used to sanity check arguments coming from outside
the library.
* Use new getter functions in Player.configure().
* Add additional tests for Player.configure().
Change-Id: Ib0b907cde46aeb65ca1273fb424e3f13872fa5da
* Reject Task Promise if one of its stages fails so that the caller's
catch handler is invoked.
* Use TypedBind consistently in affected Promise chains.
Closes#131
Change-Id: I94fa6688949444212fa0b1edd3a94e0de4d6956f
Now that google/closure-compiler#715 is fixed and we have upgraded to
a newer compiler, we can remove these casts.
b/21559591
Change-Id: I7769d95d7b440c648eb78e026d94544c640c41b4
Newer versions of the Closure Compiler issue warnings for several
anonymous functions due to what appears to be a failure to infer
certain types. This patch uses TypedBind to mollify the compiler.
This patch also fixes another issue raised by the newer compiler,
which is that index does not have duration and key_system properties.
b/21559591
Change-Id: Icff84ad084bfcd049f962bd4a0698b3fc78fc279
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
Adds an API to IBandwithEstimator to enable BandwithEstimator
implementations to allow/disallow caching.
Issue #76
Change-Id: I842994981a0821e22de412478f094850414b6289
* 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
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
Allow applications to pre-process license requests; also makes
the license post-processor an optional parameter.
Closes#62
Change-Id: Idb57f101c3a5f08da85d37ec7e252ffca886a6ae
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
* Remove the acceptableErrors system and replace with a status check
in SBM on request failure.
* End an SBM fetch task early on 404 or 410, but only during start
and switch.
* Retry segment fetch to recover from 404/410 errors sooner.
* Set retry delay based on segment duration.
* Remove the 'truncated' fetch mechanism and the 'pleasebuffer'
mechanism. (Retry is more robust than entering a buffering state.)
* Retry MPD requests as well. (Some live streams seem to experience
very transient 404 errors when requesting updates.)
Issue #21.
Change-Id: I2d3b838a9afe950e9ed0a91da9b952d8a30bf0a1
Since a task stage is asynchronous, some async part of it may need to
call end(). Because of this, we cannot realistically know if the
caller is part of the stage or not.
Change-Id: I2a31515b9a4c6dd1bf246079fb42effe7a2da622
* Export FakeEventTarget so IBandwidthEstimator implementations
can use it.
* Expose IBandwidthEstimator methods so they do not get renamed
in compiled mode.
Change-Id: Ib4c58d2357afdf402482202dc9fb8cf42dbbfad1
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