Title: [210100] trunk
Revision
210100
Author
[email protected]
Date
2016-12-22 09:32:38 -0800 (Thu, 22 Dec 2016)

Log Message

Muted media element playback should not interrupt other audio playback
https://bugs.webkit.org/show_bug.cgi?id=166347

Reviewed by Eric Carlson.

Source/WebCore:

Test: TestWebKitAPI/WebKit/ios/AudioSessionCategoryIOS.mm

* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
(PlatformMediaSessionManager::updateSessionState):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (210099 => 210100)


--- trunk/Source/WebCore/ChangeLog	2016-12-22 17:14:11 UTC (rev 210099)
+++ trunk/Source/WebCore/ChangeLog	2016-12-22 17:32:38 UTC (rev 210100)
@@ -1,5 +1,17 @@
 2016-12-22  Jer Noble  <[email protected]>
 
+        Muted media element playback should not interrupt other audio playback
+        https://bugs.webkit.org/show_bug.cgi?id=166347
+
+        Reviewed by Eric Carlson.
+
+        Test: TestWebKitAPI/WebKit/ios/AudioSessionCategoryIOS.mm
+
+        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
+        (PlatformMediaSessionManager::updateSessionState):
+
+2016-12-22  Jer Noble  <[email protected]>
+
         Check for the existence of AVSampleBufferAudioRenderer.h before redeclaring AVSampleBufferAudioRenderer
         https://bugs.webkit.org/show_bug.cgi?id=166421
 

Modified: trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (210099 => 210100)


--- trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp	2016-12-22 17:14:11 UTC (rev 210099)
+++ trunk/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp	2016-12-22 17:32:38 UTC (rev 210100)
@@ -60,7 +60,7 @@
     if (!Settings::shouldManageAudioSessionCategory())
         return;
 
-    if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
+    if (has(PlatformMediaSession::VideoAudio) || has(PlatformMediaSession::Audio)) {
         if (canProduceAudio())
             AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
         else

Modified: trunk/Tools/ChangeLog (210099 => 210100)


--- trunk/Tools/ChangeLog	2016-12-22 17:14:11 UTC (rev 210099)
+++ trunk/Tools/ChangeLog	2016-12-22 17:32:38 UTC (rev 210100)
@@ -1,3 +1,15 @@
+2016-12-22  Jer Noble  <[email protected]>
+
+        Muted media element playback should not interrupt other audio playback
+        https://bugs.webkit.org/show_bug.cgi?id=166347
+
+        Reviewed by Eric Carlson.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html: Added.
+
 2016-12-22  Alejandro G. Castro  <[email protected]>
 
         [WebRTC] Add support for runtime PeeConnection setting, required after r209757

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (210099 => 210100)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2016-12-22 17:14:11 UTC (rev 210099)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2016-12-22 17:32:38 UTC (rev 210100)
@@ -505,6 +505,7 @@
 		CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */; };
 		CD78E11E1DB7EE2A0014A2DE /* FullscreenDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */; };
 		CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD9E292D1C90C1BA000BB800 /* audio-only.html */; };
+		CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */; };
 		CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */; };
 		CDBFCC461A9FF49E00A7B691 /* FullscreenZoomInitialFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */; };
 		CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8E4851BC5B19400594FEC /* AudioSessionCategoryIOS.mm */; };
@@ -596,6 +597,7 @@
 			dstPath = TestWebKitAPI.resources;
 			dstSubfolderSpec = 7;
 			files = (
+				CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */,
 				9BD4239C1E04C01C00200395 /* chinese-character-with-image.html in Copy Resources */,
 				A155022C1E050D0300A24C57 /* duplicate-completion-handler-calls.html in Copy Resources */,
 				5110FCF91E01CD8A006F8D0B /* IndexUpgrade.blob in Copy Resources */,
@@ -1261,6 +1263,7 @@
 		CD89D0381C4EDB2A00040A04 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = "<group>"; };
 		CD9E292B1C90A71F000BB800 /* RequiresUserActionForPlayback.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RequiresUserActionForPlayback.mm; sourceTree = "<group>"; };
 		CD9E292D1C90C1BA000BB800 /* audio-only.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "audio-only.html"; sourceTree = "<group>"; };
+		CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "video-with-muted-audio.html"; sourceTree = "<group>"; };
 		CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenZoomInitialFrame.html; sourceTree = "<group>"; };
 		CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenZoomInitialFrame.mm; sourceTree = "<group>"; };
 		CDC2C7141797089D00E627FB /* TimeRanges.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TimeRanges.cpp; sourceTree = "<group>"; };
@@ -2183,6 +2186,7 @@
 				CDC8E48A1BC5C96200594FEC /* video-with-audio.mp4 */,
 				CDC8E48B1BC5C96200594FEC /* video-without-audio.html */,
 				CDC8E48C1BC5C96200594FEC /* video-without-audio.mp4 */,
+				CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */,
 			);
 			name = Resources;
 			sourceTree = "<group>";

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm (210099 => 210100)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm	2016-12-22 17:14:11 UTC (rev 210099)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm	2016-12-22 17:32:38 UTC (rev 210100)
@@ -89,6 +89,14 @@
     Util::run(&didBeginPlaying);
 
     EXPECT_WK_STREQ(getAVAudioSessionCategoryAmbient(), [[getAVAudioSessionClass() sharedInstance] category]);
+
+    didBeginPlaying = false;
+
+    [uiWebView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"video-with-muted-audio" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+
+    Util::run(&didBeginPlaying);
+
+    EXPECT_WK_STREQ(getAVAudioSessionCategoryAmbient(), [[getAVAudioSessionClass() sharedInstance] category]);
 }
 
 }

Added: trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html (0 => 210100)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html	                        (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html	2016-12-22 17:32:38 UTC (rev 210100)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script>
+            function go() {
+                var video = document.getElementsByTagName('video')[0];
+                video.play().then(playing).catch(notPlaying);
+            }
+
+        function playing() {
+            try {
+                window.webkit.messageHandlers.testHandler.postMessage('playing');
+            } catch(e) {
+                window.location = 'callback:playing';
+            }
+        }
+
+        function notPlaying() {
+            try {
+                window.webkit.messageHandlers.testHandler.postMessage('not playing');
+            } catch(e) { }
+        }
+        </script>
+    </head>
+    <body _onload_="go()">
+        <video src="" muted webkit-playsinline></video>
+    </body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to