Below are the changelog entries for each deprecated feature removed by this commit.
-----
feat(config)!: `manifest.dash.defaultPresentationDelay` has been replaced by `manifest.defaultPresentationDelay` (deprecated in v3.0.0)
feat(config)!: Configuration of factories should be plain factory functions, not constructors; these will not be invoked with `new` (deprecated in v3.1.0)
feat(player)!: `shaka.Player.prototype.addTextTrack()` has been replaced by `addTextTrackAsync()`, which returns a `Promise` (deprecated in v3.1.0)
feat(ui)!: `shaka.ui.TrackLabelFormat` has been renamed to `shaka.ui.Overlay.TrackLabelFormat` (deprecated in v3.1.0)
feat(ui)!: `shaka.ui.FailReasonCode` has been renamed to `shaka.ui.Overlay.FailReasonCode` (deprecated in v3.1.0)
feat(offline)!: `shaka.offline.Storage.prototype.store()` returns `AbortableOperation` instead of `Promise` (deprecated in v3.0.0)
feat(offline)!: `shaka.offline.Storage.prototype.getStoreInProgress()` has been removed; concurrent operations are supported, so callers don't need to check this (deprecated in v3.0.0)
feat!: `shaka.util.Uint8ArrayUtils.equal` has been replaced by `shaka.util.BufferUtils.equal`, which can handle multiple types of buffers (deprecated in v3.0.0)
feat(manifest)!: `shaka.media.SegmentIndex.prototype.destroy()` has been replaced by `release()`, which is synchronous (deprecated in v3.0.0)
feat(manifest)!: `shaka.media.SegmentIterator.prototype.seek()`, which mutates the iterator, has been replaced by `shaka.media.SegmentIndex.getIteratorForTime()` (deprecated in v3.1.0)
feat(manifest)!: `shaka.media.SegmentIndex.prototype.merge()` has become private; use `mergeAndEvict()` instead (deprecated in v3.2.0)
feat(plugin)!: `AbrManager` plugins must implement the `playbackRateChanged()` method (deprecated in v3.0.0)
feat(plugin)!: `shaka.extern.Cue.prototype.spacer` has been replaced by the more clearly-named `lineBreak` (deprecated in v3.1.0)
feat(plugin)!: `IUIElement` plugins must have a `release()` method (not `destroy()`) (deprecated in v3.0.0)
Since range elements are special input elements, they must reflect user
interaction, so when the user hovers over the range element, the cursor must be a pointer.
Issue #3220
This has been secretly in our demo on appspot since April 2019, but it
was being inserted on-the-fly by our appspot code on the server-side.
Now that we are transitioning all of our infrastructure into GitHub
Actions, we're simplifying things by making this public and adding it
to the repo for the first time.
Enjoy!
https://shaka-player-demo.appspot.com/demo/#uilang=sjn
The new version requires additional configuration for less syntax, and
has new default rules we were out of compliance with.
I disabled rules about avoiding explicit vendor prefixes (such as
"-webkit") because we are not using any auto-prefixer tools. Other
violations have been fixed:
- kebab-case for element ids
- quotes around URLs
- double quotes instead of single quotes
- disable class selector pattern matching for MDL (external)
- use modern rgb/rgba syntax
- no quotes on font families
- no long-hand when short-hand will do
This brings our NPM audit vulnerabilities from 20 down to 10.
Downgrade less to v3. v4 is failing on macOS for some reason. See
less/less.js#3693
This also makes some less/CSS changes that are useful for future
upgrades:
- wrap all calculations in calc(), which is required in less v4
- remove unneeded @transparent variable
Finally, this fixes an erroneous error message that said "extern
generation failed" instead of "CSS compilation failed".
Closes#3981
Before, we would count on all event listeners for FakeEventTargets to
be cleaned up by the object that listens. Now, FakeEventTarget
implements IReleasable, so that all listeners are removed when owners
call release().
For objects extending FakeEventTarget and also implementing
IDestroyable, the destroy() methods will call out to super.release()
to clean up listeners then. The owner should use destroy() in those
cases.
Issue #3949 (memory leak in DASH live streams with inband EventStream)
First, the positioning of cues was incorrect. We need to explicitly
set all the position attributes when we position elements with the
"absolute" position.
Second, if we position a text <span> manually, the background will fill
the whole region. So to keep the background wrapping the text, we need
to add another <span> for the text.
Third, the background and font color should not be set on every <span>
element since it won't allow parent cues to set the inherited value.
So this moves the defaults to the top-level text element and allows
parent cue elements to override this. It also would make app CSS
easier to override. Because background color isn't inherited through
CSS, the default is set in JavaScript instead.
Fixes#3521Fixes#3600Closes#3713
Change-Id: I45fc88dcac4a0a062e1474087f24c80d98eef619
Previously, many events were being defined with a data dictionary
that used variable-type keys (e.g. {key: value}). This worked fine
in uncompiled mode, but in compiled mode it lead to those properties
being obfuscated.
This changes the FakeEvent constructor to take a map rather than an
object, so the compiler will force the keys to be strings.
Closes#3710
Change-Id: I67b1a391540a5ee21f0aaf940ae054d26f4c10a4
When an external subtitle track is added and you are using DAI, the external track does not take into account the ads that the video has, so this PR makes this internally take into account when generating the external track.
The UI can open up Picture-in-Picture mode, through the PiP button,
but it does not automatically leave PiP mode when being destroyed.
This CL adds leaving PiP mode to the destroy process.
Closes#3553
Change-Id: I6830a7ceed7e4ca4fbd0e7d36b8257d564e0226c
We change the "play" button icon to become "rewind" when the video ends.
However, previously we did not update the icon again when seeking.
This would lead to the icon still looking like a "rewind" button if
the user seeks back from the end of the video.
This fixes that, by making the button listen to "seeking" events.
This uses flexbox once again to get proper positioning of cues. To
compensate for the issues that originally made us remove flexbox, this
adds a wrapper span inside the flexbox element.
Summary of screenshot changes:
- slight change to background sizing
- ui-basic-cue
- ui-cue-with-controls
- ui-duplicate-cues
- ui-end-time-edge-case
- ui-flat-cue-bg
- ui-two-basic-cues
- background fills block with literal newline in text
- ui-cue-with-newline
- region anchored without padding
- ui-region-position
- new screenshots
- *-nested-cues-with-linebreak
- *-region-with-display-alignment (regression test for this issue)
Closes#3379
Change-Id: I8c678721d96662e0f8940cda12df4f5b5e5baf1e
Our "double tap on the video to enter fullscreen" functionality was
not checking to see if fullscreen was enabled or not first, which
would lead to the player erroring if the user double-clicks the
video on a platform that does not support fullscreen.
Fixes#3441
Change-Id: Id96f783a265e0e05fba93cae2da3904bf1747c9b
When switching from using document.createEvent to using the CustomEvent
constructor, we accidentally broke the "shaka-ui-load-failed" event
such that it no longer had a detail object. The detail object is meant
to be provided, not by itself, but as a member variable inside a custom
dictionary.
This fixes the syntax on the constructor.
Issue #3388
Change-Id: I16dc025c21c8f0a012b5854bbbc56e8b110b2300
Some internal Google tools that are meant to find XSS vulnerabilities
complain about some parts of Shaka Player. In particular:
- Using setAttribute instead of a src property
- Using setAttribute with a variable key
- Using URL.createObjectURL
This resolves these internal XSS checks. As far as I can tell, there
are no serious XSS risks from any of these, as the complaining checks
are meant to catch things that could be executed as scripts. None of
these user-controlled inputs are treated as such, but it seems that
the compiler involved can't tell that.
This goes part of the way toward solving #3378.
Change-Id: I302b9eb56a374854c9b8525b21960ef64fd386f1
'stroke-dasharray' and 'stroke-dashoffset' are not supported in IE11,
and we deleted those styles for spinner by accident in PR #3309.
Adding them back to fix the Spinner display.
Change-Id: I5127b1d05d25b9869b7e29f9daf8ce1c6f9b55f2
When we change the video play rate via UI, and pause and play the
video, it resumes playing at 1. That's caused by 'cancelTrickPlay'.
We can set the defaultPlaybackRate when changing the play rate, and
use that value when we resume playing.
Closes#3261
Change-Id: Ifc200697ea956e3257ae3371886bbb5c9c03338f
In 77054d21, we made some changes to UI keyboard events that introduced a new bug. It broke our tracking of pressed keys in the UI, which allows us to observe keyboard navigation through the UI and maintain focus when tabbing through overflow menus.
This fixes the tracking of pressed keys by properly removing them from the set on keyup, not keydown events.
After some research, I found the right way to use @event in JsDoc:
1. An event definition should be: @event className@eventName
2. The link to the event should be:
@link className#event:eventName
Reference: https://groups.google.com/g/jsdoc-users/c/-1Qle3ww8Rk/m/UjiibrcSkoUJ
Change-Id: I09ed999f44df815c2f9f558f7ddbfd2f4c7df426
It turns out that `-webkit-focus-ring-color` is no longer working
across platforms in Chrome. It works on Mac, but not anywhere else.
Removing it creates a consistent focus outline across browsers and
platforms. It was only being used on Safari and Chrome anyway,
neither of which seem to need it.
Closes#2863
Change-Id: Ic6df1a10f14a0907558595e53bef80ac349e6b9d
Seeking rapidly with the keyboard controls now leverages the existing
logic for handling rapid mouse-based seeking. A new method
(changeTo()) has been added to manage this.
This also moves the keyboard control handling from keyup to keydown
events, to handle holding down the key. Previously, holding down the
key triggered the native key handling of the input element.
When you hold down a key, you get multiple keydown events. When you
release it, you get a single keyup event. So when the user holds down
the left arrow, we weren't actually doing anything. Instead, the
keydown handler built into the input element was handling the event.
By switching to keydown events, we get those multiple events when the
key is held, and we get to handle them the way we want, instead of
letting the input element handle them in a way we can't control.
Finally, since we already had a keydown handler on the window to
manage tab navigation, this renames the two handlers to make it clear
which keydown events they handle (on which target).
Closes#3234
Change-Id: I862159adb238436dac7df6451a0f3e3c3f912360
Using flex layout causes problems with the positioning of elements and
causes the borders to be wrapped over the whole parent. This changes
to use block/inline layouts instead.
This also removes any padding around the cue lines, hugging the
background around the text. This is a bit more consistent with other
renderers by having a gap between lines. This also changes a bit of
the nested cues padding.
The deeply nested cue test is different because the `background-color`
CSS attribute isn't inherited, so the default in our CSS sets the
background to black.
Fixes#3013
Change-Id: I3e4b63b1b4de1f12e69fce2460d142e0a69bfcd9
This enables the eslint rule requiring jsdocs on all class
declarations, function declarations, and methods.
Unfortunately, there are two problems with this:
1. We don't use class _declarations_, we use class _expressions_,
which are not covered by this rule. So it does not enforce jsdoc at
the class level.
2. We tend to document a class at the class-level, rather than at the
constructor. But a constructor counts as a method for eslint, so it
requires docs on the constructor. There is no way to configure it to
make an exception for trivial constructors.
So for all trivial (no-argument) constructors, we add empty jsdocs:
/** */
constructor() {
This was quicker and easier than setting up some alternative plugin in
eslint to make an exception for us.
The good news is that this rule caught several undocumented parameters
and places where the jsdoc comment was malformed. So fixing those
also improves the compiler's ability to enforce types.
Change-Id: Icbc46ed690c94e53d354648a883119524f8fca45
Click events in an ad were previously received by shaka-text-container
and shaka-controls-container. shaka-text-container now ignores all
pointer events, because there is nothing interactive in this layer.
shaka-controls-container ignores pointer events only while an ad is
showing, with the exception that the bottom controls are still
clickable even during an ad.
Closes#3053
Change-Id: I07834c75c29315dc76afbdf886517437be5b85ff