Changes to improve videojs playing experience on iOS #7058
2 changed files with 22 additions and 4 deletions
|
@ -283,10 +283,10 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
// as the listener to update static texts.
|
// as the listener to update static texts.
|
||||||
|
|
||||||
const setLabel = (controlBar, childName, label) => {
|
const setLabel = (controlBar, childName, label) => {
|
||||||
const c = controlBar.getChild(childName);
|
// const c = controlBar.getChild(childName);
|
||||||
if (c) {
|
// if (c) {
|
||||||
c.controlText(label);
|
// c.controlText(label);
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
const player = playerRef.current;
|
const player = playerRef.current;
|
||||||
|
|
|
@ -341,13 +341,31 @@ function VideoViewer(props: Props) {
|
||||||
// player.muted(true);
|
// player.muted(true);
|
||||||
// another version had player.play()
|
// another version had player.play()
|
||||||
}
|
}
|
||||||
|
console.log('running here!')
|
||||||
} else {
|
} else {
|
||||||
|
console.log('running here123')
|
||||||
const isPaused = player.paused();
|
const isPaused = player.paused();
|
||||||
|
|
||||||
|
console.log('is paused');
|
||||||
|
console.log(isPaused)
|
||||||
if (IS_IOS && isPaused) {
|
if (IS_IOS && isPaused) {
|
||||||
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
||||||
player.muted(true);
|
player.muted(true);
|
||||||
const iosResponse = player.play();
|
const iosResponse = player.play();
|
||||||
|
console.log(iosResponse)
|
||||||
}
|
}
|
||||||
|
setTimeout(function(){
|
||||||
|
console.log('running here124')
|
||||||
|
const isPaused = player.paused();
|
||||||
|
|||||||
|
console.log('is paused');
|
||||||
|
console.log(isPaused)
|
||||||
|
if (IS_IOS && isPaused) {
|
||||||
|
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
||||||
|
player.muted(true);
|
||||||
|
const iosResponse = player.play();
|
||||||
|
console.log(iosResponse)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
}
|
}
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setIsPlaying(false);
|
setIsPlaying(false);
|
||||||
|
|
Loading…
Reference in a new issue
Lint