turn off big play button

This commit is contained in:
Anthony 2021-08-31 17:33:17 +02:00
parent 29dafce0a8
commit abbd524ead
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -556,12 +556,13 @@ export default React.memo<Props>(function VideoJs(props: Props) {
if(isNotAndroidOrIos){ if(isNotAndroidOrIos){
el.classList.add('vjs-big-play-centered'); el.classList.add('vjs-big-play-centered');
const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
playBT.style.display = 'none';
} }
const player = playerRef.current; const player = playerRef.current;
const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
playBT.style.display = 'none';
// this seems like a weird thing to have to check for here // this seems like a weird thing to have to check for here
if (!player) return; if (!player) return;
@ -593,29 +594,29 @@ export default React.memo<Props>(function VideoJs(props: Props) {
// }) // })
// on ios, show a play button when paused // on ios, show a play button when paused
if (IS_IOS) { // if (IS_IOS) {
const playBT = document.getElementsByClassName('vjs-big-play-button')[0]; // const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
//
player.on('pause', function() { // player.on('pause', function() {
playBT.style.removeProperty('display'); // playBT.style.removeProperty('display');
//
const videoDiv = player.children_[0]; // const videoDiv = player.children_[0];
const controlBar = document.getElementsByClassName('vjs-control-bar')[0]; // const controlBar = document.getElementsByClassName('vjs-control-bar')[0];
const leftWidth = ((videoDiv.offsetWidth - playBT.offsetWidth) / 2) + 'px'; // const leftWidth = ((videoDiv.offsetWidth - playBT.offsetWidth) / 2) + 'px';
const availableHeight = videoDiv.offsetHeight - controlBar.offsetHeight; // const availableHeight = videoDiv.offsetHeight - controlBar.offsetHeight;
const topHeight = (((availableHeight - playBT.offsetHeight) / 2) + 11) + 'px'; // const topHeight = (((availableHeight - playBT.offsetHeight) / 2) + 11) + 'px';
//
playBT.style.top = topHeight; // playBT.style.top = topHeight;
playBT.style.left = leftWidth; // playBT.style.left = leftWidth;
playBT.style.margin = 0; // playBT.style.margin = 0;
}); // });
//
player.on('ended', function() { // player.on('ended', function() {
if (showAutoplayCountdown) { // if (showAutoplayCountdown) {
playBT.style.display = 'none'; // playBT.style.display = 'none';
} // }
}); // });
} // }
// Replace volume bar with custom LBRY volume bar // Replace volume bar with custom LBRY volume bar
LbryVolumeBarClass.replaceExisting(player); LbryVolumeBarClass.replaceExisting(player);