0

If there is sound playing on your web page, you can lock the screen or minimize the browser, but the sound still plays. How can I turn off the sound in current cases?

TryVols
  • 21
  • 3

1 Answers1

0

try document.addEventListener("visibilitychange", onchange);, actually this is your question

Servus
  • 479
  • 3
  • 13
  • Ok, looks like it's working if audio is standalone, but if playing video player in parallel with audio, video is muted, but audio still playing – TryVols Aug 12 '20 at 10:56