[Webkit-unassigned] [Bug 205599] Closing an AudioContext kills native audio played using an AVAudioPlayer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 8 18:53:22 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=205599

distinctdan at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Normal                      |Minor

--- Comment #2 from distinctdan at gmail.com ---
After further testing, I've discovered more details. There are 2 scenarios that this bug appears to impact:

Scenarios: 
1) Close a javascript AudioContext and create a new one.
  Effects:
    - Triggers a native audio interruption "AVAudioSessionInterruptionTypeBegan".
    - BUT, this interruption never ends, IE, "AVAudioSessionInterruptionTypeEnded" is never triggered. However, calling [player play] on the player will cause audio to resume playing anyways.

2) Do the above while the system is under heavy load. Ways I've tested:
- Force close the app and immediately reopen it.
- Use Safari's remote web inspector to repeatedly refresh the cordova webview.

This *sometimes* causes the following:
    - The newly created javascript context will drop to the "interrupted" state 1 or more times shortly after it's been created. Resuming the context allows it to continue playing.


Needed Fix:
- iOS needs to send an "AVAudioSessionInterruptionTypeEnded" notification after the context is closed, so that the app knows it's ok to play audio again.

Hacky Workaround:
- After closing a js AudioContext, assume all native audio interruptions in the next couple of seconds are caused by the close, and tell AVAudioPlayer to play anyways. This means that if a user causes a real interruption in those few seconds, like receiving a phone call or opening Siri, the app will incorrectly keep playing audio.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200109/d8b2623b/attachment.htm>


More information about the webkit-unassigned mailing list