This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: Ic37437a1ad2305bc50a814cdcc562e74703222ac
The old definition using a union with a Function causes problems. The
compiler tends to treat this as an unknown type, so we loose type
safety. The new types ensure full type safety, at the cost of needing
to "convert" the spy when it is used as a function.
Change-Id: I98ebd9dffd9cb865d0cf5d03db0fb5d6ea001ed3
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 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
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
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
Both DASH and HLS parsers will be using resolveUris() and possibly
other methods in the future.
Create a ManifestParserUtil for the shared methods.
Issue #279.
Change-Id: Iaa5e32ec543a390341a54752563a9f27251f0832
Add UI options to select current audio and text language.
Split selectTrack() into selectText() and selectVariant().
Stop automatically disabling ABR manager when a variant is selected.
Add a warning if selectVariant() is called while abr is enabled.
Issue #412.
Issue #626.
Change-Id: I15f1c3c4fdc6d6b641f708fbef19dbcf10cbcfc6
During recent refactoring, we introduced a bug in which we would
filter out any text stream with a non-empty codecs parameter.
Replaces PR #639
Change-Id: I9a45ef7e1bc250fd989e3972c0670f3e48336511
In many places we tried to guess the encoding of a piece of text.
This guess fails for Chinese UTF-8 text, and probably text in many
other languages.
However, DASH manifests, TTML files, WebVTT files, and VTTC box
payloads are all specified to be in UTF-8. Rather than guess and
possibly fail, treat all text in these contexts as UTF-8.
Change-Id: I00c652a9f1dd20855e94abfac84275e41dd9e266
When a piece of content has several StreamSets with the same
language and role, pick an audio set with lower average bandwidth,
pick a video set with the highest top resolution. Pick the first one
when the above is not applicable.
Closes#476
Change-Id: Id2cb9095994e8aa6b205024504a5d665f8656437
Based on several rounds of experiments, the timing on these tests was
determined to be too strict. Extending delays and timeouts on these
tests reduces flakiness across browsers and platforms.
Change-Id: Ie36c86f3afcb615991454d098e690199ca063f96
* Decrease Promise delay to reduce timeouts on Safari.
* Stop timedout tests from running their fake
event loops after the tests have actually ended.
Change-Id: I5104396e916cfbca8b2e796f9bc8f2dcb8149042
Instead of filling the URI templates when parsing the manifest,
wait until the request is made to fill it. This reduces the time
it takes to parse the manifest.
This was tested using a stream with a 24-hour timeShiftBufferDepth.
Using a Chromebook pixel running Chrome 51. The average manifest
parse time was about 1 second before, now it is about 200ms.
Issue #405
Change-Id: I89f36085441f6c6b7d6281b24b671dc668f23fe5
Before, we did not use suggestedPresentationDelay in the seek range.
This meant that seeking to the live edge would usually lead to a
buffering state because the seek range is the same as the availability
window. Now the seek range is handled differently from the
availability window.
b/28938315
Change-Id: Iacfffe30778f7c63734fe24eeb95634611da86be
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
player.load() now uses our new CancelableChain abstraction for its
chain of events. player.unload() and player.destroy() will both
cancel that chain. player.unload() will wait on the cancelation to
complete before resetting the streaming system, to avoid a race.
Change-Id: I37fcbacde33f253982c3dd5ed246855d4e363c79
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
If a key is output-restricted it may still be usable.
So, instead of disabling these tracks, indicate that they
may be playable.
Issue #199
Change-Id: Ic13a02d97ccc21533118f17aa907c16d1cda05ce
Applications which cannot control their manifests may need to specify
a default clock sync URI for use when UTCTiming elements are missing.
Closes#290
Change-Id: I5704b25d2d3199ceb932f8102490a9b3e8a27dac
Some browsers, such as Edge 13, do not report capabilities at all.
Not all encrypted streams have known key IDs, so we should not
use that as a predicate for the encrypted content type filter.
Since not all content has both audio and video, the requested and
reported capabilities may not have both either. So we should
default capabilities to empty lists if missing.
This also adds an encrypted audio-only asset so that audio-only is
covered by our integration tests.
Closes#342Closes#360
Change-Id: If5973c4ddea358d96ab305700e027021b1a7b65a
Sometimes a key system will not support the same content types that
MSE will. We need to use the capabilities returned from EME to
detect what content types are supported.
Closes#342
Change-Id: I356f8ab33fca3a7b036e81f83051de2c3b2d2864
* Permit non-zero presentation start times for VOD: some
presentations have segments which start too far from 0 to
allow the video element to begin playback; now the player will
start VOD presentations from the start of the first segment.
However, segments of the 2nd, 3rd, 4th, etc., Period of a
multi-Period presentation must still start close to 0 (the
player will not jump any gaps in the presentation).
* Prohibit seeking to regions at the beginning of the segment
availability window if segment information is missing from
that region: sometimes live manifests do not contain all the
segments in the segment availability window; now the player
will prohibit seeking to these regions.
* Update definition of live in DashParser to match Player and
Playhead.
* Simplify PresentationTimeline's constructor by just using setter
functions.
Issue #341Closes#348
Issue #357
Change-Id: I96c22774448476bea89ff4014f03b87bdb51ba07
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
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
Now, the default bandwidth estimate used is configurable and can be
set using Player.configure.
This also moves enableAdaptation and abrManager configuration values
to a subcategory 'abr'.
Closes#268
Change-Id: I11ab30452b20dc4fd9385210811185fe2969821e
This adds a tolerance for certain buffered range checks. The browser
will jump small gaps, so we should not let small gaps interfere with
our buffering algorithm.
This also clamps lookup times to zero to avoid errors thrown on
positive drift.
Fixes#320
Change-Id: I2de9ef4850a96cac29bbcacaeb75285a358c230f
Add simple mocks for types Player uses like StreamingEngine. Also
adds methods on Player to allow it to be tested without loading
dependencies.
Change-Id: I99d920ce02b2bc685e0217b8861ca7e9bef89603
Add a helper type to generate valid manifests. This can be used
to selectively set parts of a manifest without requiring a lot
of extra code to define the default field values.
Change-Id: I6cb8f44c5700a5ff3cb56a21bf3fdd4fb25291f1
Add a helper type to generate valid manifests. This can be used
to selectively set parts of a manifest without requiring a lot
of extra code to define the default field values.
Change-Id: Ia087e391249cdbea72e2c1c4a317759d5264b1a7
* Refactor common parts of unit tests and integration tests.
* Allow StreamGenerator to offset segments to support multi-Period
content.
* Add some additional logging for debugging.
Change-Id: I196c5e5eebd55cf1d6c5706ba9906c905bd21c2e