Based on PR #839
We use |resumeAt| to handle switching between Periods that do and do not
have text streams. It is used to override what time we need to start
buffering from. Once we have used it (i.e. started streaming), we
should reset it (to ensure it doesn't break seeking).
There was a bug where if the stream wasn't available yet, it we
would reset |resumeAt| but not start streaming. Meaning on the next
update, we would check at the playhead time instead of the next Period
time. Now we reset |resumeAt| only after we know we have started
streaming.
Closes#839
Change-Id: Ibd3ce680cec129719869c8d4a7dda409b573a17f
In situations where there are variants with video and audio, and variants
with only one of the two, this filters out the less-complete variants.
This removes the possibility of the player switching to an audio-only
variant and breaking MediaSource. It also solves the regression where
audio-only variants have the lowest bandwidth and thus are chosen
preferentially on weak connections.
Closes#824Closes#861
Change-Id: Ic37543d98962ddd83a85224e26e5225d142b844e
Microsoft HLS packaging tools generate audio-only variants in an odd way;
specifically, the variants have an AUDIO tag despite being audio-only, and
thus double-link to the stream.
Previously, the way we detected stream type lead to us assigning one version
of the audio stream to audio and one to video, thus erroneously making those
variants appear to be video+audio variants.
This makes it so that, if the AUDIO tag has the same content URI as the base
stream, it only uses the version in the AUDIO tag.
Change-Id: Ie940970587e95a9020ed67589042008d0568e153
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: Iecdf071c7f99b9d5460e75dfc4f77df871740ad2
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
We should not reinit text until we are sure we are switching.
Otherwise, the new text parser won't have seen the init segment and
won't be properly initialized.
Closes#910
Change-Id: Ieb5549afcad7aa58aa1a6e8d383f3cd783280d5c
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: I48335fc6659d3c33a6d55b00d087b59410c79cf7
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: Iefde089b2f62ddfdf43944cda5badab438577561
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
This changes the order of the things tested in the offline tests,
cleans them up a little, adds comments, and extends the playback
time by 5 additional seconds to deflake the tests.
Closes#903
Change-Id: I9c0656882cf31e3f61c67946b7867d3ef25ba953
Adding the count of channels, as a new field for tracks and streams.
Used for HLS audio tracks.
Resolves#826.
Change-Id: I1448b4a8cfaf6dd798670bb2f0f3981d6c7e40c3
The new isPersistentLicense option was not documented in #878.
This adds docs and renames it to usePersistentLicense.
Closes#873
Change-Id: I59ed32c98660ad7c155392a1708eab98f63131c3
Based on app configuration, we could store protected content offline
without a persistent license. The offline content would then require
a network connection, but only briefly for licensing. This makes
sense in a lot of commuter or airplane WiFi scenarios.
Closes#873
Our EME polyfills give a key status with a Key ID of '00' (a single 0
byte). This breaks the Player logic for restricted tracks since it
assumes that those are not playable. When we get this Key ID, we should
treat the key status as a global status, not for that specific Key ID.
Closes#884Closes#890
Change-Id: I392550227274fb321d2c223eb8d483a0a4733186
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
Instead of hanging while we wait for key status events that will never
come, move on after 5 seconds.
Issue #891
Change-Id: Ia338401097fb29039fa203729d0efaa4cca5623b
Trying to switch to a stream from a previous Period while we are
buffering a later Period can cause problems. This is caused by
different media states "needing" different Periods.
So if we try to switch to a stream from a different Period, we should
handle the Period transition then to ensure all the streams are needing
the correct Periods.
Closes#797
Change-Id: I3d93d93bf141901fe8f8f62fd0ca9fa96a07c268
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
This fixes the detection of content type for text AdaptationSets which
contain mimeType only, but contain a Representation with codecs only.
Closes#875
Change-Id: Ibae7ae8357653c1960daefa4c3e122187de51bb3
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
There was a bug where manually added text tracks weren't added to the
active track list in Player. This caused assertion failures and
problems with selecting those tracks. Now those tracks will be tracked
correctly. Note that Player will correctly select text tracks based on
language and will allow switching.
Closes#821
Change-Id: Ie9465a2d3bc757f43281ef40658daa488f58bc12
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
Somehow, errors thrown by CastReceiver unit test setup caused DRM
tests on IE and Edge to fail. This cleans up the Cast tests to fix
these uncaught errors that somehow polluted the DRM tests.
Change-Id: I435ff994b0b70199eb5a8febd419296b59497920
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
Do not infinitely retry on top of the retry-policy already defined by
RetryParameters, especially for VOD. For live video the previous retry
logic is still useful to be robust against clock-sync or asset
availability issues. This commit adds a boolean configuration parameter,
infiniteRetriesForLiveStreams, to allow the user to turn this behavior
off even for live video.
Fixes#830 and #762
- Make FakeStreamingEngine injectable by removing Period argument
- FakeStreamingEngine can now have its spies manipulated before we
call player.load().
- Do not poke into player's manifest_ and streamingEngine_ members in
chooseStreams(), since load() sets those already.
- Instead of setting activeStreams in the constructor, set them in
init(). This is a more accurate fake, and this is important for
upcoming tests related to early filtering, since filtering takes
into account the active streams.
Leads into a fix for #841
Change-Id: Ia893053490cde819e32907c7a1a2030c29022f62
- Fix isTypeSupported override in MSE unit tests
(Should not be a prototype method)
- Add isTypeSupported override in Player unit tests
- Fix a Player test that used to pass for the wrong reasons
(MSE type filtering instead of EME type filtering)
Change-Id: Ibb72957f3bdff62923f2b235e9b9e9a598353912
- 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 makes ABR targets configurable and refactors player
to accept Abr Manager factory rather than have manager be
part of ABR config.
Closes#744
Change-Id: I732daaf555d21cc9e79450eeb1f74ac3544b90cc
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
At the moment, when there is an xlink problem, the manifest parser
returns a rejected promise. This adds a configuration variable to
instead simply not replace the xml tag.
Closes#788
Change-Id: Iace953233c83a57820130033150e7cd9a9385d6f
- Default CODECS attribute to 'avc1.42E01E,mp4a.40.2'
- Infer stream type and multiplexed status from number of codecs,
associated groups, and video-specific attributes.
- Recombine codec strings when we detect multiplexed content
Closes#805
Change-Id: Ib1298033360b52091b7d871fed0eca047a00ad22
The PlayReady server at Axinom is failing with HTTP 500, so for now,
we will disable these tests on PlayReady.
Change-Id: Ife0365669376af0fd437798a501b79a9bc0b3eab
After looking into the speeds for removing data from IndexedDB, it was
found that using a cursor was slower than the other methods. This change
takes the remove logic and changes it to remove each key as part of
one transaction.
Closes#756
Change-Id: Iec3916650d8a4fe2b6353b604c070d8a0af7426c
Before, if a relative xlink contained another relative xlink,
the nested xlink link would resolve its URI based on the filename
of the parent link, rather than its final URI.
Change-Id: Ic42ad8bfbd8487b4d1da66d86117823800c447be
Element.children does not work on IE or Edge, so all uses of it
were refactored to use .childNodes instead.
In addition, Element.children was added to the ban list, to prevent
further problems like this in the future.
Closes#792
Change-Id: I33009f77dbb1f4afa9847e31b57fda324baba472
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
If the media segments don't reach to the end of the presentation (as
given in the manifest), then we may get stuck buffering forever. Now
StreamingEngine will update the duration so PlayheadObserver won't
enter a buffering state.
b/37722271
Change-Id: Idf95fcccc04a024307601f0741b5da4474f76d03