Bug 263627
Summary: | [iOS] AudioContext is not consistently resumed when page is brought to foreground | ||
---|---|---|---|
Product: | WebKit | Reporter: | Yuwei <yuweih> |
Component: | Web Audio | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/117771450>
Jean-Yves Avenard [:jya]
Did this ever work on earlier iOS version?
hamish@risingsoftware.com
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
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