add big button when paused ios

This commit is contained in:
Anthony 2021-08-26 16:39:35 +02:00
parent c6ad44d1e5
commit c9d3da1ae7
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -19,6 +19,8 @@ import isUserTyping from 'util/detect-typing';
// @endif // @endif
const isDev = process.env.NODE_ENV !== 'production'; const isDev = process.env.NODE_ENV !== 'production';
process.on('unhandledRejection', console.log)
export type Player = { export type Player = {
on: (string, (any) => void) => void, on: (string, (any) => void) => void,
one: (string, (any) => void) => void, one: (string, (any) => void) => void,
@ -84,11 +86,12 @@ const VIDEO_JS_OPTIONS = {
controls: true, controls: true,
html5: { html5: {
vhs: { vhs: {
overrideNative: !videojs.browser.IS_ANY_SAFARI, overrideNative: !videojs.browser.IS_ANY_SAFARI, // don't override on safari
}, },
}, },
}; };
// keys to bind to for keyboard shortcuts
const SPACE_BAR_KEYCODE = 32; const SPACE_BAR_KEYCODE = 32;
const SMALL_F_KEYCODE = 70; const SMALL_F_KEYCODE = 70;
const SMALL_M_KEYCODE = 77; const SMALL_M_KEYCODE = 77;
@ -493,6 +496,10 @@ export default React.memo<Props>(function VideoJs(props: Props) {
wrapper.setAttribute('data-vjs-player', 'true'); wrapper.setAttribute('data-vjs-player', 'true');
const el = document.createElement(isAudio ? 'audio' : 'video'); const el = document.createElement(isAudio ? 'audio' : 'video');
el.className = 'video-js vjs-big-play-centered '; el.className = 'video-js vjs-big-play-centered ';
if (IS_IOS) {
el.classList.add('vjs-show-big-play-button-on-pause');
}
wrapper.appendChild(el); wrapper.appendChild(el);
container.appendChild(wrapper); container.appendChild(wrapper);