From 29dafce0a84c715b1fbef2d85c4b24ff994a47ac Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 30 Aug 2021 23:18:24 +0200 Subject: [PATCH] only show centered button mobile --- .../viewers/videoViewer/internal/videojs.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/component/viewers/videoViewer/internal/videojs.jsx b/ui/component/viewers/videoViewer/internal/videojs.jsx index 1d2f82ba3..157c20b63 100644 --- a/ui/component/viewers/videoViewer/internal/videojs.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs.jsx @@ -500,10 +500,6 @@ export default React.memo(function VideoJs(props: Props) { const el = document.createElement(isAudio ? 'audio' : 'video'); el.className = 'video-js'; - if(!IS_IOS){ - el.classList.add('vjs-big-play-centered'); - } - // el.className = 'vjs-big-play-centered '; // show large play button when paused on ios @@ -555,6 +551,13 @@ export default React.memo(function VideoJs(props: Props) { if (!el) return; 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 playBT = document.getElementsByClassName('vjs-big-play-button')[0]; @@ -573,6 +576,7 @@ export default React.memo(function VideoJs(props: Props) { player.on('volumechange', onVolumeChange); player.on('error', onError); player.on('ended', onEnded); + // player.on('loadstart', function(){ // console.log('LOADED HERE'); //