We were giving Storage a Player proxy from CastProxy instead of a
local Player instance. This fixes the mistake and adds a new error
code to make it clear when this mistake is made by other apps.
Change-Id: I4f2d49adc45ef5ca3a942a72192a09f001f5100c
This adds a utility to mpd_utils.js that filters a manifest and
automatically downloads and substitutes in the contents of any xlink
link.
This only supports xlink:actuate="onLoad"; "onRequest" would require
significant changes to our manifest processing pipeline.
It also adds a new field to INVALID_XML errors to indicate which
xml was invalid, to make the error more informative when called on
xml loaded by xlink links.
Also added a demo asset.
This is just a simple modification of heliocentrism to break it into
multiple files.
Closes#587
Change-Id: If87b1e78e65261dcc4e043b0c2e6cf69c1b12e08
This adds a severity field to Error objects. This can be used to
detect whether an error is recoverable. All the same errors are still
reported so the field can be ignored.
There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
load() again
Closes#564
Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
This abstracts the creation of DrmInfo to parse the EXT-X-KEY tag
differently per KEYFORMAT.
Issue #279
Change-Id: I2e187dcfc01f7306183c9090c54de58e81872bc4
We don't allow switching between Periods that are video+audio to
video-only because it is incompatible with MSE. When the browser
gets to the transition, it will pause waiting for the audio buffer.
However, we should allow switching between Periods that do and do not
have text streams.
Issue #715
Change-Id: I77f3bf92681d8181c90169b8f4a15857b7d9e66d
An init segment is not required for all streams, some streams are
self-initializing (e.g. MPEG2-TS).
Issue #279
Change-Id: I99556ee26f6568cc5e712b50d0bb4de78cb2bd9d
There are some error cases where IE's implementation of DOMParser
will throw an exception, but Edge's implementation will return a
parsererror. This means that, in those cases, IE would result in and
INVALID_XML error and Edge would result in an INVALID_TTML error.
It's preferable for the errors to be consistent cross-browser, so
this folds the INVALID_TTML error into the INVALID_XML error.
Change-Id: Iee575ea22e8e803dd241b00e86f888668f4392c8
The implementation of DOMParser on Internet Explorer and Edge actually
implement xml:space, which means that if you passed in an invalid value
the parser would error immediately.
Thus, on IE and Edge, an invalid xml:space value would return an
INVALID_XML error instead of an INVALID_XML_SPACE error.
Though clear errors are useful, such browser-dependent behavior would
just be confusing in the long run.
Change-Id: I46c24452a216fa8bc242148e23d275230f277037
To better support alternate storage mechanisms, this change abstracts
shaka.offline.DBEngine into an interface called
shaka.offline.IStorageEngine.
DBEngine has been changed to implement this interface, and allows the
addition of implementations that do not use IndexedDB.
Change-Id: I6a94067001ee53049df11cb68604bb57912300bb
Previously, we did not properly handle indentation in Ttml files, which
could result in the indentation of the XML elements showing up as part
of the subtitles. This adds support for xml:space settings, to
allow the maker of the manifest to enable or disable this behavior.
Closes#665
Change-Id: Iafee92a536ce6eb2d73c32186500715adb52e26b
We were not able to get our externs generated by the Closure compiler.
There were many issues with the Closure-generated externs, including
the order of the externs and the replacement of record types and enums
with their underlying types.
We made a few attempts to patch the compiler, but could not get our
patches accepted upstream.
This change introduces a new script to generate our externs from
scratch. It uses a JavaScript parser called 'esprima'.
Some interfaces need to be exported to the generated externs, but are
not actually attached to the namespace by the compiler. For this, we
introduce a new annotation. These are the currently-supported export
annotations:
- @export: truly exported (attached to namespace) by the compiler
- @expose: truly exposed (not renamed) by the compiler
- @exportDoc: considered part of the exports in the docs
- @exportInterface: considered part of the exports in generated externs
These annotations are now documented in docs/design/export.md
Change-Id: I33bf7384889c14c9edb0fa5f11caa7c4f4d79af6
Error codes do not get reused, because that could create confusion in
bug reports.
To make it easier to add new error codes, we should keep track of
retired error codes. This adds placeholder comments for all of the
error codes which are no longer in use.
Change-Id: I70eca30d3108e35d9db388f4372189ab7c014f92
Before this, an empty manifest (no periods) would result in a
TypeError from the containsInband computation. This corrects the
computation and introduces an explicit error for empty manifests.
Closes#618
Change-Id: Ie9b740dbfa4ffcafbf99541bf03fa68cfae2bf88
Behavior for IPR streams:
* offline storage disallowed
* segment references will not be stretched to the period
* seek range starts at 0
* seek range end is calculated like the live edge
* seek bar is from 0 to duration, not the seek range
Closes#477
Change-Id: Ia36874bb7208c2473c79cb817395ce03925b8c95
For content without a clear lead, the order of 'waitingforkey' and
'keystatuseschange' is inconsistent and causes false positives for the
WRONG_KEYS error. Without an obvious inverse for 'waitingforkey', we
will have to drop the WRONG_KEYS diagnostic error.
See also: w3c/encrypted-media#284
Change-Id: Icc1c420ff5d177a0329db244a6b28e99820a5221
* Suppress WRONG_KEYS errors when output is restricted. This is a
false alarm in these cases anyway.
* Throw a restriction error when the ABR manager fails to choose
streams for some content types.
* Rename ALL_STREAMS_RESTRICTED to RESTRICTIONS_CANNOT_BE_MET to
reflect the way restrictions actually work. We cannot play if all
streams of any one type are restricted, not just all streams in the
period. (e.g., all video restricted is a failure, even if audio is
still playable.)
b/30290503
Change-Id: I6de48950d33f241b7df1161052d60b89f962649f
SimpleAbrManager will now leave 5s of video ahead of the playhead and
clear the rest when upgrading to a higher resolution.
Also smooths transitions for overlapping segments by scheduling an
abort() call to reset MediaSource internals after removing content or
changing the append window.
Related to issue #435
Change-Id: Ie036515388e1e7e4b3b8f3ab9922e3d5e7ed2627
This introduces Chromecast support directly in the v2 library, as well
as in the demo app.
See the included design doc for details.
Issue #261
Change-Id: I26a707e7fa6bd829c3ebc70e4c9345ec25eed000
Also involves some cleanup:
- Differentiate between WRONG_KEYS and EXPIRED.
- Fix session expiration detection for CDMs without sub-second
time resolution.
- Export accumulated key status over all active sessions.
- Update DrmEngine workarounds with bug links.
b/29919059
Change-Id: Ia4f12657285b0d431ed7a0c22ee4312375fdd40e
Now the Storage class can store protected content and play it back.
When deleting it, the offline EME sessions will be removed. Also
now offline support appears in Player.support().
Closes#343
Change-Id: Ic5b5a0e0854d80f7821e04e751275abf40ee6eb6
This contains two major parts: the Storage class, which manages
storing, listing, and deleting the stored content, and the offline
manifest parser, which loads the stored content into a manifest so the
Player can play it.
This does not include support for storing encrypted content. The
EME sessions will not be stored properly and will fail to play.
Issue #343
Change-Id: I7ecb3400391ec8100155aa972f9b09bb7ae24d9d
Before, the same error was used for no available configurations or
key systems and for missing key system URI. Now there are two
different errors. Also elaborated on the error in the documentation.
Closes#371
Change-Id: I9b72daa0a99b4761714a74c3ceba60c873c89a77
Representations without Segment* elements or which do not
specify "text" as their type are now ignored instead of causing
failure.
Issue #368
Change-Id: Ica6490442dc38c7fdbc778eb0650dd7909d764c5
This is part of the v2 equivalent of the ContentDatabase. This only
manages low-level interactions with the IndexedDB and wraps all
actions in Promises.
This also adds an in-memory version that is used for testing.
Issue #343
Change-Id: I0d296639e74c1d4cab232ce7248b03a353b38b3c
* Set this.parser_ to the correct property in load()
(stops old manifests from being fetched).
* Stop load() from unloading first when the Player is a new instance.
* Handle multiple repeated calls to load().
* Fully cleanup after partial loads.
* Add additional destruction checks.
Issue #369
Change-Id: I43d5ed90c8119b1040b87a0dc187f52738e1c683
MediaSource may throw QuotaExceededError if it cannot append a
segment. Now, StreamingEngine will catch these errors from
MediaSourceEngine and reduce the buffering goals to avoid
encountering additional errors.
Closes#258
Change-Id: I1d957831424a4a6fb2681ee2c4f9ed7db7bf1711
Now the application can restrict the kinds of tracks that the Player
will play. This is done through player.configure(). This also
allows restricting the playable tracks based on the EME key status.
Closes#326Closes#327
Change-Id: I88210ece6fd1db886c49d4599fbe5814d394132d
* Instead of using drift when looking up segment positions,
just fetch the segment before the one needed.
* Handle missing segments by polling instead of failing right away.
Closes#330
Change-Id: Ia7bb74d0120ee3ee965e351f87fc5f170ad585bd
Now there will be an error if the wrong keys are retrieved from the
license server. This can happen if the manifest is incorrect or if
the license server returns the wrong keys.
Closes#301
Change-Id: Id141cb74d02513f8e83205fd5d3242c887468d4e
This also changes DrmEngine to reject key systems that do not have
any license servers, this causes init() to fail.
Change-Id: I10148c2caa2ffc57bf6c5f16421ed0600d98be95
The receipt buffer mechanism allowed us use byte-based
eviction; however, it increased the complexity of StreamingEngine
and required us to make strict assumptions about the manifest.
With the receipt buffer gone, we will now do time-based eviction.
Applications can specify a maximum "buffer tail" length instead of a
maximum byte limit.
Change-Id: Iafdbe2e71516ea0ae18254b9767ecfc1d6813644