I'am working on video HTML Tag i want pause the audio when new Tab is open. Pls help to fix this issue.
<video autoplay onplay="clickplayer()" id="player" onended="endplayer()" fullscreen="true" controls onvolumechange="myFunction()" ontimeupdate="document.getElementById('tracktime').innerHTML = Math.floor(this.currentTime) + ' / ' + Math.floor(this.duration);">dik</video>
You should detect tab visibility on
visibilitychange
event and pause video if tab is hidden.