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 will make it easier to ensure conversions are done correctly,
which will be increasingly important as we change the database format
as part of #1339 (period flattening).
Change-Id: I1114b1a9a0d341589f7f1026ec23ad93af38a6b0
Since v2.5.0, we have been storing duplicate streams for multi-period
offline content. For example, instead of storing one stream per
period, a 3-period manifest would have 3 streams per period. The
segment data would also be duplicated, leading to 3x the storage used
for a 3-period manifest.
This fixes the error for future content and ensures that the correct
number of variants are still shown when this broken content is loaded.
This change also tweaks the frameRate field in the existing database
dumps, which for some reason contained the wrong value for the
existing v1-v3 dumps. This must have been a bug we fixed already. To
make the expected results consistent across dumps, the frameRate value
in the old dumps has been updated.
Closes#2389
Change-Id: Ibf7db7543f25ad23cecd12efad1eb039630e381c
This adds some links to where users can find error codes for some of
the browser errors that can happen.
Change-Id: I8ce94307159afb2df9e06813b07593920dcbac1e
If that method was called with an app id that was an empty
string, it would destroy the cast receiver, and then not make a
new one.
This lead to the ChromeCast callbacks all pointing to a destroyed
cast sender, which would then spew out errors whenever session
availability changed.
Normally, changing the app id to empty string doesn't make sense,
but it can happen if someone configures the UI thoughtlessly.
This changes the API callbacks provided to be static, and only
forward the calls to live senders.
Change-Id: I88593532791b3448be3ebdf7ef4df4d38c1bc6e4
Before this, we only had tests in place for loading and converting the
v1 format for offline storage. We had database dumps already for v2
and v3, but no tests exercising them. This adds some basic tests and
fixes a bug in the loading of expiration times for v2 and v3,
equivalent to what we already had for v1.
Note that here, v1, v2, and v3 do not refer to major versions of Shaka
Player. Instead, they refer to IndexedDB storage formats used in v2.x
versions of Shaka Player.
Change-Id: If32d1f1131b935eb191101463c4152317e711c5c
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
The recent DASH refactor broke the details of multi-period segment
references for SegmentTemplate+duration.
This change introduces a corrected universal model for generating
segment references for fixed-duration SegmentTemplate content. It has
been tested with a variety of streams from third-parties, most notably
the DASH-IF's live simulator.
Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)
Closes#2111
Bug: 28087927
Change-Id: Ife4e9ae2bb726e24e97dfe153882dabba4c03f2d
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
Different ads have been added to three assets.
Demo search CSS has been adjusted a bit for better
experience.
Feature name has been changed from "AD" to "ADS" to
reflect the fact that a single asset can have more
than one ad.
Issue #2222:
Change-Id: I12a63b813fb4bac79362f1689b485a824f5a9682
This solution involves polyfilling the disablePictureInPicture
attribute on the video element. If the polyfill is installed, it will
show document.pictureInPictureEnabled==true, but
video.disablePictureInPicture will be a getter that does a runtime
check on that specific element using webkitSupportsPresentationMode.
disablePictureInPicture (JS property & HTML attribute) is part of the
PiP spec, so this should be sufficient to disable PiP correctly on iOS
in your application, whether or not you are using our UI.
Closes#2199
Change-Id: Iac9fc7e6cf6d4b0f7576f55af7507348ab2dc02c
Also:
- Hide the close button next to a "browser not supported" error
- Update the support matrix in the README
Closes#1920
Change-Id: Ic3db57a53d800eda3c280b45436eda4f1dae6baa
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
Before, we checked either the audio role or the video role matches the selected role,
but we should check only the audio role when selecting audio language.
Closes#2346
Change-Id: I040f41129dc902cce79c66ba36cb10917fcc8453
The appendCues method in TextEngine was completely unused. Another
method was exported that should not have been.
Change-Id: Icee35d8ccbc5a903cb13409211a8c5770f1c6a87
Before this change, even if an asset was unloaded,
currently playing ads would continue until the end
of the playthrough. If a new asset was loaded,
the presentation wouldn't start until the end
of the ads.
Now stopping the ads is part of the unload proccess.
Issue #2222
Change-Id: I996cde95a826877971812339cad6c328e15fc97e
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
For backward compatibility, the new pixelAspectRatio field in Stream
should be string|undefined rather than being nullable. This ensures
that manifest parser plugins that do not output that field will still
compile against the externs.
PR #2294
Change-Id: I1aae03994a213c8ce52dc64e8a34bf179045f4fb
This makes the HLS parser recognize raw AAC, but refuse to play it.
It will not play correctly until we have full support for
containerless formats at the MediaSource level.
Closes#1083 (raw AAC, can't do anything more for this right now)
Issue #2337 (full support for containerless formats in general)
Change-Id: I50c7f06a1aa08d515f4d9f74603954a6d015dc29
In an in-progress DASH stream (in which the content is static, but not
fully available yet), we will need to produce additional segment
references as time progresses. This was broken recently during
refactors for period flattening, when SegmentTemplate with a fixed
duration was changed to use a SegmentIndex instead of generating
references on-demand.
Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)
Change-Id: I0239335fa7c569063f06f4416982fc5ca7d5873d
By having an explicit enum, we can make sure there are no typos in
FakeEvent creation calls. This change also allows the cast proxy and
receiver to proxy events based entirely on the enum; that way, they
do not need to maintain their own independent list of events, that
can potentially fall out of sync (see #2318).
Change-Id: I08fa6653f35d86e87efda7fc822c8988688cfcff