This will prevent a null exception when a video.js is implemented in a 'display:none' iframe on Firefox (<62).
This is a fix in continuation of the PR #3664 regarding a bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=548397
Currently, zh-CN and zh-TW are used as shorthands for Simplified and Traditional Chinese character sets, respectively. However, they carry with them a built-in assumption about the geographic locale which may not be appropriate in all cases.
The codes zh-Hans and zh-Hant are more correct in that they refer only to the character set and not the geographic locale. Further specificity is available via codes like zh-Hans-CN.
PR #5083 introduces a fix to #5624, an issue with click events when
Polymer's tap gesture is being used. However, this causes an issue where
`player.on('click')` no longer triggers from the play toggle. Thus, we
revert the change. In addition, looking at Polymer 2 and 3, they
recommend against using the tap gesture.
Fixes#6092
The WICG spec calls out only two events, enterpictureinpicture and
leavepictureinpicture. We should try and only use those.
If pictureinpicturechange is still necessary, it can be re-added at a
later date.
Video.js checks whether sources are playable and both displays a message to the user and logs an error to the console. In Google's mobile friendly test and related tools, this message and error is triggered because their test browser's video element does not support any video formats. Some Video.js users are concerned about the æsthetics of the rendered preview within the tools and whether this might have an SEO impact.
Adds a suppressNotSupportedError option, defaulting to false. If set to true, if no sources are playable the error is deferred to the first human interaction (click or touchstart) but cleared if a loadstart occurs.
Adds a new PictureInPictureToggle component in the controls bar of the player. It depends on videojs-font 3.2.0 (videojs/font#41) for icons.
Final spec piece from #5824.
This splits up the `update` method into two methods: `update` and `write`. The new write method is only responsible for updating the text content of the tooltips. This is useful if you wan't to be able to override the behavior in some way but still wanted all the behavior in `update` and not take a double dom modification hit.
This allows the user to display multiple tracks when
`allowMultipleShowingTracks` is passed to the `TextTrackDisplay`.
Currently, multiple tracks must be shown programmatically and cannot be
done via the subtitles menus.
In addition, this adds two new classes to cue elements:
`vjs-text-track-cue` and `vjs-text-track-cue-${track.language}`. This
allows easier targetting with CSS.
Example usage:
```js
var player = videojs('example-video', {
textTrackDisplay: {
allowMultipleShowingTracks: true
}
});
```
Fixes#5798.
The play button stops working when recent versions of Google's Polymer is in use on the page because of the way Polymer synthesizes 'tap' events on non-touch devices. The Polymer tap code thinks the click event was ignored unless the DOM event's stopPropagation method is
called.
In chrome 70 the small play/pause control doesn't work with Polymer 1.x Gestures tap is used on document. Demo of issue: https://codepen.io/mscalora/pen/mQzQmpFixes#5624.
This is a rebased and updated PR of #5841.
We wanted to use the sass package as that's what the docs recommend. We also wanted to disable source maps that CDN-linked code won't try to download it.
Fixes#5841, fixes#5826.
On browsers that implement the Unprefixed Fullscreen API, pass a FullscreenOptions dictionary to requestFullscreen.
Add `fullscreenOptions` option with default value of `{navigationUI: 'hide'}` to player.
See https://fullscreen.spec.whatwg.org/#dictdef-fullscreenoptions
This new events function allows you to listen to a list of events and know that only one handler will ever be called for the group. With just one event, it'll function similarly to `.one`.
Examples:
Single event
```
const player = videojs('some-player-id');
player.any('a', (e) => console.log(e.type + ' triggered');
player.trigger('a');
// logs 'a triggered'
player.trigger('a');
// logs nothing as the listener has been removed.
```
Multiple Events
```
const player = videojs('some-player-id');
player.any(['a', 'b', 'c', 'd'], (e) => console.log(e.type + ' triggered');
player.trigger('d');
// logs 'd triggered'
player.trigger('a');
player.trigger('b');
player.trigger('c');
player.trigger('d');
// all triggers above log nothing as the listener is removed after the first 'd' trigger.
```
Following #5824, this PR adds support for some Picture-in-Picture methods described in the spec and article. It also makes sure that we can listen to the enterpictureinpicture and leavepictureinpicture events on the player.
This player behavior is very useful for accessibility because the user can cancel the action by clicking outside the button area. It is recommended by the WCAG 2.1 "2.5.2 Pointer Cancellation" spec.