only show centered button mobile

This commit is contained in:
Anthony 2021-08-30 23:18:24 +02:00
parent 429ead3b3b
commit 29dafce0a8
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -500,10 +500,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
const el = document.createElement(isAudio ? 'audio' : 'video'); const el = document.createElement(isAudio ? 'audio' : 'video');
el.className = 'video-js'; el.className = 'video-js';
if(!IS_IOS){
el.classList.add('vjs-big-play-centered');
}
// el.className = 'vjs-big-play-centered '; // el.className = 'vjs-big-play-centered ';
// show large play button when paused on ios // show large play button when paused on ios
@ -555,6 +551,13 @@ export default React.memo<Props>(function VideoJs(props: Props) {
if (!el) return; if (!el) return;
const vjs = videojs(el, videoJsOptions, () => { const vjs = videojs(el, videoJsOptions, () => {
const isNotAndroidOrIos = !videojs.browser.IS_ANDROID && !videojs.browser.is_IOS;
if(isNotAndroidOrIos){
el.classList.add('vjs-big-play-centered');
}
const player = playerRef.current; const player = playerRef.current;
const playBT = document.getElementsByClassName('vjs-big-play-button')[0]; const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
@ -573,6 +576,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
player.on('volumechange', onVolumeChange); player.on('volumechange', onVolumeChange);
player.on('error', onError); player.on('error', onError);
player.on('ended', onEnded); player.on('ended', onEnded);
// player.on('loadstart', function(){ // player.on('loadstart', function(){
// console.log('LOADED HERE'); // console.log('LOADED HERE');
// //