<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[210347] branches/safari-603-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/210347">210347</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-01-05 09:09:15 -0800 (Thu, 05 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/210100">r210100</a>. rdar://problem/28388000</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoreplatformaudiococoaMediaSessionManagerCocoacpp">branches/safari-603-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp</a></li>
<li><a href="#branchessafari603branchToolsChangeLog">branches/safari-603-branch/Tools/ChangeLog</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKitiosAudioSessionCategoryIOSmm">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchToolsTestWebKitAPITestsWebKitiosvideowithmutedaudiohtml">branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (210346 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-05 17:09:12 UTC (rev 210346)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210100. rdar://problem/28388000
+
+    2016-12-22  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+            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):
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210083. rdar://problem/25391382
</span><span class="cx"> 
</span><span class="cx">     2016-12-21  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCoreplatformaudiococoaMediaSessionManagerCocoacpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp (210346 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp        2017-01-05 17:09:12 UTC (rev 210346)
+++ branches/safari-603-branch/Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.cpp        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     if (!Settings::shouldManageAudioSessionCategory())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (has(PlatformMediaSession::Video) || has(PlatformMediaSession::Audio)) {
</del><ins>+    if (has(PlatformMediaSession::VideoAudio) || has(PlatformMediaSession::Audio)) {
</ins><span class="cx">         if (canProduceAudio())
</span><span class="cx">             AudioSession::sharedSession().setCategory(AudioSession::MediaPlayback);
</span><span class="cx">         else
</span></span></pre></div>
<a id="branchessafari603branchToolsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/ChangeLog (210346 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/ChangeLog        2017-01-05 17:09:12 UTC (rev 210346)
+++ branches/safari-603-branch/Tools/ChangeLog        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r210100. rdar://problem/28388000
+
+    2016-12-22  Jer Noble  &lt;jer.noble@apple.com&gt;
+
+            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.
+
+2017-01-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r210093. rdar://problem/29758423
</span><span class="cx"> 
</span><span class="cx">     2016-12-21  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (210346 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-05 17:09:12 UTC (rev 210346)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -505,6 +505,7 @@
</span><span class="cx">                 CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD78E11A1DB7EA360014A2DE /* FullscreenDelegate.mm */; };
</span><span class="cx">                 CD78E11E1DB7EE2A0014A2DE /* FullscreenDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */; };
</span><span class="cx">                 CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CD9E292D1C90C1BA000BB800 /* audio-only.html */; };
</span><ins>+                CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */; };
</ins><span class="cx">                 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */; };
</span><span class="cx">                 CDBFCC461A9FF49E00A7B691 /* FullscreenZoomInitialFrame.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */; };
</span><span class="cx">                 CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8E4851BC5B19400594FEC /* AudioSessionCategoryIOS.mm */; };
</span><span class="lines">@@ -596,6 +597,7 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                CDB4115A1E0B00DB00EAD352 /* video-with-muted-audio.html in Copy Resources */,
</ins><span class="cx">                                 9BD4239C1E04C01C00200395 /* chinese-character-with-image.html in Copy Resources */,
</span><span class="cx">                                 A155022C1E050D0300A24C57 /* duplicate-completion-handler-calls.html in Copy Resources */,
</span><span class="cx">                                 5110FCF91E01CD8A006F8D0B /* IndexUpgrade.blob in Copy Resources */,
</span><span class="lines">@@ -1261,6 +1263,7 @@
</span><span class="cx">                 CD89D0381C4EDB2A00040A04 /* WebCoreNSURLSession.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreNSURLSession.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD9E292B1C90A71F000BB800 /* RequiresUserActionForPlayback.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RequiresUserActionForPlayback.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD9E292D1C90C1BA000BB800 /* audio-only.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;audio-only.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = &quot;video-with-muted-audio.html&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDBFCC421A9FF44800A7B691 /* FullscreenZoomInitialFrame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenZoomInitialFrame.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenZoomInitialFrame.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC2C7141797089D00E627FB /* TimeRanges.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TimeRanges.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2183,6 +2186,7 @@
</span><span class="cx">                                 CDC8E48A1BC5C96200594FEC /* video-with-audio.mp4 */,
</span><span class="cx">                                 CDC8E48B1BC5C96200594FEC /* video-without-audio.html */,
</span><span class="cx">                                 CDC8E48C1BC5C96200594FEC /* video-without-audio.mp4 */,
</span><ins>+                                CDB411591E09DA8E00EAD352 /* video-with-muted-audio.html */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Resources;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKitiosAudioSessionCategoryIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm (210346 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm        2017-01-05 17:09:12 UTC (rev 210346)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/AudioSessionCategoryIOS.mm        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -89,6 +89,14 @@
</span><span class="cx">     Util::run(&amp;didBeginPlaying);
</span><span class="cx"> 
</span><span class="cx">     EXPECT_WK_STREQ(getAVAudioSessionCategoryAmbient(), [[getAVAudioSessionClass() sharedInstance] category]);
</span><ins>+
+    didBeginPlaying = false;
+
+    [uiWebView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@&quot;video-with-muted-audio&quot; withExtension:@&quot;html&quot; subdirectory:@&quot;TestWebKitAPI.resources&quot;]]];
+
+    Util::run(&amp;didBeginPlaying);
+
+    EXPECT_WK_STREQ(getAVAudioSessionCategoryAmbient(), [[getAVAudioSessionClass() sharedInstance] category]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari603branchToolsTestWebKitAPITestsWebKitiosvideowithmutedaudiohtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html (0 => 210347)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html                                (rev 0)
+++ branches/safari-603-branch/Tools/TestWebKitAPI/Tests/WebKit/ios/video-with-muted-audio.html        2017-01-05 17:09:15 UTC (rev 210347)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+    &lt;head&gt;
+        &lt;script&gt;
+            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) { }
+        }
+        &lt;/script&gt;
+    &lt;/head&gt;
+    &lt;body onload=&quot;go()&quot;&gt;
+        &lt;video src=&quot;video-with-audio.mp4&quot; muted webkit-playsinline&gt;&lt;/video&gt;
+    &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre>
</div>
</div>

</body>
</html>