This changes several classes to use the Destroyer class to handle
destroy(). This also changes the behavior to not ignore destruction
and instead throw a new error. This is more clear for callers and
ensures we propagate errors.
Change-Id: I756c085639558509c22e5c43d69ddf4acd28d46f
Code in karma-jasmine's adapter will malform test failures when the
expectation message contains a stack trace, losing the failure message
and mixing up the stack trace of the failure. To avoid this, we
modify shaka.util.Error not to create a stack trace. This trace is
not available in production, and there is never any need for it in the
tests.
One test expectation had to be updated. The previous version of
jasmineError would use the original error by reference. Now that it's
capturing a few fields explicitly, the severity value doesn't update
when NetworkingEngine modifies the original.
Change-Id: If7af93a1a0357df9763dbf6a4afc45db2c8317df
This enables the eslint rule that requires all functions to consistently
either return a value or not return a value.
Change-Id: I98b579f3689c3b6c74968116824231bb792bd9dd
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
If the application developer specifies license servers, only those
should be used. Before this, a manifest-specified license server
for a certain key system could still be used if the application didn't
provide one.
Now, if there are _any_ license servers specified by the app, _no_
license servers will be used from the manifest. This is important
because it allows the application a clear way to indicate which DRM
systems should be used on platforms with multiple DRM systems.
The new order of preference for drmInfo:
1. Clear Key config, used for debugging, should override everything else.
(The application can still specify a clearkey license server.)
2. Application-configured servers, if any are present, should override
anything from the manifest. Nuance: if key system A is in the manifest
and key system B is in the player config, only B will be used, not A.
3. Manifest-provided license servers are only used if nothing else is
specified.
Introduced in #1644 to solve #484
Internal issue b/131264101
Closes#1905
Change-Id: I1a36a70044dc7bcc22681e3e4246d0a43d58e413
Currently we check encrypt key tags after we parse the segment, so
playing an AES-128 encrypted content results in error message
'MANIFEST.HLS_COULD_NOT_PARSE_SEGMENT_START_TIME'. We should check the
encrypt key before, and give a more clear error message.
Filtering out the contents encrypted with AES-128, and if there's no
valid content left, we'll show 'CONTENT_UNSUPPORTED_BY_BROWSER'.
Closes#1838
Change-Id: I893f57a939e45f2787144dfe311b779aed26ac34
When reading through shaka.Player I found a promise that was being
rejected without an error. This change removes the log call and
rejects the promise with an error object.
Change-Id: I7072e2bb1ec367750ebb2dce31edff4e9c9e857b
https://goo.gl is being turned-down, so we can't use it for new URLS.
So we have consistent short links, this converts them to be
https://bit.ly.
Change-Id: I07a86cba807b67157664893341f648023918d0de
Added a method to get a cell from storage muxer. Unlike resolve path
this will return a rejected promise if the cell can not be found.
Issue #1248
Change-Id: Ia594b7741351d515e564e574321e49ad51073005
Normally, we expect that only media playlists contain segment tags
(EXT-X-KEY, EXTINF, etc). We determine if a playlist is a media
playlist by the presence of an appropriate playlist tag (EXT-X-MAP,
EXT-X-PLAYLIST-TYPE, etc).
However, we were checking tags one-by-one, on a single while loop.
This meant that we would reject manifests where a segment tag appears
before a playlist tag, as we did not yet know that the playlist was a
media playlist.
This changes the manifest text parser so that it checks for playlist
type first.
Issue #1382
Change-Id: I1b9f674a58c60ab291d6d004462b0c0cae49631d
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.
This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.
Change-Id: I225f5c7e54adf4cca8512cddae082ba50ed82e4e
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.
This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.
Change-Id: Ibcaf21382bd78b91e589122983dd14e001bfdad5
Fixed an issue where an update call the IndexedDB was not replacing
the correct value because the key was getting changed to a string.
IndexedDB will count a missing key as a success, so check that the
value is undefined.
Issue: #1248
Change-Id: Icdd6ae263374c655170c6470df85c656b8bd3ba2
This adds attach/detach methods to replace the media element in the
Player constructor. Now applications can take back control of the
media element or provide a reference later in the Player's life cycle.
This also allows applications to decide whether or not to set up
MediaSource in advance, through an optional argument on attach and
unload. The default will be to set up MediaSource in advance, which
maintains current behavior. This advanced setup of MediaSource can
improve load latency later.
This change also introduces async/await for the first time in the
project, which required changes to eslint config, Closure build
arguments, Babel & Babel-polyfill setup, and the esprima parser used
by our extern generator.
The use of async/await will improve readability in many places, and
these infrastructure changes to enable async/await should also unblock
issues #1336 and #1337.
Closes#1087
Change-Id: I0d6b4e0e2af27a6520a3d070fa92b7139b2cb8b0
Since the database schemes for idb versions 2 and 3 used the same
data types (shaka offline version 2) this storage cell can be used
for both. The only difference is that idb version 2 has a fixed
key space.
Issue: #1248
Change-Id: Iac5cb1d57f93fdb81729b59d67d6736e29c9968c
Google style guide requires adding curly braces to all block statements
even if it is only has one line. This fixes it by using eslint's
--fix flag followed by running clang-format to reformat the change.
Change-Id: Idc086c2aa8c02df5ef8b2140a11bfb9128eeb4bd
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I10f5c38a8b06b5797c6eec7492829084114514c9
Fetch requests with a method of GET or HEADER cannot have a body, or
else the request will fail. Normally we had no problems with this, but
it turns out that Edge counts a body of 'null' as being defined.
This changes the Fetch scheme plugin so that it will replace null with
undefined for the body in the init data.
This also makes it so that HTTP_ERROR errors emitted by the http
plugin will include the original error, to aid in debugging future
issues.
Change-Id: I0531656dada25f97ef610d4285c225d57d7ef262
This updates jsdoc to the latest version from npm and forks a copy of
the default jsdoc template.
In subsequent commits, we will reapply our customizations to the
template and to a jsdoc plugin.
This also fixes several bad annotations that the new jsdoc failed to
parse.
Issue #1259
Change-Id: I00a47270ea4754e1c96c43ca900d5cf889ab72e6
This uses AbortableOperation in all networking, from the scheme
plugins all the way to the request interface.
This also updates all default scheme plugins, docs, and sample code.
Backward compatibility is provided for scheme plugins and the
request API in NetworkingEngine. This compatibility will be
removed in v2.5.
Two cancelation-related tests have been disabled in
player_integration until the new abort interface has been adopted
in the manifest parsers.
Issue #829
Change-Id: I91c8e6efe97798d111e8ddca5655cddc1f6bcbf3
This adds a general interface for abortable operations, and a specific
implementation of that interface for use internally. This should
simplify the transition to abortable network requests and others.
Issue #829
Change-Id: Icf54e23028f7454640f5ec76ca97d8a8ed5915ed
Create the pattern for how to handle database upgrades. As of this
change the only upgrade supported is from version 0 (no database).
Issue #1047
Change-Id: I9f889a9e39a190e926cf06f0720a5371bc3c59af
We misinterpretted the EXT-X-START tag before. Now, we ignore this
tag and parse segment times from the segments themselves. This is
more robust for both VOD and live HLS content.
We avoid segment parsing when updating normal, well-behaved live
streams. For poorly-behaved live streams, we will fall back to
segment parsing and recover.
This also addresses the issue of VOD content which does not start at
zero. Instead of using configuration to make this playable, we will
now offset VOD content back to 0 automatically.
Issue #740Closes#1011
Change-Id: Ib3a59f87e3a050244cd39854409d8e3542c50b0a
Added externs for error.js and removed the @expose declarations from the
actual error.js file. Updated the jscompiler flags and docs.
Change-Id: I2aa95ef1c82fc7bd349c637cca3141d5a003b646
Previously "UNPLAYABLE_PERIOD" exception is thrown when a browser
doesn't support the container or codecs in a piece of content, which is
confusing to developers and customers.
Changing it to "CONTENT_NOT_SUPPORTED_BY_BROWSER" exception.
Test manifest:
https://media-ci.foxford.ru/dist/hls-issue/issue.master.m3u8Closes#868.
Change-Id: Ied135b687190919abbeb1561c2bff36a7203136e
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