The HTML5 'input' event does not work correctly on all input elements
in IE 11. There are equivalent events that the UI can use on IE.
Instead of remembering this and checking for IE every time the 'input'
event is needed, let the polyfill translate the event type.
Change-Id: I23258a5c6a0bd37e946214380ad07949f3ee7f88
Adding the count of channels, as a new field for tracks and streams.
Used for HLS audio tracks.
Resolves#826.
Change-Id: I1448b4a8cfaf6dd798670bb2f0f3981d6c7e40c3
In DASH, when parsing a date, it should default to UTC. When we pass
the date string to Date.parse(), it will use the local timezone. So
if we don't see a timezone, we need to manually add the UTC timezone
so Date.parse() will parse the correct timezone.
Closes#901
Change-Id: Ica0433042e9bfd42b0cbf62653bdbd2b97b56297
Exposing the roles of tracks, which come from the manifest, in the
select audio language method. This is a follow up on commit
b27861050c11451db57d87270ec1385c1906627a.
Closes#767.
Change-Id: Iebb873f1db8834c7275a8a9fc01c3b855c0288aa
If you attempt to load an asset and then the first load fails, then
the second load will hang forever. This was caused by the second load
trying to cancel the first, but the CancelableChain not handling this
case.
Closes#782
Change-Id: I79e201db44cbf47485e7221cc148bbfdde6276f7
This change creates a lib/text directory and moves all files
with text-related logic to it. It also lays the ground for
separating text parsing and display logic. (That change will
introduce even more files with text-related logic which will
crowd lib/media directory).
Issue #796.
Change-Id: I65ac134020a0126ff02a8f2067beb73870232e65
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
Before asking AbrManager to choose streams, we should choose codecs.
Choose the most efficient codecs, and do it after we have filtered
out the codecs that the platform cannot use.
Closes#841
Change-Id: Ifbdd22b33254d4584f77db6456ab238f7c04c755
- cleans up config merging now that abr.manager has been removed
from the config
- uses thing.constructor == Object instead of
typeof(thing) == 'object', for better detection of anonymous
objects
- adds a default (empty) server certificate for type-checking
- treats empty certs the same as null (no cert provided)
Fixes#784
Change-Id: Ie833a1b3bf484d5f12f3ebf6d513ed51740bdc44
We broke PlayReady on IE and Edge in #815 when we fixed PlayReady for
Tizen. This should work for both, but will still need to be tested on
Tizen after merging.
Closes#837
Change-Id: Iff41845ae6a4b369e8f21a80623ebb2cb5475fd6
This change is to expose an audio track's role in order to differentiate
among a main / caption / commentary track that shares the same
language.
Issue #767.
Change-Id: I05d38cba2170d0005611cf160b7ae45996fe77dd
See also commit 7a770783.
This fixes exports and externs that were broken in v2.1.0 and v2.1.1.
Generated externs are now verified and working with an external
Closure project.
Change-Id: I73a6b92474c87fd6119592c6d632ce91045fc073
DataViewReader is referenced in the exported class Mp4Parser, so it
must be exported as well. This fixes broken exports and externs in
v2.1.0 and v2.1.1.
Change-Id: If94e623d36694dd528495f654bbb8f27d0b113ba
Treating serverCertificate as an Object and recursing causes an
exception the second time you set the serverCertificate config.
As a quick fix that can be cherry-picked for v2.1.x, do not recurse
on serverCertificate. This has the side-effect of not type-checking
the serverCertificate field on input.
A more detailed fix will be made later, for inclusion in v2.2.
Issue #784
Change-Id: I84c05ee3dd370a4b83e9ce2337d2326ec36532c2
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
The audio and video codecs were combined in Track, so it's hard to
detect whether the track variant has video or audio track.
Changing the combined codec to two separate fields.
Closes#758.
Change-Id: I9fbd0b85830cac306dc09db2d71cf96f77146cbe
First, by listening for the first 'timeupdate' event, we may run our
checks before the Player sees that we are playing. Now we wait until
1 second in. Second, there was some test contamination because of how
the timeouts were implemented. If the tests took too long, then the
timeout for the first test would remove the listeners for the second
test, resulting in a test timeout.
b/36485220
Change-Id: Ia517cd5162cc4d8bf0aaf1b708c004c0b1145e0e
The bulk of the logic for gap jumping is handled in Playhead. It
tracks the current buffered ranges and jumps over any gaps that appear.
It listens for a special browser event ('waiting') for when the video
element runs out of playable frames.
This change also removes the logic for jumping gaps at the beginning
of the timeline. This is handled by the more general gap jumping
logic and works cross-browser.
Finally, this updates the buffering logic to only count the amount of
content buffered (i.e. ignoring the gaps). This fixes some bugs where
gaps in the content can result in StreamingEngine buffering forever
since it thinks only a little is buffered.
This includes full implementation of the logic, but this doesn't close
the issue since there aren't any integration tests yet. Those will
be added next.
Issue #555
Change-Id: Id99eb9fe469e8cf2c7464a3d70c3733791e806e0
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 adds the new configuration options that will be used in gap
jumping. This also changes Playhead to accept the config over the
rebuffing goal directly.
Issue #555
Change-Id: I467690ad1f417e69634087e04e0b44c98e1c9b81
This abstracts the creation of DrmInfo to parse the EXT-X-KEY tag
differently per KEYFORMAT.
Issue #279
Change-Id: I2e187dcfc01f7306183c9090c54de58e81872bc4
This change enables HLS parser to get DRM information
from the manifest and create DrmInfo objects.
Note that until we actually add support for any of the
drm systems, we will still reject encrypted content.
Issue #279.
Change-Id: I4d0652411a567bc75d919c5bf732f20e870a5aeb
When defining a box, the box would be defined as a four
byte integer. Now there is a "fromString" function that
can be used to convert a four character assci string to
a four byte integer.
Change-Id: I78c704e012620c94ae681efb450977305bdb84aa
Before the segment start time and end time were used to determine
the start and end time for all subtitles that appeared in the MDAT
box. The time values for each subtitle is specified in the TRUN box.
Now the time values are extracted from the TRUN box and mapped to
the correct subtitle in the MDAT box.
Closes: #699
Change-Id: I7179874aee7b617e994b136d17a082060ab1a0d2
Before parsing Mp4Boxes was done using the "findBox" method. This
was limted to only looking at one level of the structure and
required a large amount of code to dig deeper into the structure.
This change creates a generalized Mp4 Box parser that should
simplify parsing Mp4Boxes. This will help work on #699.
Change-Id: Ie67ff30a6db890cae16fe02ae9c92bca711815a9
By default, we will now store all text tracks, regardless preferences.
This not only helps with our demo, but makes sense for applications
that have not bothered to configure the track callback for offline
storage.
This also fixes bugs in the default track selection algorithm,
changes the default audio track selection to fall back on primary
variants in cases where the audio language preference cannot be met,
and adds tests for the default selection algorithm to verify correct
behavior.
Change-Id: Iead0499039e9ec596514aa7577265a7472914621
Before, we would select every variant when there was no preference
or primary tracks. This meant that AbrManager could adapt between
different languages. Instead, we should select an arbitrary language
initially so we only adapt within one language.
b/36094412
Change-Id: I4670a8bf02683fb78cfe572992c6268ed32e649d
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
Rather than having it in the DashParser as a network response filter,
we should have it in StreamingEngine. This will give it access to the
segment times so we can calculate the presentation times for the event.
Otherwise, there is no way to know when the event should actually occur
since the app can't know which segment is being downloaded or which it
came from.
This also adds startTime and endTime fields to the event so the app
doesn't have to calculate them. For reverse compatibility, the old
fields will still exist.
Closes#698
Change-Id: Icbaf3619aedfca7ea06bc8b1fe49e9cce65b0cc2
An init segment is not required for all streams, some streams are
self-initializing (e.g. MPEG2-TS).
Issue #279
Change-Id: I99556ee26f6568cc5e712b50d0bb4de78cb2bd9d
We only use 2016 in the copyright headers for our files. If we use
different years for different files, then the compiled library will
include copies of all of them, bloating the library.
Change-Id: Ia894601cbd660f9e7cbe84264b421ff60e847dcd
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