diff --git a/ui/component/viewers/videoViewer/internal/videojs.jsx b/ui/component/viewers/videoViewer/internal/videojs.jsx index 3160120a1..e4c095e1c 100644 --- a/ui/component/viewers/videoViewer/internal/videojs.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs.jsx @@ -564,12 +564,28 @@ 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'); + + const playBT = document.getElementsByClassName('vjs-big-play-button')[0]; + const videoDiv = player.children_[0]; + const controlBar = document.getElementsByClassName('vjs-control-bar')[0]; + const leftWidth = ((videoDiv.offsetWidth - playBT.offsetWidth) / 2) + 'px'; + const availableHeight = videoDiv.offsetHeight - controlBar.offsetHeight; + const topHeight = (((availableHeight - playBT.offsetHeight) / 2) + 11) + 'px'; + + playBT.style.top = topHeight; + playBT.style.left = leftWidth; + playBT.style.margin = 0; + + }) // on ios, show a play button when paused if (IS_IOS) { const playBT = document.getElementsByClassName('vjs-big-play-button')[0]; player.on('pause', function() { + const videoDiv = player.children_[0]; const controlBar = document.getElementsByClassName('vjs-control-bar')[0]; const leftWidth = ((videoDiv.offsetWidth - playBT.offsetWidth) / 2) + 'px';