howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Howler.mute(false) doesn't work sometimes after the document lost focus or if the screen is locked and then unlocked IOS Chrome/Safari

Open EvanetaI opened this issue 2 years ago • 0 comments

The Problem

Howler.mute(false) doesn't work sometimes after the document lost focus or if the screen is locked and then unlocked IOS Chrome, Safari. This happens when "visibilitychange" is being emitted, i.e., screen locked or if the tab is minimized. It's not an audio context issue, because I did check if the context is lost, and it's not. Sometimes the audio is back when a screen click is performed, but sometimes this doesn't work.

protected handleVisibilityChange(): void { if (document.visibilityState == 'hidden') { Howler.mute(true); } else { Howler.mute(false); } }

Reproducible Example

No response

Reproduction Steps

Device: iOS - iPhone X 16.5.1 & 11 Pro 15.6

100% Reproducible: yes

Browser: Safari, Chrome

  1. Play sound
  2. Lock the screen
  3. Unlock

Possible Solution

No response

Context

No response

Howler.js Version

v2.1.2 v2.2.3

Affected Browser(s)/Versiuon(s)

No response

EvanetaI avatar Jul 20 '23 08:07 EvanetaI