Title: [269138] branches/safari-610-branch
Revision
269138
Author
[email protected]
Date
2020-10-28 23:13:47 -0700 (Wed, 28 Oct 2020)

Log Message

Cherry-pick r268791. rdar://problem/70795323

    [iOS] Disable audio capture in the background for non Safari applications
    https://bugs.webkit.org/show_bug.cgi?id=217948
    <rdar://problem/70241557>

    Reviewed by Eric Carlson.

    Source/WebCore:

    We do not have good OS support when capturing audio in a WebProcess for a backgrounded application.
    Until we have proper support, it seems best to mute audio capture when being backgrounded.
    Manually tested.

    * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
    (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):

    LayoutTests:

    * platform/ios/mediastream/video-muted-in-background-tab.html:
    By default, audio capture will be muted in WTR if page goes to background.
    Update the test to explicitly request for audio capture to continue while in background.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268791 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610-branch/LayoutTests/ChangeLog (269137 => 269138)


--- branches/safari-610-branch/LayoutTests/ChangeLog	2020-10-29 05:26:10 UTC (rev 269137)
+++ branches/safari-610-branch/LayoutTests/ChangeLog	2020-10-29 06:13:47 UTC (rev 269138)
@@ -1,3 +1,43 @@
+2020-10-28  Russell Epstein  <[email protected]>
+
+        Cherry-pick r268791. rdar://problem/70795323
+
+    [iOS] Disable audio capture in the background for non Safari applications
+    https://bugs.webkit.org/show_bug.cgi?id=217948
+    <rdar://problem/70241557>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    We do not have good OS support when capturing audio in a WebProcess for a backgrounded application.
+    Until we have proper support, it seems best to mute audio capture when being backgrounded.
+    Manually tested.
+    
+    * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
+    (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
+    
+    LayoutTests:
+    
+    * platform/ios/mediastream/video-muted-in-background-tab.html:
+    By default, audio capture will be muted in WTR if page goes to background.
+    Update the test to explicitly request for audio capture to continue while in background.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-21  Youenn Fablet  <[email protected]>
+
+            [iOS] Disable audio capture in the background for non Safari applications
+            https://bugs.webkit.org/show_bug.cgi?id=217948
+            <rdar://problem/70241557>
+
+            Reviewed by Eric Carlson.
+
+            * platform/ios/mediastream/video-muted-in-background-tab.html:
+            By default, audio capture will be muted in WTR if page goes to background.
+            Update the test to explicitly request for audio capture to continue while in background.
+
 2020-10-26  Karl Rackler  <[email protected]>
 
         REGRESSION: [ iOS wk2 ] fast/events/touch/ios/pointer-events-with-modifiers.html is a constant crash 

Modified: branches/safari-610-branch/LayoutTests/platform/ios/mediastream/video-muted-in-background-tab.html (269137 => 269138)


--- branches/safari-610-branch/LayoutTests/platform/ios/mediastream/video-muted-in-background-tab.html	2020-10-29 05:26:10 UTC (rev 269137)
+++ branches/safari-610-branch/LayoutTests/platform/ios/mediastream/video-muted-in-background-tab.html	2020-10-29 06:13:47 UTC (rev 269138)
@@ -42,8 +42,10 @@
             }, "Setup stream");
 
             promise_test(async (t) => {
-                if (window.internals)
+                if (window.internals) {
+                    window.internals.setShouldInterruptAudioOnPageVisibilityChange(false);
                     window.internals.setPageVisibility(false);
+                }
                 assert_false(audioTrack.muted, "audio track is active");
                 assert_true(videoTrack.muted, "video track is muted");
             }, "Hide page, only video should be muted");

Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (269137 => 269138)


--- branches/safari-610-branch/Source/WebCore/ChangeLog	2020-10-29 05:26:10 UTC (rev 269137)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog	2020-10-29 06:13:47 UTC (rev 269138)
@@ -1,3 +1,46 @@
+2020-10-28  Russell Epstein  <[email protected]>
+
+        Cherry-pick r268791. rdar://problem/70795323
+
+    [iOS] Disable audio capture in the background for non Safari applications
+    https://bugs.webkit.org/show_bug.cgi?id=217948
+    <rdar://problem/70241557>
+    
+    Reviewed by Eric Carlson.
+    
+    Source/WebCore:
+    
+    We do not have good OS support when capturing audio in a WebProcess for a backgrounded application.
+    Until we have proper support, it seems best to mute audio capture when being backgrounded.
+    Manually tested.
+    
+    * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
+    (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
+    
+    LayoutTests:
+    
+    * platform/ios/mediastream/video-muted-in-background-tab.html:
+    By default, audio capture will be muted in WTR if page goes to background.
+    Update the test to explicitly request for audio capture to continue while in background.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-21  Youenn Fablet  <[email protected]>
+
+            [iOS] Disable audio capture in the background for non Safari applications
+            https://bugs.webkit.org/show_bug.cgi?id=217948
+            <rdar://problem/70241557>
+
+            Reviewed by Eric Carlson.
+
+            We do not have good OS support when capturing audio in a WebProcess for a backgrounded application.
+            Until we have proper support, it seems best to mute audio capture when being backgrounded.
+            Manually tested.
+
+            * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
+            (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
+
 2020-10-21  Russell Epstein  <[email protected]>
 
         Cherry-pick r268398. rdar://problem/70541902

Modified: branches/safari-610-branch/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm (269137 => 269138)


--- branches/safari-610-branch/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm	2020-10-29 05:26:10 UTC (rev 269137)
+++ branches/safari-610-branch/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm	2020-10-29 06:13:47 UTC (rev 269138)
@@ -28,11 +28,16 @@
 
 #if ENABLE(MEDIA_STREAM)
 
+#include "RuntimeApplicationChecks.h"
+
 namespace WebCore {
 
 bool RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange()
 {
 #if PLATFORM(IOS)
+    if (!WebCore::IOSApplication::isMobileSafari() && !WebCore::IOSApplication::isSafariViewService())
+        return true;
+
     NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
     if (!modes)
         return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to