Title: [200052] trunk/Source/WebCore
Revision
200052
Author
[email protected]
Date
2016-04-25 14:58:11 -0700 (Mon, 25 Apr 2016)

Log Message

WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
https://bugs.webkit.org/show_bug.cgi?id=156996

Reviewed by Beth Dakin.

Notify the interface of the current values in the media element when the model is given an interface.

* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200051 => 200052)


--- trunk/Source/WebCore/ChangeLog	2016-04-25 21:38:19 UTC (rev 200051)
+++ trunk/Source/WebCore/ChangeLog	2016-04-25 21:58:11 UTC (rev 200052)
@@ -1,3 +1,15 @@
+2016-04-25  Jer Noble  <[email protected]>
+
+        WebKitPlaybackSessionModelMediaElement should initialize the interface added by setWebPlaybackSessionInterface() with initial data
+        https://bugs.webkit.org/show_bug.cgi?id=156996
+
+        Reviewed by Beth Dakin.
+
+        Notify the interface of the current values in the media element when the model is given an interface.
+
+        * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
+        (WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
+
 2016-04-25  Simon Fraser  <[email protected]>
 
         Toggling animation-play-state can re-start a finished animation

Modified: trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm (200051 => 200052)


--- trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2016-04-25 21:38:19 UTC (rev 200051)
+++ trunk/Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm	2016-04-25 21:58:11 UTC (rev 200052)
@@ -65,11 +65,21 @@
 
     m_playbackSessionInterface = interface;
 
-    if (m_playbackSessionInterface) {
-        m_playbackSessionInterface->resetMediaState();
-        if (m_mediaElement)
-            m_playbackSessionInterface->setWirelessVideoPlaybackDisabled(m_mediaElement->mediaSession().wirelessVideoPlaybackDisabled(*m_mediaElement));
-    }
+    if (!m_playbackSessionInterface)
+        return;
+
+    m_playbackSessionInterface->resetMediaState();
+    if (!m_mediaElement)
+        return;
+
+    m_playbackSessionInterface->setDuration(m_mediaElement->duration());
+    m_playbackSessionInterface->setCurrentTime(m_mediaElement->currentTime(), [[NSProcessInfo processInfo] systemUptime]);
+    m_playbackSessionInterface->setBufferedTime(m_mediaElement->maxBufferedTime());
+    m_playbackSessionInterface->setRate(!m_mediaElement->paused(), m_mediaElement->playbackRate());
+    m_playbackSessionInterface->setSeekableRanges(*m_mediaElement->seekable());
+    m_playbackSessionInterface->setCanPlayFastReverse(m_mediaElement->minFastReverseRate() < 0.0);
+    m_playbackSessionInterface->setWirelessVideoPlaybackDisabled(m_mediaElement->mediaSession().wirelessVideoPlaybackDisabled(*m_mediaElement));
+    updateLegibleOptions();
 }
 
 void WebPlaybackSessionModelMediaElement::setMediaElement(HTMLMediaElement* mediaElement)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to