Previously, if no XML was produced, or if it failed to have a <tt> element,
we assumed that parsing had failed. This caught some failures, but not
every possible failure; there are some partial failures that still return
valid XML. These sorts of errors are signaled by the output containing a
<parsererror> tag; this CL makes us also return an error in this case.
It also corrects the documentation for XML parsing errors, which was
incorrect; it seems that we had been confusing INVALID_XML and
DASH_INVALID_XML for documentation.
Issue #2157
Change-Id: I79716c9d2ff90ed9672eef8e54dd4019d8ca109b
Something I noticed while working on issue #2157; their text tracks
contained percent values with decimals in them (for example "4.17%"),
which was something the percentage-parsing regex we were using did
not handle.
Change-Id: I90f4a223f0a335057a92ae606e7298eefaa0b4aa
Include event ID in findSimilarRegion_() check so that events with same
presentationTime and duration but different ID are treated as separate events.
Closes#2077
Safari 13 is out, and needs polyfills just like Safari 12 did
(although one fewer). This assumes that Safari 13+ all need the same
polyfills (to avoid surprise failures when Safari 14 comes out).
This also raises the minimum version from Safari 9 to Safari 11, since
usage stats for Safari 9 and 10 are vanishingly small. Dropping
support for Safari 9 and 10 allows us to delete a complicated polyfill
used for those versions.
Change-Id: I8f833d915215fc19a89e3aea292b67c5d677c779
According to RFC 3986, URL schemes should be case-insensitive. Our
scheme plugin map is registered with exclusively-lowercase scheme
names, so we should convert the input scheme to lowercase before
looking up the plugin.
Closes#2173
Change-Id: I78218c18d3df154aabd101a9ef5fd3156d0c57a8
We avoided bind() since we could use lambdas instead; but with the
console methods, we loose the link to where the log happened in the
DevTools. So by using bind(), we can see where the log came from.
Change-Id: I04ad1f360e459c3676eabb6d0651a7963d186b43
When we are in the "same" stall, we shouldn't handle the stall multiple
times. If we do, the video will step forward slowly over time, which
isn't desirable; especially on slower platforms where a seek would
restart the time it takes to start playing again.
Change-Id: I11a1811f9ecf754484d3530f4dc047cf95b007a4
For VOD, the first segment of every Media Playlist in every Variant
Stream must start at the same media timestamp. Thus, we can get the
start time once and store the value, and all the streams can use the
value directly. For live, we assume for the same.
This change reduces calling getStartTime_() from 15 times to once for
Angel One, and also fixes the text segment timestamp issue.
Also removed associated methods that no longer needed.
Closes#1558Closes#1563
Change-Id: I0e95ab93ea2b13758128f11019b262bc53dbcd38
Changes in the Closure Compiler have made it so that goog.define
without using and assigning the return value will no longer be
allowed. There is no need for goog.define, though. Instead, we can
just use the @define annotation and assign directly to a variable.
This eliminates the use of goog.define.
A similar change was already made almost two years ago for the Player
version in lib/player.js
(in Change-Id: Iad9040d0f5ee397c7d46b1d64bc5bebf2def57bc)
Replaces PR #2158
Change-Id: Ia7c7de0407f9790284c418fb6edde948b922ab62
Previously, the Closure compiler was causing a strange problem in
non-debug compiled builds in the HLS parser: when we make an alias for
shaka.net.NetworkingEngine.RequestType, if we access RequestType.SEGMENT
the value is undefined. However, if we store
shaka.net.NetworkingEngine.RequestType.SEGMENT in a variable, it works.
Looking at the compiled code, when shaka.net.NetworkingEngine.RequestType
is defined, SEGMENT seems to be treated as some special case, which might
explain this odd behavior.
Fixes#2156
Change-Id: I272dbc8b8db08ef8f9067c535c25890adae32440
We would incorrectly initialize the embedded captions multiple times
during a Period transition, which caused duplicate cues to be given to
the displayer. We also wouldn't handle the case when switching between
embedded captions and external text during a Period transition. This
fixes both cases and adds tests for them.
This also avoids passing an empty cue list to the displayer.
Fixes#2076
Change-Id: I89add3eb86ad8d93644bba14eabd11f98d57bc5e
Because src= content lacks codec information, ClearKey setup fails.
However, because there was no DrmInfo prior to the ClearKey settings
being applied, the variable hadDrmInfo was false, which led to a
suppression of the resulting DRM error.
Instead, we should count ClearKey settings toward hadDrmInfo. So now,
ClearKey settings are applied before we calculate hadDrmInfo.
Closes#2139
Change-Id: I14d5bfe63fd2ce1a461ae7ef8c2fee7f42bb1b3e
We are seeing spurious errors from the load graph tests. These errors
don't appear to be thrown from any of our code and I can't find what is
causing the uncaught rejection errors. But adding a delay seems to
remove the errors.
Fixes: 140725109
Change-Id: Ia08e7a4c12a17cf5610db64b146b863c8e5ecbeb
When using DOMParser parseFromString with an empty string, it returns an errored XML document. The next part of the code is then executed and throws an unnecessary error.
This adds a special case for an empty string.
In compiled mode, UI calls player methods by their compiled, renamed names.
The proxy object doesn't know those, so an error used to be thrown while
casting in compiled mode. This change adds a map from compiled to extern
names that cast proxy can use.
It also cleans up proxy code a bit and points the demo to the nightly
build of cast receiver.
Closes#2130.
Change-Id: I39b83c6a1e050a68d70e7923d1a07ad8929daeeb
Before we would only update the current Period when we got a key status
change; this caused us to fail playback for the second Period if the
streams were restricted. Now we update all the Periods.
Closes#2135
Change-Id: I2238a90c1d367a1d898ec26e4318852cd26da4b7
This standardizes how we handle the spacing in argument comments. The
other way is much more common, so we standardized on that. This add a
new linter rule to catch and automatically fix those issues.
Change-Id: I8ea54c47ae4d34cf8e1646e56c6ed8142b42afbe
For audio only content that the audio variant tag and media tag has the
same uri, we should compare all media tag uris with the variant tag uri,
instead of comparing only the first one.
Change-Id: Ifa985eae441076418fc289e5601020c06c135c24
This adds support for a DASH MIME type that predates standardization
on "application/dash+xml". Some servers still use the older, now
non-standard MIME type of "video/vnd.mpeg.dash.mpd". This is trivial
to support, and it helps some folks who needs it, so there's no good
reason not to support it.
Change-Id: I17e85fdb74491e9e32628eddf30ef9e88acf5221
These are intermittently used and cannot be verified. Most of our
methods can throw a shaka.util.Error, so having it doesn't really add
anything. Plus, if we change a function to throw, we'd need to update
all their callers to ensure they have an accurate description of what
they throw; otherwise we can't trust the directive.
Change-Id: I520bd0fc4c33443e967bf5b103ca5aa9e3274884
Apparently, the 100ms fudge factor we had was not sufficient for
some assets, which could cause those assets to get stuck buffering at
the very end of the video, when on native controls.
This just increases the fudge factor to a whole 1000ms (1 second).
Fixes#2117
Change-Id: Idf3c09f397ebb6abf7f681efaa042608eed60152
Since embedded text tracks are not "real" tracks, we need to ignore them
when handling Period transitions. This ensures that the other streams
will handle the transition instead of waiting for the text stream to get
updated.
Fixes#2075Fixes#2094
Change-Id: I2c7c92cb04795edb3f7695677ee6745bad3f4471
A new conformance rule was added after the PR was started and it is
violating it. This fixes the violation and adds another assertion.
Change-Id: Ie18760d9e1db1959d9587682ff6c9c8ca4fe6a8f
We can't parse webm segments to extract segment start
time yet. Getting webm streams in hls stops playback
even if there are other formats we can play. This change
skips webm segments for now.
Fixes#2108
Change-Id: I4ff167efea45967cdf95a91afbe75efef3d9aa32
Using "new Uint8Array" with a TypedArray creates a copy of the buffer;
this is unnecessarily expensive for large buffers. This adds a rule
to disallow using it in favor of a new utility that correctly creates
a new "view" on the same buffer.
Note it is fine to pass an ArrayBuffer to "new Uint8Array" and it won't
copy; but there there are many cases where the type is BufferSource,
so it could be a TypedArray. Unfortunately, there are many other cases
where we explicitly pass an ArrayBuffer; but the compiler rules don't
allow us to whitelist this case (since ArrayBuffer is part of
BufferSource).
Change-Id: I58696a85a9cbcc188c0b16919c9eeb63e56edca1
Now the EbmlParser and DataViewReader types can accept BufferSource
objects to avoid the caller having to convert it at each callsite.
Change-Id: I527fbc638485214bfe976d7da89b79b6098033a8