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){
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 playBT = document.getElementsByClassName('vjs-big-play-button')[0];
playBT.style.display = 'none';
// this seems like a weird thing to have to check for here
if (!player) return;
@ -593,29 +594,29 @@ export default React.memo<Props>(function VideoJs(props: Props) {
// })
// on ios, show a play button when paused
if (IS_IOS) {
const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
player.on('pause', function() {
playBT.style.removeProperty('display');
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;
});
player.on('ended', function() {
if (showAutoplayCountdown) {
playBT.style.display = 'none';
}
});
}
// if (IS_IOS) {
// const playBT = document.getElementsByClassName('vjs-big-play-button')[0];
//
// player.on('pause', function() {
// playBT.style.removeProperty('display');
//
// 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;
// });
//
// player.on('ended', function() {
// if (showAutoplayCountdown) {
// playBT.style.display = 'none';
// }
// });
// }
// Replace volume bar with custom LBRY volume bar
LbryVolumeBarClass.replaceExisting(player);