show the volume button
This commit is contained in:
parent
91fe871be3
commit
ed62423c02
2 changed files with 5 additions and 0 deletions
|
@ -262,10 +262,13 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
// unmute video when player hits "Tap to unmute button"
|
||||
function unmuteAndHideHint() {
|
||||
const player = playerRef.current;
|
||||
if (player) {
|
||||
// unmute the video
|
||||
player.muted(false);
|
||||
// turn the volume all the way up if it's at 0
|
||||
if (player.volume() === 0) {
|
||||
player.volume(1.0);
|
||||
}
|
||||
|
|
|
@ -247,6 +247,7 @@ function VideoViewer(props: Props) {
|
|||
if (typeof error === 'object' && error.name && error.name === 'NotAllowedError') {
|
||||
console.log('running here!')
|
||||
if (player.autoplay() && !player.muted()) {
|
||||
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
||||
player.muted(true);
|
||||
// another version had player.play()
|
||||
player.play()
|
||||
|
@ -255,6 +256,7 @@ function VideoViewer(props: Props) {
|
|||
console.log('other block conditional');
|
||||
player.muted(true);
|
||||
player.play()
|
||||
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'visible';
|
||||
}
|
||||
setIsLoading(false);
|
||||
setIsPlaying(false);
|
||||
|
|
Loading…
Reference in a new issue