From ed62423c02b064cc3a39f51a74adaf00cc269f9d Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 30 Aug 2021 19:15:17 +0200 Subject: [PATCH] show the volume button --- ui/component/viewers/videoViewer/internal/videojs.jsx | 3 +++ ui/component/viewers/videoViewer/view.jsx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ui/component/viewers/videoViewer/internal/videojs.jsx b/ui/component/viewers/videoViewer/internal/videojs.jsx index 557d2faeb..f964ea6af 100644 --- a/ui/component/viewers/videoViewer/internal/videojs.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs.jsx @@ -262,10 +262,13 @@ export default React.memo(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); } diff --git a/ui/component/viewers/videoViewer/view.jsx b/ui/component/viewers/videoViewer/view.jsx index 9cdcd356e..6968fddc0 100644 --- a/ui/component/viewers/videoViewer/view.jsx +++ b/ui/component/viewers/videoViewer/view.jsx @@ -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);