hide div properly

This commit is contained in:
Anthony 2021-08-30 20:44:27 +02:00
parent ed62423c02
commit 1a4bc2a543
No known key found for this signature in database
GPG key ID: C386D3C93D50E356

View file

@ -245,6 +245,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
switch (tapButton) { switch (tapButton) {
case TAP.NONE: case TAP.NONE:
document.getElementsByClassName('video-js--tap-to-unmute')[0].style.visibility = 'hidden';
setButtonVisibility(tapToUnmuteRef, false); setButtonVisibility(tapToUnmuteRef, false);
setButtonVisibility(tapToRetryRef, false); setButtonVisibility(tapToRetryRef, false);
break; break;
@ -340,8 +341,10 @@ export default React.memo<Props>(function VideoJs(props: Props) {
} }
} }
function onInitialPlay() { function onInitialPlay() {
const player = playerRef.current; const player = playerRef.current;
// show the unmute button if the video is muted
if (player && (player.muted() || player.volume() === 0)) { if (player && (player.muted() || player.volume() === 0)) {
// The css starts as "hidden". We make it visible here without // The css starts as "hidden". We make it visible here without
// re-rendering the whole thing. // re-rendering the whole thing.