Skip to content
Permalink
Browse files
WebKitPlaybackSessionModelMediaElement should initialize the interfac…
…e 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):

Canonical link: https://commits.webkit.org/175108@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Apr 25, 2016
1 parent 733538a commit 1b1357eee53ef8ee816c0aa76f3173dad86a23df
Showing with 27 additions and 5 deletions.
  1. +12 −0 Source/WebCore/ChangeLog
  2. +15 −5 Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm
@@ -1,3 +1,15 @@
2016-04-25 Jer Noble <jer.noble@apple.com>

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 <simon.fraser@apple.com>

Toggling animation-play-state can re-start a finished animation
@@ -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)

0 comments on commit 1b1357e

Please sign in to comment.