<!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>[197204] trunk/Source</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/197204">197204</a></dd>
<dt>Author</dt> <dd>bdakin@apple.com</dd>
<dt>Date</dt> <dd>2016-02-26 14:28:23 -0800 (Fri, 26 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add support for playbackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=154742
-and corresponding-
rdar://problem/23833753
Reviewed by Jer Noble.
Source/WebCore:
Make AVKitSPI.h private so that it can be used from other projects.
* WebCore.xcodeproj/project.pbxproj:
Right now, set up a controls manager for a video when it starts playing. In
the future, this is something that should be handled by the
PlatformMediaSessionManager since we only want a controls for the
currentSession.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
New function setUpVideoControlsManager.
* page/ChromeClient.h:
Make these CoreMedia functions available on Mac and iOS instead of just iOS.
* platform/cf/CoreMediaSoftLink.cpp:
* platform/cf/CoreMediaSoftLink.h:
This patch fleshes out an implementation for a bunch of these interface
functions since they need to communicate to the playbackControlsManager. This
is also where the playbackControlsManager lives.
* platform/mac/WebVideoFullscreenInterfaceMac.h:
Define an interface and implementation for WebPlaybackControlsManager.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
(-[WebPlaybackControlsManager isSeeking]):
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
Relay this information to the playbackControlsManager.
(WebCore::WebVideoFullscreenInterfaceMac::setDuration):
(WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
(WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
(WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
New SPI needed.
* platform/spi/cocoa/AVKitSPI.h:
* platform/spi/mac/AVFoundationSPI.h:
Source/WebKit2:
WebVideoFullscreenManagerProxy ensures the model and interface for the
UIProcess side of the playbackControlsManager. It also caches the
m_controlsManagerContextId so that it can return the
controlsManagerInterface.
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
(WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to
update WebViewImplAdditions.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::isPlayingMediaDidChange):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::isPlayingVideoWithAudio):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isPlayingAudio):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::isPlayingMediaDidChange):
Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::setUpVideoControlsManager):
* WebProcess/WebCoreSupport/WebChromeClient.h:
Ensure the model an interface for the playbackControlsManager on the
WebProcess side and pass the message to the UIProcess to do the same.
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfCoreMediaSoftLinkh">trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMach">trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMacmm">trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaAVKitSPIh">trunk/Source/WebCore/platform/spi/cocoa/AVKitSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxyh">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymessagesin">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymm">trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplh">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebViewImplmm">trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagerh">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermm">trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/ChangeLog        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -1,3 +1,60 @@
</span><ins>+2016-02-26 Beth Dakin <bdakin@apple.com>
+
+ Add support for playbackControlsManager
+ https://bugs.webkit.org/show_bug.cgi?id=154742
+ -and corresponding-
+ rdar://problem/23833753
+
+ Reviewed by Jer Noble.
+
+ Make AVKitSPI.h private so that it can be used from other projects.
+ * WebCore.xcodeproj/project.pbxproj:
+
+ Right now, set up a controls manager for a video when it starts playing. In
+ the future, this is something that should be handled by the
+ PlatformMediaSessionManager since we only want a controls for the
+ currentSession.
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::playInternal):
+
+ New function setUpVideoControlsManager.
+ * page/ChromeClient.h:
+
+ Make these CoreMedia functions available on Mac and iOS instead of just iOS.
+ * platform/cf/CoreMediaSoftLink.cpp:
+ * platform/cf/CoreMediaSoftLink.h:
+
+ This patch fleshes out an implementation for a bunch of these interface
+ functions since they need to communicate to the playbackControlsManager. This
+ is also where the playbackControlsManager lives.
+ * platform/mac/WebVideoFullscreenInterfaceMac.h:
+
+ Define an interface and implementation for WebPlaybackControlsManager.
+ * platform/mac/WebVideoFullscreenInterfaceMac.mm:
+ (-[WebPlaybackControlsManager initWithWebVideoFullscreenInterfaceMac:]):
+ (-[WebPlaybackControlsManager isSeeking]):
+ (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
+ (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
+ (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
+ (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
+ (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
+ (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
+ (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
+ (-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
+
+ Relay this information to the playbackControlsManager.
+ (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
+ (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
+ (WebCore::WebVideoFullscreenInterfaceMac::setRate):
+ (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
+ (WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
+ (WebCore::WebVideoFullscreenInterfaceMac::playBackControlsManager):
+ (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
+
+ New SPI needed.
+ * platform/spi/cocoa/AVKitSPI.h:
+ * platform/spi/mac/AVFoundationSPI.h:
+
</ins><span class="cx"> 2016-02-26 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> <g> wrapping <symbol> causes display of hidden <symbol>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -329,7 +329,7 @@
</span><span class="cx">                 07EE76EC1BE96DB000F89133 /* MockRealtimeVideoSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */; };
</span><span class="cx">                 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; };
</span><span class="cx">                 07EE76F01BEA619800F89133 /* MockRealtimeVideoSourceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07EE76EE1BEA619800F89133 /* MockRealtimeVideoSourceMac.mm */; };
</span><del>-                07F0B97A1AC5DB3300E535D9 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */; };
</del><ins>+                07F0B97A1AC5DB3300E535D9 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 07F0B97C1AC5DB4600E535D9 /* AVFoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F0B97B1AC5DB4600E535D9 /* AVFoundationSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -2955,6 +2955,14 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // FIXME: rdar://problem/23833752 We need to be more strategic about when we set up the video controls manager.
+ // It's really something that should be handled by the PlatformMediaSessionManager since we only want a controls
+ // manager for the currentSession.
+ if (document().page() && is<HTMLVideoElement>(*this)) {
+ HTMLVideoElement& asVideo = downcast<HTMLVideoElement>(*this);
+ document().page()->chrome().client().setUpVideoControlsManager(asVideo);
+ }
+
</ins><span class="cx"> // 4.8.10.9. Playing the media resource
</span><span class="cx"> if (!m_player || m_networkState == NETWORK_EMPTY)
</span><span class="cx"> scheduleDelayedAction(LoadMediaResource);
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/page/ChromeClient.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -341,6 +341,7 @@
</span><span class="cx"> virtual bool supportsVideoFullscreen(HTMLMediaElementEnums::VideoFullscreenMode) { return false; }
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> virtual void enterVideoFullscreenForVideoElement(HTMLVideoElement&, HTMLMediaElementEnums::VideoFullscreenMode) { }
</span><ins>+ virtual void setUpVideoControlsManager(HTMLVideoElement&) { }
</ins><span class="cx"> #endif
</span><span class="cx"> virtual void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) { }
</span><span class="cx"> virtual bool requiresFullscreenForVideoPlayback() { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.cpp        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</span><ins>+SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))
</ins><span class="cx">
</span><span class="cx"> SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreMedia, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, CFStringRef)
</span><span class="cx"> SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreMedia, kCMTextMarkupAlignmentType_End, CFStringRef)
</span><span class="lines">@@ -111,7 +112,6 @@
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMaximum, CMTime, (CMTime time1, CMTime time2), (time1, time2))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeMinimum, CMTime, (CMTime time1, CMTime time2), (time1, time2))
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time))
</span><del>-SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))
</del><span class="cx"> SOFT_LINK_FUNCTION_FOR_SOURCE(WebCore, CoreMedia, CMTimeSubtract, CMTime, (CMTime minuend, CMTime subtrahend), (minuend, subtrahend))
</span><span class="cx">
</span><span class="cx"> SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, CoreMedia, kCMTimeIndefinite, CMTime)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfCoreMediaSoftLinkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/platform/cf/CoreMediaSoftLink.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx"> #define CMTimeMakeWithSeconds softLink_CoreMedia_CMTimeMakeWithSeconds
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range))
</span><span class="cx"> #define CMTimeRangeGetEnd softLink_CoreMedia_CMTimeRangeGetEnd
</span><ins>+SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))
+#define CMTimeRangeMake softLink_CoreMedia_CMTimeRangeMake
</ins><span class="cx">
</span><span class="cx"> SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, CoreMedia, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms, CFStringRef)
</span><span class="cx"> #define kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms get_CoreMedia_kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms()
</span><span class="lines">@@ -187,8 +189,6 @@
</span><span class="cx"> #define CMTimeMinimum softLink_CoreMedia_CMTimeMinimum
</span><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time))
</span><span class="cx"> #define CMTimeRangeContainsTime softLink_CoreMedia_CMTimeRangeContainsTime
</span><del>-SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeRangeMake, CMTimeRange, (CMTime start, CMTime duration), (start, duration))
-#define CMTimeRangeMake softLink_CoreMedia_CMTimeRangeMake
</del><span class="cx"> SOFT_LINK_FUNCTION_FOR_HEADER(WebCore, CoreMedia, CMTimeSubtract, CMTime, (CMTime minuend, CMTime subtrahend), (minuend, subtrahend))
</span><span class="cx"> #define CMTimeSubtract softLink_CoreMedia_CMTimeSubtract
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> OBJC_CLASS NSWindow;
</span><ins>+OBJC_CLASS WebPlaybackControlsManager;
</ins><span class="cx">
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> OBJC_CLASS WebVideoFullscreenInterfaceMacObjC;
</span><span class="lines">@@ -61,12 +62,12 @@
</span><span class="cx"> WEBCORE_EXPORT void setWebVideoFullscreenChangeObserver(WebVideoFullscreenChangeObserver*);
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void resetMediaState() override { }
</span><del>- WEBCORE_EXPORT void setDuration(double) override { }
- WEBCORE_EXPORT void setCurrentTime(double /*currentTime*/, double /*anchorTime*/) override { }
</del><ins>+ WEBCORE_EXPORT void setDuration(double) override;
+ WEBCORE_EXPORT void setCurrentTime(double /*currentTime*/, double /*anchorTime*/) override;
</ins><span class="cx"> WEBCORE_EXPORT void setBufferedTime(double) override { }
</span><del>- WEBCORE_EXPORT void setRate(bool /*isPlaying*/, float /*playbackRate*/) override { }
</del><ins>+ WEBCORE_EXPORT void setRate(bool /*isPlaying*/, float /*playbackRate*/) override;
</ins><span class="cx"> WEBCORE_EXPORT void setVideoDimensions(bool /*hasVideo*/, float /*width*/, float /*height*/) override { }
</span><del>- WEBCORE_EXPORT void setSeekableRanges(const TimeRanges&) override { }
</del><ins>+ WEBCORE_EXPORT void setSeekableRanges(const TimeRanges&) override;
</ins><span class="cx"> WEBCORE_EXPORT void setCanPlayFastReverse(bool) override { }
</span><span class="cx"> WEBCORE_EXPORT void setAudioMediaSelectionOptions(const Vector<WTF::String>& /*options*/, uint64_t /*selectedIndex*/) override { }
</span><span class="cx"> WEBCORE_EXPORT void setLegibleMediaSelectionOptions(const Vector<WTF::String>& /*options*/, uint64_t /*selectedIndex*/) override { }
</span><span class="lines">@@ -80,6 +81,7 @@
</span><span class="cx"> WEBCORE_EXPORT void invalidate();
</span><span class="cx"> WEBCORE_EXPORT void requestHideAndExitFullscreen() { }
</span><span class="cx"> WEBCORE_EXPORT void preparedToReturnToInline(bool visible, const IntRect& inlineRect, NSWindow *parentWindow);
</span><ins>+ WEBCORE_EXPORT void ensureControlsManager();
</ins><span class="cx">
</span><span class="cx"> HTMLMediaElementEnums::VideoFullscreenMode mode() const { return m_mode; }
</span><span class="cx"> bool hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const { return m_mode & mode; }
</span><span class="lines">@@ -90,6 +92,8 @@
</span><span class="cx"> WEBCORE_EXPORT bool mayAutomaticallyShowVideoPictureInPicture() const { return false; }
</span><span class="cx"> void applicationDidBecomeActive() { }
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT WebPlaybackControlsManager *playBackControlsManager();
+
</ins><span class="cx"> private:
</span><span class="cx"> WebVideoFullscreenModel* m_videoFullscreenModel { nullptr };
</span><span class="cx"> WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver { nullptr };
</span><span class="lines">@@ -98,6 +102,7 @@
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> RetainPtr<WebVideoFullscreenInterfaceMacObjC> m_webVideoFullscreenInterfaceObjC;
</span><span class="cx"> #endif
</span><ins>+ RetainPtr<WebPlaybackControlsManager> m_playbackControlsManager;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebVideoFullscreenInterfaceMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -28,14 +28,112 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
</span><span class="cx">
</span><ins>+#import "AVKitSPI.h"
+#import "CoreMediaSoftLink.h"
</ins><span class="cx"> #import "IntRect.h"
</span><ins>+#import "MediaTimeAVFoundation.h"
+#import "TimeRanges.h"
</ins><span class="cx"> #import "WebVideoFullscreenChangeObserver.h"
</span><span class="cx"> #import "WebVideoFullscreenModel.h"
</span><ins>+#import <AVFoundation/AVTime.h>
</ins><span class="cx">
</span><ins>+#import "SoftLinking.h"
+
+SOFT_LINK_FRAMEWORK(AVKit)
+SOFT_LINK_CLASS(AVKit, AVValueTiming)
+
</ins><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> #include <WebKitAdditions/WebVideoFullscreenInterfaceMacAdditions.mm>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+using namespace WebCore;
+
+@interface WebPlaybackControlsManager : NSObject {
+@private
+ WebCore::WebVideoFullscreenInterfaceMac* _webVideoFullscreenInterfaceMac;
+}
+
+@property (readwrite) NSTimeInterval contentDuration;
+@property (nonatomic, retain, readwrite) AVValueTiming *timing;
+@property NSTimeInterval seekToTime;
+@property (nonatomic, retain, readwrite) NSArray *seekableTimeRanges;
+@property (readwrite) BOOL hasEnabledAudio;
+@property (readwrite) BOOL hasEnabledVideo;
+
+@property (nonatomic) float rate;
+
+- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac;
+
+@end
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebPlaybackControlsControllerAdditions.mm>
+#endif
+
+@implementation WebPlaybackControlsManager
+
+- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac
+{
+ if (!(self = [super init]))
+ return nil;
+
+ _webVideoFullscreenInterfaceMac = webVideoFullscreenInterfaceMac;
+
+ return self;
+}
+
+- (BOOL)isSeeking
+{
+ return NO;
+}
+
+- (void)seekToTime:(NSTimeInterval)time toleranceBefore:(NSTimeInterval)toleranceBefore toleranceAfter:(NSTimeInterval)toleranceAfter
+{
+ UNUSED_PARAM(toleranceBefore);
+ UNUSED_PARAM(toleranceAfter);
+ _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->seekToTime(time);
+}
+
+- (NSArray *)audioMediaSelectionOptions
+{
+ return @[];
+}
+
+- (AVMediaSelectionOption *)currentAudioMediaSelectionOption
+{
+ return nil;
+}
+
+- (void)setCurrentAudioMediaSelectionOption:(AVMediaSelectionOption *)audioMediaSelectionOption
+{
+ UNUSED_PARAM(audioMediaSelectionOption);
+}
+
+- (NSArray *)legibleMediaSelectionOptions
+{
+ return @[];
+}
+
+- (AVMediaSelectionOption *)currentLegibleMediaSelectionOption
+{
+ return nil;
+}
+
+- (void)setCurrentLegibleMediaSelectionOption:(AVMediaSelectionOption *)legibleMediaSelectionOption
+{
+ UNUSED_PARAM(legibleMediaSelectionOption);
+}
+
+- (void)cancelThumbnailAndAudioAmplitudeSampleGeneration
+{
+}
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebPlaybackControlsControllerThumbnailAdditions.mm>
+#endif
+
+@end
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac()
</span><span class="lines">@@ -74,6 +172,66 @@
</span><span class="cx"> m_videoFullscreenModel->fullscreenModeChanged(m_mode);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebVideoFullscreenInterfaceMac::setDuration(double duration)
+{
+ WebPlaybackControlsManager* controlsManager = playBackControlsManager();
+
+ controlsManager.contentDuration = duration;
+
+ // FIXME: We take this as an indication that playback is ready, but that is not necessarily true.
+ controlsManager.hasEnabledAudio = YES;
+ controlsManager.hasEnabledVideo = YES;
+}
+
+void WebVideoFullscreenInterfaceMac::setCurrentTime(double currentTime, double anchorTime)
+{
+ WebPlaybackControlsManager* controlsManager = playBackControlsManager();
+
+ NSTimeInterval anchorTimeStamp = ![controlsManager rate] ? NAN : anchorTime;
+ AVValueTiming *timing = [getAVValueTimingClass() valueTimingWithAnchorValue:currentTime
+ anchorTimeStamp:anchorTimeStamp rate:0];
+
+ [controlsManager setTiming:timing];
+}
+
+void WebVideoFullscreenInterfaceMac::setRate(bool isPlaying, float playbackRate)
+{
+ WebPlaybackControlsManager* controlsManager = playBackControlsManager();
+
+ [controlsManager setRate:isPlaying ? playbackRate : 0.];
+}
+
+void WebVideoFullscreenInterfaceMac::setSeekableRanges(const TimeRanges& timeRanges)
+{
+ WebPlaybackControlsManager* controlsManager = playBackControlsManager();
+
+ RetainPtr<NSMutableArray> seekableRanges = adoptNS([[NSMutableArray alloc] init]);
+
+ for (unsigned i = 0; i < timeRanges.length(); i++) {
+ const PlatformTimeRanges& ranges = timeRanges.ranges();
+ CMTimeRange range = CMTimeRangeMake(toCMTime(ranges.start(i)), toCMTime(ranges.end(i)));
+ [seekableRanges addObject:[NSValue valueWithCMTimeRange:range]];
+ }
+
+ [controlsManager setSeekableTimeRanges:seekableRanges.get()];
+}
+
+void WebVideoFullscreenInterfaceMac::ensureControlsManager()
+{
+ playBackControlsManager();
+}
+
+WebPlaybackControlsManager *WebVideoFullscreenInterfaceMac::playBackControlsManager()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ if (!m_playbackControlsManager)
+ m_playbackControlsManager = adoptNS([[WebPlaybackControlsManager alloc] initWithWebVideoFullscreenInterfaceMac:this]);
+ return m_playbackControlsManager.get();
+#else
+ return nil;
+#endif
+}
+
</ins><span class="cx"> #if !USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView&, const IntRect&, NSWindow *, HTMLMediaElementEnums::VideoFullscreenMode, bool)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaAVKitSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/AVKitSPI.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/AVKitSPI.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebCore/platform/spi/cocoa/AVKitSPI.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -26,6 +26,22 @@
</span><span class="cx"> #import "SoftLinking.h"
</span><span class="cx"> #import <objc/runtime.h>
</span><span class="cx">
</span><ins>+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AVKit/AVValueTiming.h>
+
+#else
+
+@interface AVValueTiming : NSObject <NSCoding, NSCopying, NSMutableCopying>
+@end
+
+@interface AVValueTiming ()
++ (AVValueTiming *)valueTimingWithAnchorValue:(double)anchorValue anchorTimeStamp:(NSTimeInterval)timeStamp rate:(double)rate;
+@property (NS_NONATOMIC_IOSONLY, readonly) double currentValue;
+@end
+
+#endif // USE(APPLE_INTERNAL_SDK)
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #import <AVKit/AVKit.h>
</span><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="lines">@@ -101,15 +117,6 @@
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> #endif // USE(APPLE_INTERNAL_SDK)
</span><del>-
-@interface AVValueTiming : NSObject <NSCoding, NSCopying, NSMutableCopying>
-@end
-
-@interface AVValueTiming ()
-+ (AVValueTiming *)valueTimingWithAnchorValue:(double)anchorValue anchorTimeStamp:(NSTimeInterval)timeStamp rate:(double)rate;
-@property (NS_NONATOMIC_IOSONLY, readonly) double currentValue;
-@end
-
</del><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/ChangeLog        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-02-26 Beth Dakin <bdakin@apple.com>
+
+ Add support for playbackControlsManager
+ https://bugs.webkit.org/show_bug.cgi?id=154742
+ -and corresponding-
+ rdar://problem/23833753
+
+ Reviewed by Jer Noble.
+
+ WebVideoFullscreenManagerProxy ensures the model and interface for the
+ UIProcess side of the playbackControlsManager. It also caches the
+ m_controlsManagerContextId so that it can return the
+ controlsManagerInterface.
+ * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
+ * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
+ * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
+ (WebKit::WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID):
+ (WebKit::WebVideoFullscreenManagerProxy::controlsManagerInterface):
+
+ Pipe isPlayingMediaDidChange() to WebViewImpl, and use that information to
+ update WebViewImplAdditions.
+ * UIProcess/Cocoa/WebViewImpl.h:
+ * UIProcess/Cocoa/WebViewImpl.mm:
+ (WebKit::WebViewImpl::isPlayingMediaDidChange):
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::isPlayingMediaDidChange):
+ (WebKit::WebPageProxy::isPlayingVideoWithAudio):
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::isPlayingAudio):
+ * UIProcess/mac/PageClientImpl.h:
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::isPlayingMediaDidChange):
+
+ Pipe setUpVideoControlsManager to the WebVideoFullscreenManager.
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::setUpVideoControlsManager):
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+
+ Ensure the model an interface for the playbackControlsManager on the
+ WebProcess side and pass the message to the UIProcess to do the same.
+ * WebProcess/cocoa/WebVideoFullscreenManager.h:
+ * WebProcess/cocoa/WebVideoFullscreenManager.mm:
+ (WebKit::WebVideoFullscreenManager::setUpVideoControlsManager):
+
</ins><span class="cx"> 2016-02-26 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> WKWebsiteDataStore/WKWebsiteDataRecord needs to provide size information about each type of data
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -119,6 +119,8 @@
</span><span class="cx"> void applicationDidBecomeActive();
</span><span class="cx"> bool isVisible() const;
</span><span class="cx">
</span><ins>+ PlatformWebVideoFullscreenInterface& controlsManagerInterface();
+
</ins><span class="cx"> private:
</span><span class="cx"> friend class WebVideoFullscreenModelContext;
</span><span class="cx">
</span><span class="lines">@@ -133,6 +135,7 @@
</span><span class="cx">
</span><span class="cx"> // Messages from WebVideoFullscreenManager
</span><span class="cx"> void setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect& initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture);
</span><ins>+ void setUpVideoControlsManagerWithID(uint64_t contextId);
</ins><span class="cx"> void resetMediaState(uint64_t contextId);
</span><span class="cx"> void setCurrentTime(uint64_t contextId, double currentTime, double hostTime);
</span><span class="cx"> void setBufferedTime(uint64_t contextId, double bufferedTime);
</span><span class="lines">@@ -175,6 +178,7 @@
</span><span class="cx">
</span><span class="cx"> WebPageProxy* m_page;
</span><span class="cx"> HashMap<uint64_t, ModelInterfaceTuple> m_contextMap;
</span><ins>+ uint64_t m_controlsManagerContextId { 0 };
</ins><span class="cx">
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -39,5 +39,6 @@
</span><span class="cx"> ExitFullscreen(uint64_t contextId, WebCore::IntRect finalRect)
</span><span class="cx"> CleanupFullscreen(uint64_t contextId)
</span><span class="cx"> PreparedToReturnToInline(uint64_t contextId, bool visible, WebCore::IntRect inlineRect)
</span><ins>+ SetUpVideoControlsManagerWithID(uint64_t contextId)
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebVideoFullscreenManagerProxymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -374,6 +374,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebVideoFullscreenManagerProxy::setUpVideoControlsManagerWithID(uint64_t contextId)
+{
+ RefPtr<WebVideoFullscreenModelContext> model;
+ RefPtr<PlatformWebVideoFullscreenInterface> interface;
+
+ std::tie(model, interface) = ensureModelAndInterface(contextId);
+ m_controlsManagerContextId = contextId;
+ interface->ensureControlsManager();
+}
+
</ins><span class="cx"> void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId)
</span><span class="cx"> {
</span><span class="cx"> ensureInterface(contextId).resetMediaState();
</span><span class="lines">@@ -615,6 +625,11 @@
</span><span class="cx"> return m_page->isViewVisible() && m_page->isInWindow();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PlatformWebVideoFullscreenInterface& WebVideoFullscreenManagerProxy::controlsManagerInterface()
+{
+ return ensureInterface(m_controlsManagerContextId);
+}
+
</ins><span class="cx"> void WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline(uint64_t contextId)
</span><span class="cx"> {
</span><span class="cx"> bool isViewVisible = m_page->isViewVisible();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -324,6 +324,7 @@
</span><span class="cx"> void completeImmediateActionAnimation();
</span><span class="cx"> void didChangeContentSize(CGSize);
</span><span class="cx"> void didHandleAcceptedCandidate();
</span><ins>+ void isPlayingMediaDidChange();
</ins><span class="cx">
</span><span class="cx"> void setIgnoresNonWheelEvents(bool);
</span><span class="cx"> bool ignoresNonWheelEvents() const { return m_ignoresNonWheelEvents; }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -2371,6 +2371,13 @@
</span><span class="cx"> m_isHandlingAcceptedCandidate = false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebViewImpl::isPlayingMediaDidChange()
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
+ updateWebViewImplAdditions();
+#endif
+}
+
</ins><span class="cx"> void WebViewImpl::setIgnoresNonWheelEvents(bool ignoresNonWheelEvents)
</span><span class="cx"> {
</span><span class="cx"> if (m_ignoresNonWheelEvents == ignoresNonWheelEvents)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -350,6 +350,8 @@
</span><span class="cx"> virtual void* immediateActionAnimationControllerForHitTestResult(RefPtr<API::HitTestResult>, uint64_t, RefPtr<API::Object>) = 0;
</span><span class="cx">
</span><span class="cx"> virtual void didHandleAcceptedCandidate() = 0;
</span><ins>+
+ virtual void isPlayingMediaDidChange() = 0;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -5985,9 +5985,17 @@
</span><span class="cx"> if ((oldState & MediaProducer::IsPlayingAudio) == (m_mediaState & MediaProducer::IsPlayingAudio))
</span><span class="cx"> return;
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
+ m_pageClient.isPlayingMediaDidChange();
+#endif
</ins><span class="cx"> m_uiClient->isPlayingAudioDidChange(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool WebPageProxy::isPlayingVideoWithAudio() const
+{
+ return m_mediaState & MediaProducer::IsPlayingAudio && m_mediaState & MediaProducer::IsPlayingVideo;
+}
+
</ins><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> void WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange(bool state)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -1011,6 +1011,8 @@
</span><span class="cx"> bool isPlayingAudio() const { return !!(m_mediaState & WebCore::MediaProducer::IsPlayingAudio); }
</span><span class="cx"> void isPlayingMediaDidChange(WebCore::MediaProducer::MediaStateFlags, uint64_t);
</span><span class="cx">
</span><ins>+ bool isPlayingVideoWithAudio() const;
+
</ins><span class="cx"> #if ENABLE(MEDIA_SESSION)
</span><span class="cx"> void hasMediaSessionWithActiveMediaElementsDidChange(bool);
</span><span class="cx"> void mediaSessionMetadataDidChange(const WebCore::MediaSessionMetadata&);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -214,6 +214,8 @@
</span><span class="cx">
</span><span class="cx"> virtual void didHandleAcceptedCandidate() override;
</span><span class="cx">
</span><ins>+ void isPlayingMediaDidChange() override;
+
</ins><span class="cx"> virtual void showPlatformContextMenu(NSMenu *, WebCore::IntPoint) override;
</span><span class="cx">
</span><span class="cx"> virtual void didChangeBackgroundColor() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -794,6 +794,11 @@
</span><span class="cx"> m_impl->didHandleAcceptedCandidate();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PageClientImpl::isPlayingMediaDidChange()
+{
+ m_impl->isPlayingMediaDidChange();
+}
+
</ins><span class="cx"> void PageClientImpl::showPlatformContextMenu(NSMenu *menu, IntPoint location)
</span><span class="cx"> {
</span><span class="cx"> [menu popUpMenuPositioningItem:nil atLocation:location inView:m_view];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -855,6 +855,11 @@
</span><span class="cx"> return m_page->videoFullscreenManager()->supportsVideoFullscreen(mode);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebChromeClient::setUpVideoControlsManager(WebCore::HTMLVideoElement& videoElement)
+{
+ m_page->videoFullscreenManager()->setUpVideoControlsManager(videoElement);
+}
+
</ins><span class="cx"> void WebChromeClient::enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement& videoElement, WebCore::HTMLMediaElementEnums::VideoFullscreenMode mode)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(mode != HTMLMediaElementEnums::VideoFullscreenModeNone);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -244,6 +244,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
</span><span class="cx"> virtual bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
</span><ins>+ virtual void setUpVideoControlsManager(WebCore::HTMLVideoElement&) override;
</ins><span class="cx"> virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
</span><span class="cx"> virtual void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) override;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -116,6 +116,7 @@
</span><span class="cx"> bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) const;
</span><span class="cx"> void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode);
</span><span class="cx"> void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&);
</span><ins>+ void setUpVideoControlsManager(WebCore::HTMLVideoElement&);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> friend class WebVideoFullscreenInterfaceContext;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebVideoFullscreenManagermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm (197203 => 197204)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm        2016-02-26 22:26:03 UTC (rev 197203)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm        2016-02-26 22:28:23 UTC (rev 197204)
</span><span class="lines">@@ -279,6 +279,19 @@
</span><span class="cx"> m_page->send(Messages::WebVideoFullscreenManagerProxy::ExitFullscreen(contextId, clientRectForElement(&videoElement)), m_page->pageID());
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebVideoFullscreenManager::setUpVideoControlsManager(WebCore::HTMLVideoElement& videoElement)
+{
+ auto addResult = m_videoElements.ensure(&videoElement, [&] { return nextContextId(); });
+ auto contextId = addResult.iterator->value;
+
+ RefPtr<WebVideoFullscreenModelVideoElement> model;
+ RefPtr<WebVideoFullscreenInterfaceContext> interface;
+ std::tie(model, interface) = ensureModelAndInterface(contextId);
+ model->setVideoElement(&videoElement);
+
+ m_page->send(Messages::WebVideoFullscreenManagerProxy::SetUpVideoControlsManagerWithID(contextId), m_page->pageID());
+}
+
</ins><span class="cx"> #pragma mark Interface to WebVideoFullscreenInterfaceContext:
</span><span class="cx">
</span><span class="cx"> void WebVideoFullscreenManager::resetMediaState(uint64_t contextId)
</span></span></pre>
</div>
</div>
</body>
</html>