This PR ads initial logic to enable support for IMA DAI streams.
Ad-containing streams can now be requested from the IMA stream manager and played.
Integration with the ad UI will follow in a separate CL.
This fixes the argument count on the compiled versions of our default
callbacks. This makes sure we don't issue incorrect warnings about
the application's configured callbacks.
This was discovered in the compiled build of our own demo by observing
the warning logs about the wrong number of arguments in some of our
callbacks.
Change-Id: I401d54bdc706aee9a70fbf5db83fc5e7de5cb183
We fetch the previous segment in Live streams to combat differences
between the manfiest times and the segment times. Now this can be
configured so apps with correct manifests can avoid the extra segment
request.
Also, we'll update the buffering state when a segment appends so we
leave the buffering state sooner.
Issue #2291
Change-Id: Id12c8132dc11739e4c8d42cb1f08e6ae7da1a966
PR #2387 introduced a bug. It awaited the track selection callback,
but that was done in a loop, the results of which were not awaited.
This would cause storage to continue before the complete list of
tracks was available.
Closes#2383
Change-Id: I18a429cf0f40b829020c520c622ffdae8b12622e
This makes the config-rejection logs always-on in compiled mode, to
help application developers notice problems during upgrade.
Found while fixing #2383
Change-Id: I131a1bf8197da394a743e9a121348178d38e5948
The config merging code was rejecting async functions, because the
.constructor field of a function is the "Function" constructor, but
the .constructor field of an async function is the "AsyncFunction"
constructor (not exposed as a global). This led to the async function
being rejected because it was misdetected as a different type of
"object" than the default value.
The fix is to exclude functions from this constructor-based
type-checking.
Note that the compiler will turn async default values into synchronous
functions in the compiled build, so an async default will appear as a
synchronous function in the compiled build and an async function in
the uncompiled demo.
A synchronous function from the app will always be okay, even if the
library expects async, because "await" will still work. But if the
library expects a synchronous function, the app should not supply an
async function, because that will return a Promise instead of the
expected type.
This adds a test to show that it is okay to pass a synchronous
function to an async config field, which is important for backward
compatibility as we make trackSelectionCallback async (#2383).
However, because the compiler causes us to lose the native async-ness
of our default values, we can't reject async for sync fields or write
a test for that scenario.
Found while fixing #2383
Change-Id: I62891441ce75bfc887ea13c24212a2ee78f90af4
This adds some links to where users can find error codes for some of
the browser errors that can happen.
Change-Id: I8ce94307159afb2df9e06813b07593920dcbac1e
It is common when debugging protected content to want to see the
license request/response data. This adds a configuration to easily log
the license request/response data so we can see this without modifying
the code or adding breakpoints.
Change-Id: Ib5db3eaa1447ae8714da935ee459fc7f9ba1e937
For Video Futur platform, like for Tizen, key IDs should not be
transformed to big-endian UUIDs, it causes `4012
RESTRICTIONS_CANNOT_BE_MET` error.
Issue #2189
Because we have some polyfills and blacklists that are specific to
Safari and iOS, we need to detect specific versions of Safari and iOS.
The existing detection of Safari/iOS versions was in multiple places,
and did not account for non-Safari browsers on iOS. This refactor
allows us to correctly detect iOS Chrome, and fixes a fatal exception
thrown in the MediaSource polyfill for all non-Safari browsers on iOS.
Change-Id: Ic88dc1a4c82087054cd4791dbf295b7ea2aeab09
Using the spread operator in StringUtils causes issues on Xbox One.
It has something to do with the compiler's polyfill for it. But
there's no reason we have to use the spread operator instead of
Function.apply in this instance.
Closes#2186
Change-Id: If8b3ff436f852ccae1f1a8c3ee5b7d8c142e15cf
Raw, containerless streams can't be played yet (#2337), but our logic
for skipping or rejecting them was broken. This broken logic affected
the whole v2.5.x series of releases up to and including v2.5.8.
This fixes the logic and improves it in several ways:
- Skip streams that can't be played, instead of rejecting the whole
master playlist
- Handle raw AC3 and EC3, in addition to MP3 and AAC
- Handle and skip WebM+HLS in the same way
- Add the playlist and segment URLs to
HLS_COULD_NOT_PARSE_SEGMENT_START_TIME errors
This allows us to re-enable the Apple HLS+TS asset as video-only.
Change-Id: Ia00857d87b085aa7e2b810b0b949993cebabe4ba
This reverts commit 6667ea5edf and
reimplements it using a fallback to an arbitrary media element when
there isn't one yet.
This also adds a regression test that would have caught the issue
sooner.
Closes#2326
Change-Id: I44573ae551db51f788d7c97b9680dfd45adee0a0
This changes the eslint rule to enforce a strict pattern for the
argument comments. The comment must appear before the argument and
must be /* foo= */. This still ignores line comments.
Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
This method should probably never have been in the library, since it
creates a fixed-sized, muted element.
Change-Id: I53b474305465bef34d43ce40ec5e7dedceb20a25
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.
This also updates the company name from "Google, Inc" to "Google LLC".
Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
The PR to add support for pulling EME init data from the segments was
incorrect and had some bugs. This stops re-initializing DrmEngine since
this isn't needed and could cause problems with the offline licenses.
This also just uses the Pssh helper once to parse and extract the
init data. Lastly this throws the old error if we don't have any
sessions when we are done; if we try to store WebM content, we should
still throw if there is no init data in the manifest.
Issue #1531
Change-Id: Ie524abda993a076397e233008709f11a2e68a8f8
Now shaka.util.Pssh will only create a view on the buffer instead of
re-creating the PSSH boxes for each element. This also removes the
boundaries field since the data fields are the useful ones.
This also fixes a possible bug in BufferUtils, updates comments, and
adds some more tests for negative offsets.
Change-Id: Ibe1b7d61d5f5c7e52dfd7aa954db98f0592da4a5
The "reader" reads the payload of the box, so we need to add the header
size to the start index to get a correct value for the "start" field.
The "start" field isn't used anywhere, so this wasn't caught.
Change-Id: Ia870d01620524ac6e87dea2b7f1bc8571425a976
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
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
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