Bug 237654

Summary: Make sure to end any pending AudioSession interruption when activating it
Product: WebKit Reporter: youenn fablet <youennf>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, philipj, renduser, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description youenn fablet 2022-03-09 06:44:44 PST
Make sure to end any pending AudioSession interruption when activating it
Comment 1 youenn fablet 2022-03-09 06:45:04 PST
<rdar://88405081>
Comment 2 youenn fablet 2022-03-09 06:50:14 PST
Created attachment 454233 [details]
Patch
Comment 3 youenn fablet 2022-03-09 07:00:31 PST
This solves the reported issue but does not solve the general problem.
Say we do the following:
- capture microphone (which activates the audio session), then stop capture microphone (without deactivating the audio session since we would have a remaining element).
- receive the interruption from AudioSession after a few minutes
- capture camera and try to autoplay it.
It would fail (until we for instance capture microphone again).

Maybe we should do some additional things like:
- Deactivate the audio session when we are doing nothing with it (which will remove the interruption in most cases).
- Add special treatment to AudioSession interruptions. It seems odd that muted video would not autoplay due to an AudioSession ongoing interruption.
Comment 4 youenn fablet 2022-03-09 08:52:25 PST
*** Bug 237653 has been marked as a duplicate of this bug. ***
Comment 5 EWS 2022-03-15 00:29:56 PDT
Committed r291268 (248417@main): <https://commits.webkit.org/248417@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454233 [details].
Comment 6 Brent Fulgham 2022-06-23 16:53:30 PDT
*** Bug 239927 has been marked as a duplicate of this bug. ***