Bug 263627

Summary: [iOS] AudioContext is not consistently resumed when page is brought to foreground
Product: WebKit Reporter: Yuwei <yuweih>
Component: Web AudioAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: cdumez, hamish, jean-yves.avenard, jer.noble, mattwindwer, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: iPhone / iPad   
OS: iOS 17   
See Also: https://bugs.webkit.org/show_bug.cgi?id=281566

Yuwei
Reported 2023-10-24 17:06:35 PDT
I'm running into this bug on a physical iPhone 12 Pro running iOS 17.0.3. I was not able to repro this on iPhone Simulator running iOS 17.0 on iPhone 15 Pro Max. Repro: 1. Open this Web Audio Oscillator demo and play the sine wave: https://webaudioapi.com/samples/oscillator/ 2. Minimize the browser and wait a few seconds 3. Bring the browser back to foreground 4. Repeat step 2-3 a few times and observe the audio output and sound wave visualization Expected: Audio is paused whenever the page is in the background, and it should be resumed whenever the page is brought back to the foreground. Actual: Sometimes the audio is paused and never resumed, but if you try minimizing and resuming the browser again then the audio will appear to resume itself. --- The project I'm working on also have a silent video tag on the page. The video is also paused whenever the audio is (incorrectly) paused. Prior to switching to web audio, we played audio on an audio element, which would keep playing in the background and the video tag would not be paused when the page was brought back to the foreground.
Attachments
Radar WebKit Bug Importer
Comment 1 2023-10-31 17:07:18 PDT
Jean-Yves Avenard [:jya]
Comment 2 2023-11-15 12:43:53 PST
Did this ever work on earlier iOS version?
hamish@risingsoftware.com
Comment 3 2023-12-18 16:32:27 PST
I see this in my app. The audio context has state 'running', but currentTime is not increasing. If I suspend and resume programatically then the context works again.
Matthew Windwer
Comment 4 2024-07-26 13:27:01 PDT
Here are steps to reproduce what @hamish reported, that the audio context has a state 'running' but currentTime is not increasing, which in itself seems to be a bug, and it cannot always be resumed: https://bugs.webkit.org/show_bug.cgi?id=276687#c6
Note You need to log in before you can comment on or make changes to this bug.