Now the EbmlParser and DataViewReader types can accept BufferSource
objects to avoid the caller having to convert it at each callsite.
Change-Id: I527fbc638485214bfe976d7da89b79b6098033a8
The calls to controls.configure() deleted the old layout
in terms of the html elements, but the ui.Elements
owning the html still survived.
This CL fixes that. It also switches ui.Element from
IDestroyable to IReleasable to make the release synchronous.
Fixes#2089.
Change-Id: Ic4ce70e91a1b028ef4d971ac3fb9281d8a667ea8
This changes the network API to use BufferSource instead of ArrayBuffer,
which allows plugins to return a "view" on a buffer instead of the
whole buffer. This also adds some utilities for changing between
views and buffers.
Lastly this forbids the use of the "buffer" property of TypedArrays
since it doesn't work with partial "views". This audits and fixes the
usages of the "buffer" property to ensure correct usage.
It should be noted that both MSE and EME accept a BufferSource as input,
so we don't need to convert a "view" into an ArrayBuffer before passing
to it.
Change-Id: Iaa417773f8ce5304424e43c7372ce10ebf540d2a
This greatly speeds up startup time when running tests on a modern
browser. This change also fixes a bug in one of the tests that only
worked with Babel running.
Change-Id: I1493ef30388c5043dcdf8350bec7817ab5d28d55
This extracts common code in our overflow menu settings
menus.
Text, Audio Language and Resolution selections now inherit
from this class. It also makes it easier to create new
overflow menu items.
Closes#2091
Change-Id: Ib68e1fb295ed3ec61cb7a072c039a5c7c4e22183
This tests wasn't working properly before since the 'onBuffering'
callback wasn't given to StreamingEngine. This test was broken on
Edge, but at some point got fixed (or Edge fixed it's behavior).
Fixes#1743
Change-Id: I0af48207f5e8ad1c2e5007967a093f243e1837c9
This allows only running a specific check to aid in debugging and
fixing problems. This also refactors the code to avoid having to
have a list of all the checks.
Change-Id: I6381ab563f648124c6b900d7b4a24686baebc4cc
Note that the captions on some of these assets do not display properly
at the moment, due to bugs on our part.
Issue #2035
Change-Id: I5cc8893b824af6ac27f8895565ed1dfbb970b039
Resolutions menu calls player.selectVariantTrack() when
a user selects a resolution. SelectVariant track has a
clearBuffer argument that we used to always set to true.
However, an app may want it to be false. This change
makes this behavior configurable.
Closes#1733.
Change-Id: I6a0dbcca99a8322d68abd0151afd66af31530856
Chrome has fixed their behavior involving endOfStream(), but both Tizen
and IE11 have the same broken behavior. Unfortunately these platforms
will likely never be fixed, so we need to keep this forever.
Fixes#1357
Change-Id: Id540170f8c8cb6e0ddf3a30bde5035016fa61df1
This plugin can be used to write custom eslint rules. This adds a
single rule to check we name private members correctly. This plugin
does not get added to NPM, it is only used locally.
Fixes#1553
Change-Id: Ifdf9208d2bd0d09e1adb9c281b0be34266a867c9
During startup, there was a race between the video element's ready
state and seeking to the requested start position. If the video
became ready before the seek to the start position, there could
briefly be 0 tracks. Reproducing this required a first period start
> 0 and a start position > 0, such that a lookup of the "current"
period during this brief window would return null.
The problem was more likely to be seen on Chromecast, where the time
between load() and the completion of a seek was much larger than on
desktops.
The bug was caused by Playhead, which both seeks to the start position
and manages the concept of "current time", returning the start
position during startup and the video element's position thereafter.
This fixes the race, making sure that startup is not considered
complete by Playhead until the initial seek is over. This adds an
appropriate regression test and simulated content that can reproduce
the conditions in the original bug report.
Fixes b/138941217
Fixes#2045
Change-Id: Ie8a57283468d88697619349a29e37a804586e5ef
According to the style guide, protected members should not end with
an underscore. This renames them to fix it. This also marks some
members as private that aren't used outside the class. Lastly, this
fixes a possible bug with the use of "this".
Issue #1553
Change-Id: I6c7ecdcd228ec4e4aded4af52e2262d0bf5beaf4
In noinput mode, we avoided loading the tabs, since they were unnecessary.
However, it turns out that we did need to load them if we wanted to load
custom assets, since they can only be loaded properly if the custom tab
exists.
This changes the demo to load the tabs, and just hide their contents.
Closes#2098
Change-Id: I2c4702fbaae3c88b44d86c7ac9e383728af42867
When setting "position: absolute", you should set the "left" and "top"
properties to ensure it is aligned with its parent correctly. IE11
apparently defaulted to aligning next to the video element. This
ensures the spinner is aligned with the play button.
Fixes#2084
Change-Id: I91041813e36dbfd18a00c22af3f3f5d7e7542f40
This adds a separate configuration value for this because (a) the HLS
parser can't access the streaming configuration and (b) this behavior
is different in that the streams are removed instead of just not playing
them.
Closes#2065
Change-Id: Ic9b1e0d40b161cd4ba0eb6d7c922882112034626
Because configure() is called multiple times, we used to add some of
the event handlers multiple times. For fullscreen, this caused us to
try to toggle fullscreen multiple times. This changes to only add the
main event listeners one time and the DOM-specific ones have been moved
to be added in the configure() call.
This also moves the fullscreen toggle to the try so we can propagate
any errors from it. Lastly, this adds an "error" listener to the
tests to fail the test.
Closes#2054
Issue #2089
Change-Id: Ic78417ce52cae1c53133b5a4217004bb91ebcc4f
- Use <code> blocks.
- Use <p> to separate blocks (since newlines in comments are ignored).
- Use <ul> for lists.
- Give messages for deprecated tags.
Change-Id: I06d5e0e75eb3e498063cf0c291e6031af5d93b2d
You can't use linear-gradient() with one value. The value will be
silently ignored and we will display the last buffered value. This
fixes the buffering display to show that nothing is buffered.
This also makes the gradient construction more readable.
Change-Id: I1a93046ef51b70f94b170067b6c5ed2ae43ada1d
Also unified CSS/less style based on that.
This does have to use a forked version of stylelint, since there
is a bug (?) in the globbing library they use that causes it to
fail on our buildbot. I found the simplest solution was just to add
an option to disable globbing, a feature we weren't using anyway.
Closes#1867
Change-Id: I9295b01d5b15d060356e314938b64b551b75de6a
Our previous approach:
For every variant tag, find the associated media tags(with the same
group id), create stream info for each media tag, and then create stream
info for variant tag based on that, and create variants.
This approach has duplicate calls for the media tags with the same group
id to create stream infos.
New approach:
1. Get codecs from variant tags
2. Create stream info from each media tag (with the codecs from variant
tags)
3. Create stream info for each variant tag, and then create variants.
This creates stream info for each media tag once, and avoids duplicate
calls to guess the codecs.
Issue #1558Closes#2066
Change-Id: Icdf3133b1b15d1baf60624ff449e0a61fdb78d8a
Now there is a generic callback to transform the init data before
passing it to the browser. This can be used by apps to use a custom
content ID in FairPlay content. This also adds some utilities to help
in writing these functions and moves the default behavior to DrmEngine.
Closes#1951
Change-Id: I78ce660c126b53a69d5f55b16775ffcdbbe4d748
This allows a request/response filter to determine which EME session
made the request. This also changes the session ID of FairPlay sessions
so they are available too.
Issue #1951
Change-Id: I1a07abae6faf4a87fad7b5d4290a00b25e83da8e
This reverts commit 6e5a0797de, #2042.
The PR as it landed broke some test cases and functionality for storing persistent licenses, and it doesn't seem to work even for its intended use case.
This functionality was lost in the new demo page. This CL re-adds it.
This also fixes the MediaSession externs, which were incorrect; we
added demo typechecking after we removed MediaSession in the new demo
page, so we simply never noticed that.
Closes#1934
Change-Id: I177b80af70acd5211b7f39e6399965f3fdc696b6
When an asset is loaded, the page scrolls to the top, so you can
see the video. When a tab is shown, the page scrolls to the top of
the tab, so you can browse it.
It turns out that, when you load the page, and it auto-plays an
asset, it loads the asset first, then shows the tab second. This is
because tab loading is triggered by an event, so it happens on the
next interruptor cycle.
This changes the load script to wait one cycle after dispatching the
event that triggers the tabs loading, so that the asset will be
loaded second instead.
Closes#2063
Change-Id: Icfb1a189d1c937afb849e5e584313001498c8c7a
This looks nicer, as the progress indicator is around the download button,
instead of being on the other side of the asset card.
Change-Id: If44cc39691664b95c05665665260c5938123cc4f
If an app uses the shaka.ui.Overlay constructor to create
a UI before our auto-detection code runs, they end up with
two UIs one on top of the other.
I personally think anyone should be grateful to get an
extra UI or two, but people complain for some reason.
Closes#2073.
Change-Id: I793b5a7d8b5092a9b65426f5994019fde75bf957
In mobile fullscreen mode, the captions font size was relatively big,
and the captions overflowing out of video window got hidden.
This was because:
1. In full screen mode the font size was set 4.4% of window height.
Changing it to min(4.4% window height, 4.4% window width) should work
for both portrait and landscape screen.
2. css 'white-space:pre' hides the overflown texts. Should be
'pre-line'.
Closes#2051.
Tested with: Demo app, Angel One, Pixel2 in chrome simulator.
1. Load the video, turn on captions, enter full screen mode.
2. Rotate the screen to see the captions in both landscape and portrait
mode.
Before: The captions font is large, and the screen hides overflown
captions.
Now: The captions font is normal, and if the captions are long, it is
shown in a few lines.
Change-Id: I5c8c3aa900ee3623955b735f93647f1ca54e9a66
To prepare for flattening out the manifest structure to remove
periods, this change moves initSegmentReference and
presentationTimeOffset fields into the SegmentReference object. This
way, the segments on either side of a period transition or HLS
discontinuity can have different offsets or init segments, eventually
allowing us to create a single array of SegmentReferences for
multi-period content.
Issue #1339
Change-Id: Ic7eff0483789644881247ecf8044c5fb6a48f0e6
When unloading content (e.g. when closing or when deleting offline
content), we should exit the PIP window and fullscreen. This moves
these actions to the unload() method so they affect other sources of
unloads.
Fixes#2055
Change-Id: Ie1b5ac0f7cb814ff6bae3b08cc4c1fc80967d941
* fix: Reference issue with SegmentReference createUris
* test: Added Segment GetUris Test for timeline
* feat: Get PSSH from segements if not initdata exists
* feat: Get PSSH from segements if not initdata exists
* fix: JSDoc comments and moved drmEngine update to storage
* fix: Remove comments
* fix: Remove unused import
* fix: Lint erros and dedup initData code
* fix: remove no init data test and add check for use persistent license
This makes the close (X) button on the error bigger.
It also makes the documentation link smaller; specifically, it makes the
link div only the size of the text, rather than the entire width of the
error bar.
Closes#2057
Change-Id: Icb7519daea4831edcc2f42cbb851a34356bc8548