https://bugs.webkit.org/show_bug.cgi?id=130480
Reviewed by Jer Noble.
* html/HTMLMediaElement.h: Add mediaPlayerHandlePlaybackCommand.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::handlePlaybackCommand): New.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Send Play and Pause commands when
playing to an external device.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165928
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-19 Eric Carlson <eric.carlson@apple.com>
+
+ Allow media engine to update HTMLMediaElement state when playing to external device
+ https://bugs.webkit.org/show_bug.cgi?id=130480
+
+ Reviewed by Jer Noble.
+
+ * html/HTMLMediaElement.h: Add mediaPlayerHandlePlaybackCommand.
+
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::handlePlaybackCommand): New.
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
+
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Send Play and Pause commands when
+ playing to an external device.
+
2014-03-19 Dirk Schulze <krit@webkit.org>
Implement isPointInPath and isPointInStroke with Path2D argument
#endif
virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
+ virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
void loadTimerFired(Timer<HTMLMediaElement>&);
void progressEventTimerFired(Timer<HTMLMediaElement>&);
return m_mediaPlayerClient->mediaPlayerShouldWaitForResponseToAuthenticationChallenge(challenge);
}
+
+void MediaPlayer::handlePlaybackCommand(MediaSession::RemoteControlCommandType command)
+{
+ if (!m_mediaPlayerClient)
+ return;
+
+ m_mediaPlayerClient->mediaPlayerHandlePlaybackCommand(command);
+}
void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine)
{
#include "IntRect.h"
#include "URL.h"
#include "LayoutRect.h"
+#include "MediaSession.h"
#include "NativeImagePtr.h"
#include "PlatformLayer.h"
#include "Timer.h"
#endif
virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
+ virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType) { }
};
class MediaPlayerSupportsTypeClient {
#endif
bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
+ void handlePlaybackCommand(MediaSession::RemoteControlCommandType);
private:
MediaPlayer(MediaPlayerClient*);
void MediaPlayerPrivateAVFoundation::rateChanged()
{
+#if ENABLE(IOS_AIRPLAY)
+ if (isCurrentPlaybackTargetWireless())
+ m_player->handlePlaybackCommand(rate() ? MediaSession::PlayCommand : MediaSession::PauseCommand);
+#endif
+
m_player->rateChanged();
}