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
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