Bug 220960

Summary: Mute audio capture for speech recognition based on shouldInterruptAudioOnPageVisibilityChange when page is invisible
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: stephan.szabo, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Sihui Liu 2021-01-25 17:18:41 PST
...
Comment 1 Sihui Liu 2021-01-25 17:30:12 PST
Created attachment 418360 [details]
Patch
Comment 2 Sihui Liu 2021-01-25 17:31:18 PST
Created attachment 418361 [details]
Patch
Comment 3 Stephan Szabo 2021-01-25 18:58:12 PST
Comment on attachment 418361 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418361&action=review

> Source/WebKit/UIProcess/WebProcessProxy.cpp:1793
> +    if (!RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange())

This seems like it may need to be in at least a #if ENABLE(MEDIA_STREAM) since RealtimeMediaSourceCenter.h uses one around the whole body.
Comment 4 Sihui Liu 2021-01-26 00:18:28 PST
Created attachment 418376 [details]
Patch
Comment 5 youenn fablet 2021-01-26 00:35:14 PST
Comment on attachment 418376 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418376&action=review

> Source/WebKit/UIProcess/SpeechRecognitionPermissionManager.cpp:166
> +        m_suspended = true;

Do we really need that change?
It moves away from being able to apply user gesture constraint to this API, which seems desirable given this asks for microphone and can prompt the user.
Comment 6 Sihui Liu 2021-01-26 09:45:36 PST
Created attachment 418432 [details]
Patch
Comment 7 Sihui Liu 2021-01-26 15:24:42 PST
Created attachment 418479 [details]
Patch
Comment 8 Sihui Liu 2021-01-26 20:54:18 PST
Created attachment 418502 [details]
Patch
Comment 9 EWS 2021-01-26 22:31:11 PST
Committed r271935: <https://trac.webkit.org/changeset/271935>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 418502 [details].
Comment 10 Radar WebKit Bug Importer 2021-01-26 22:32:12 PST
<rdar://problem/73648946>