⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268791 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 4:32:10 AM (6 years ago)
Author:
youenn@apple.com
Message:

[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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268789 r268791  
     12020-10-21  Youenn Fablet  <youenn@apple.com>
     2
     3        [iOS] Disable audio capture in the background for non Safari applications
     4        https://bugs.webkit.org/show_bug.cgi?id=217948
     5        <rdar://problem/70241557>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * platform/ios/mediastream/video-muted-in-background-tab.html:
     10        By default, audio capture will be muted in WTR if page goes to background.
     11        Update the test to explicitly request for audio capture to continue while in background.
     12
    1132020-10-21  Diego Pino Garcia  <dpino@igalia.com>
    214
  • trunk/LayoutTests/platform/ios/mediastream/video-muted-in-background-tab.html

    r261373 r268791  
    4343
    4444            promise_test(async (t) => {
    45                 if (window.internals)
     45                if (window.internals) {
     46                    window.internals.setShouldInterruptAudioOnPageVisibilityChange(false);
    4647                    window.internals.setPageVisibility(false);
     48                }
    4749                assert_false(audioTrack.muted, "audio track is active");
    4850                assert_true(videoTrack.muted, "video track is muted");
  • trunk/Source/WebCore/ChangeLog

    r268790 r268791  
     12020-10-21  Youenn Fablet  <youenn@apple.com>
     2
     3        [iOS] Disable audio capture in the background for non Safari applications
     4        https://bugs.webkit.org/show_bug.cgi?id=217948
     5        <rdar://problem/70241557>
     6
     7        Reviewed by Eric Carlson.
     8
     9        We do not have good OS support when capturing audio in a WebProcess for a backgrounded application.
     10        Until we have proper support, it seems best to mute audio capture when being backgrounded.
     11        Manually tested.
     12
     13        * platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
     14        (WebCore::RealtimeMediaSourceCenter::shouldInterruptAudioOnPageVisibilityChange):
     15
    1162020-10-21  Philippe Normand  <pnormand@igalia.com>
    217
  • trunk/Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm

    r260366 r268791  
    2929#if ENABLE(MEDIA_STREAM)
    3030
     31#include "RuntimeApplicationChecks.h"
     32
    3133namespace WebCore {
    3234
     
    3436{
    3537#if PLATFORM(IOS)
     38    if (!WebCore::IOSApplication::isMobileSafari() && !WebCore::IOSApplication::isSafariViewService())
     39        return true;
     40
    3641    NSArray *modes = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIBackgroundModes"];
    3742    if (!modes)
Note: See TracChangeset for help on using the changeset viewer.