Diff
Modified: branches/safari-602-branch/LayoutTests/ChangeLog (204101 => 204102)
--- branches/safari-602-branch/LayoutTests/ChangeLog 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/LayoutTests/ChangeLog 2016-08-03 21:08:18 UTC (rev 204102)
@@ -1,5 +1,9 @@
2016-08-03 Babak Shafiei <bshaf...@apple.com>
+ Rollout r204068. rdar://problem/27547583
+
+2016-08-03 Babak Shafiei <bshaf...@apple.com>
+
Merge r204074. rdar://problem/25856238
2016-08-02 Myles C. Maxfield <mmaxfi...@apple.com>
Deleted: branches/safari-602-branch/LayoutTests/media/remote-control-command-seek-expected.txt (204101 => 204102)
--- branches/safari-602-branch/LayoutTests/media/remote-control-command-seek-expected.txt 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/LayoutTests/media/remote-control-command-seek-expected.txt 2016-08-03 21:08:18 UTC (rev 204102)
@@ -1,14 +0,0 @@
-Test that the "seekToPlaybackPosition" remote control command works.
-
-
-* set video.src
-EVENT(loadedmetadata)
-
-* Send a seek command.
-RUN(internals.postRemoteControlCommand('seekToPlaybackPosition', 1.6))
-
-EVENT(timeupdate)
-EXPECTED (video.currentTime.toFixed(1) == '1.6') OK
-
-END OF TEST
-
Deleted: branches/safari-602-branch/LayoutTests/media/remote-control-command-seek.html (204101 => 204102)
--- branches/safari-602-branch/LayoutTests/media/remote-control-command-seek.html 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/LayoutTests/media/remote-control-command-seek.html 2016-08-03 21:08:18 UTC (rev 204102)
@@ -1,44 +0,0 @@
-<html>
- <head>
- <script src=""
- <script src=""
- <script>
-
- function start()
- {
- if (!window.internals) {
- failTest('This test requires window.internals.');
- return;
- }
-
- findMediaElement();
-
- waitForEvent('loadedmetadata', loadedmetadata, false, true, document)
- waitForEvent('timeupdate', seeked)
-
- consoleWrite('* set video.src');
- video.src = "" 'content/test');
- }
-
- function loadedmetadata()
- {
- consoleWrite('<br>* Send a seek command.');
- run("internals.postRemoteControlCommand('seekToPlaybackPosition', 1.6)");
- consoleWrite('');
- }
-
- function seeked()
- {
- testExpected('video.currentTime.toFixed(1)', 1.6);
- consoleWrite("");
- endTest();
- }
-
- </script>
- </head>
-
- <body _onload_="start()">
- <p>Test that the "seekToPlaybackPosition" remote control command works.</p>
- <video controls></video>
- </body>
-</html>
Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/ChangeLog 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog 2016-08-03 21:08:18 UTC (rev 204102)
@@ -1,5 +1,9 @@
2016-08-03 Babak Shafiei <bshaf...@apple.com>
+ Rollout r204068. rdar://problem/27547583
+
+2016-08-03 Babak Shafiei <bshaf...@apple.com>
+
Rollout r204086. rdar://problem/27547583
2016-08-03 Babak Shafiei <bshaf...@apple.com>
Modified: branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -314,8 +314,7 @@
void mayResumePlayback(bool shouldResume) override;
void suspendPlayback() override;
bool canReceiveRemoteControlCommands() const override { return false; }
- void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override { }
- bool supportsSeeking() const override { return false; }
+ void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; }
// EventTarget
Modified: branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp 2016-08-03 21:08:18 UTC (rev 204102)
@@ -6838,7 +6838,7 @@
return m_currentSrc;
}
-void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
+void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
{
LOG(Media, "HTMLMediaElement::didReceiveRemoteControlCommand(%p) - %i", this, static_cast<int>(command));
@@ -6847,7 +6847,6 @@
case PlatformMediaSession::PlayCommand:
play();
break;
- case PlatformMediaSession::StopCommand:
case PlatformMediaSession::PauseCommand:
pause();
break;
@@ -6864,21 +6863,11 @@
case PlatformMediaSession::EndSeekingForwardCommand:
endScanning();
break;
- case PlatformMediaSession::SeekToPlaybackPositionCommand:
- ASSERT(argument);
- if (argument)
- fastSeek(argument->asDouble);
- break;
default:
{ } // Do nothing
}
}
-bool HTMLMediaElement::supportsSeeking() const
-{
- return !isLiveStream();
-}
-
bool HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType type) const
{
if (type == PlatformMediaSession::EnteringBackground) {
Modified: branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -616,7 +616,7 @@
#endif
bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
- void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command, nullptr); }
+ void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
String mediaPlayerSourceApplicationIdentifier() const override;
Vector<String> mediaPlayerPreferredAudioCharacteristics() const override;
@@ -757,8 +757,7 @@
double mediaSessionDuration() const override { return duration(); }
double mediaSessionCurrentTime() const override { return currentTime(); }
bool canReceiveRemoteControlCommands() const override { return true; }
- void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override;
- bool supportsSeeking() const override;
+ void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override;
bool shouldOverrideBackgroundLoadingRestriction() const override;
Modified: branches/safari-602-branch/Source/WebCore/platform/RemoteCommandListener.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/RemoteCommandListener.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/RemoteCommandListener.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -34,8 +34,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
virtual ~RemoteCommandListenerClient() { }
- virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) = 0;
- virtual bool supportsSeeking() const = 0;
+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
};
class RemoteCommandListener {
@@ -44,10 +43,6 @@
RemoteCommandListener(RemoteCommandListenerClient& client) : m_client(client) { }
virtual ~RemoteCommandListener() { }
- virtual void updateSupportedCommands() { }
-
- RemoteCommandListenerClient& client() const { return m_client; }
-
protected:
RemoteCommandListenerClient& m_client;
};
Modified: branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp 2016-08-03 21:08:18 UTC (rev 204102)
@@ -242,16 +242,11 @@
return m_client.canReceiveRemoteControlCommands();
}
-void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
+void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
{
- m_client.didReceiveRemoteControlCommand(command, argument);
+ m_client.didReceiveRemoteControlCommand(command);
}
-bool PlatformMediaSession::supportsSeeking() const
-{
- return m_client.supportsSeeking();
-}
-
void PlatformMediaSession::visibilityChanged()
{
scheduleClientDataBufferingCheck();
Modified: branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -114,10 +114,6 @@
double currentTime() const;
#endif
- typedef union {
- double asDouble;
- } RemoteCommandArgument;
-
enum RemoteControlCommandType {
NoCommand,
PlayCommand,
@@ -128,11 +124,9 @@
EndSeekingBackwardCommand,
BeginSeekingForwardCommand,
EndSeekingForwardCommand,
- SeekToPlaybackPositionCommand,
};
bool canReceiveRemoteControlCommands() const;
- void didReceiveRemoteControlCommand(RemoteControlCommandType, const RemoteCommandArgument* argument = nullptr);
- bool supportsSeeking() const;
+ void didReceiveRemoteControlCommand(RemoteControlCommandType);
enum DisplayType {
Normal,
@@ -208,8 +202,7 @@
#endif
virtual bool canReceiveRemoteControlCommands() const = 0;
- virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) = 0;
- virtual bool supportsSeeking() const = 0;
+ virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
virtual void setShouldBufferData(bool) { }
virtual bool elementIsHidden() const { return false; }
Modified: branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp 2016-08-03 21:08:18 UTC (rev 204102)
@@ -266,13 +266,11 @@
m_sessions.remove(index);
m_sessions.insert(0, &session);
- if (m_remoteCommandListener)
- m_remoteCommandListener->updateSupportedCommands();
LOG(Media, "PlatformMediaSessionManager::setCurrentSession - session moved from index %zu to 0", index);
}
-PlatformMediaSession* PlatformMediaSessionManager::currentSession() const
+PlatformMediaSession* PlatformMediaSessionManager::currentSession()
{
if (!m_sessions.size())
return nullptr;
@@ -346,22 +344,14 @@
}
#endif
-void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
+void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
{
PlatformMediaSession* activeSession = currentSession();
if (!activeSession || !activeSession->canReceiveRemoteControlCommands())
return;
- activeSession->didReceiveRemoteControlCommand(command, argument);
+ activeSession->didReceiveRemoteControlCommand(command);
}
-bool PlatformMediaSessionManager::supportsSeeking() const
-{
- PlatformMediaSession* activeSession = currentSession();
- if (!activeSession)
- return false;
- return activeSession->supportsSeeking();
-}
-
void PlatformMediaSessionManager::systemWillSleep()
{
if (m_interrupted)
Modified: branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -90,7 +90,7 @@
#endif
void setCurrentSession(PlatformMediaSession&);
- PlatformMediaSession* currentSession() const;
+ PlatformMediaSession* currentSession();
PlatformMediaSession* currentSessionMatching(std::function<bool(const PlatformMediaSession&)>);
@@ -112,8 +112,7 @@
void updateSessionState();
// RemoteCommandListenerClient
- WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override;
- WEBCORE_EXPORT bool supportsSeeking() const override;
+ WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
// AudioHardwareListenerClient
void audioHardwareDidBecomeActive() override { }
Modified: branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -46,8 +46,7 @@
protected:
WeakPtr<RemoteCommandListenerIOS> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
- void updateSupportedCommands() override;
-
+
WeakPtrFactory<RemoteCommandListenerIOS> m_weakPtrFactory;
RetainPtr<id> m_playTarget;
RetainPtr<id> m_pauseTarget;
@@ -54,7 +53,6 @@
RetainPtr<id> m_togglePlayPauseTarget;
RetainPtr<id> m_seekForwardTarget;
RetainPtr<id> m_seekBackwardTarget;
- RetainPtr<id> m_seekToTimeTarget;
};
}
Modified: branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm 2016-08-03 21:08:18 UTC (rev 204102)
@@ -36,9 +36,6 @@
SOFT_LINK_FRAMEWORK(MediaPlayer)
SOFT_LINK_CLASS(MediaPlayer, MPRemoteCommandCenter)
SOFT_LINK_CLASS(MediaPlayer, MPSeekCommandEvent)
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
-SOFT_LINK_CLASS(MediaPlayer, MPChangePlaybackPositionCommandEvent)
-#endif
namespace WebCore {
@@ -58,7 +55,7 @@
callOnMainThread([weakThis] {
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand, nullptr);
+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand);
});
return MPRemoteCommandHandlerStatusSuccess;
@@ -68,7 +65,7 @@
callOnMainThread([weakThis] {
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand, nullptr);
+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand);
});
return MPRemoteCommandHandlerStatusSuccess;
@@ -78,7 +75,7 @@
callOnMainThread([weakThis] {
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand, nullptr);
+ weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand);
});
return MPRemoteCommandHandlerStatusSuccess;
@@ -93,7 +90,7 @@
callOnMainThread([weakThis, command] {
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(command, nullptr);
+ weakThis->m_client.didReceiveRemoteControlCommand(command);
});
return MPRemoteCommandHandlerStatusSuccess;
@@ -108,31 +105,11 @@
callOnMainThread([weakThis, command] {
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(command, nullptr);
+ weakThis->m_client.didReceiveRemoteControlCommand(command);
});
return MPRemoteCommandHandlerStatusSuccess;
}];
-
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
- m_seekToTimeTarget = [[center changePlaybackPositionCommand] addTargetWithHandler:^(MPRemoteCommandEvent *event) {
- ASSERT([event isKindOfClass:getMPChangePlaybackPositionCommandEventClass()]);
-
- if (!client.supportsSeeking())
- return MPRemoteCommandHandlerStatusCommandFailed;
-
- MPChangePlaybackPositionCommandEvent* seekEvent = static_cast<MPChangePlaybackPositionCommandEvent *>(event);
- PlatformMediaSession::RemoteCommandArgument argument { [seekEvent positionTime] };
-
- callOnMainThread([weakThis, argument] {
- if (!weakThis)
- return;
- weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand, &argument);
- });
-
- return MPRemoteCommandHandlerStatusSuccess;
- }];
-#endif
}
RemoteCommandListenerIOS::~RemoteCommandListenerIOS()
@@ -143,18 +120,8 @@
[[center togglePlayPauseCommand] removeTarget:m_togglePlayPauseTarget.get()];
[[center seekForwardCommand] removeTarget:m_seekForwardTarget.get()];
[[center seekBackwardCommand] removeTarget:m_seekBackwardTarget.get()];
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
- [[center changePlaybackPositionCommand] removeTarget:m_seekToTimeTarget.get()];
-#endif
}
-void RemoteCommandListenerIOS::updateSupportedCommands()
-{
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
- [[[getMPRemoteCommandCenterClass() sharedCommandCenter] changePlaybackPositionCommand] setEnabled:!!client().supportsSeeking()];
-#endif
}
-}
-
#endif
Modified: branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp 2016-08-03 21:08:18 UTC (rev 204102)
@@ -46,6 +46,5 @@
SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoDuration, CFStringRef);
SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
-SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteOptionPlaybackPosition, CFStringRef);
#endif // USE(MEDIAREMOTE)
Modified: branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -61,7 +61,5 @@
#define kMRMediaRemoteNowPlayingInfoElapsedTime get_MediaRemote_kMRMediaRemoteNowPlayingInfoElapsedTime()
SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
#define kMRMediaRemoteNowPlayingInfoPlaybackRate get_MediaRemote_kMRMediaRemoteNowPlayingInfoPlaybackRate()
-SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteOptionPlaybackPosition, CFStringRef);
-#define kMRMediaRemoteOptionPlaybackPosition get_MediaRemote_kMRMediaRemoteOptionPlaybackPosition()
#endif // USE(MEDIAREMOTE)
Modified: branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -42,8 +42,6 @@
protected:
WeakPtr<RemoteCommandListenerMac> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
- void updateSupportedCommands() override;
-
WeakPtrFactory<RemoteCommandListenerMac> m_weakPtrFactory { this };
void* m_commandHandler { nullptr };
};
Modified: branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm 2016-08-03 21:08:18 UTC (rev 204102)
@@ -40,7 +40,8 @@
return std::make_unique<RemoteCommandListenerMac>(client);
}
-void RemoteCommandListenerMac::updateSupportedCommands()
+RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& client)
+ : RemoteCommandListener(client)
{
#if USE(MEDIAREMOTE)
if (!isMediaRemoteFrameworkAvailable())
@@ -65,32 +66,13 @@
CFArrayAppendValue(commandInfoArray.get(), commandInfo.get());
}
- auto seekCommandInfo = adoptCF(MRMediaRemoteCommandInfoCreate(kCFAllocatorDefault));
- MRMediaRemoteCommandInfoSetCommand(seekCommandInfo.get(), MRMediaRemoteCommandSeekToPlaybackPosition);
- MRMediaRemoteCommandInfoSetEnabled(seekCommandInfo.get(), client().supportsSeeking());
- CFArrayAppendValue(commandInfoArray.get(), seekCommandInfo.get());
-
MRMediaRemoteSetSupportedCommands(commandInfoArray.get(), MRMediaRemoteGetLocalOrigin(), nullptr, nullptr);
-#endif // USE(MEDIAREMOTE)
-}
-RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& client)
- : RemoteCommandListener(client)
-{
-#if USE(MEDIAREMOTE)
- if (!isMediaRemoteFrameworkAvailable())
- return;
-
- updateSupportedCommands();
-
auto weakThis = createWeakPtr();
m_commandHandler = MRMediaRemoteAddAsyncCommandHandlerBlock(^(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef)) {
+ UNUSED_PARAM(options);
- LOG(Media, "RemoteCommandListenerMac::RemoteCommandListenerMac - received command %u", command);
-
PlatformMediaSession::RemoteControlCommandType platformCommand { PlatformMediaSession::NoCommand };
- PlatformMediaSession::RemoteCommandArgument argument { 0 };
- MRMediaRemoteCommandHandlerStatus status = MRMediaRemoteCommandHandlerStatusSuccess;
switch (command) {
case MRMediaRemoteCommandPlay:
@@ -99,9 +81,6 @@
case MRMediaRemoteCommandPause:
platformCommand = PlatformMediaSession::PauseCommand;
break;
- case MRMediaRemoteCommandStop:
- platformCommand = PlatformMediaSession::StopCommand;
- break;
case MRMediaRemoteCommandTogglePlayPause:
platformCommand = PlatformMediaSession::TogglePlayPauseCommand;
break;
@@ -117,32 +96,14 @@
case MRMediaRemoteCommandEndRewind:
platformCommand = PlatformMediaSession::EndSeekingBackwardCommand;
break;
- case MRMediaRemoteCommandSeekToPlaybackPosition: {
- if (!client.supportsSeeking()) {
- status = MRMediaRemoteCommandHandlerStatusCommandFailed;
- break;
- }
-
- CFNumberRef positionRef = static_cast<CFNumberRef>(CFDictionaryGetValue(options, kMRMediaRemoteOptionPlaybackPosition));
- if (!positionRef) {
- status = MRMediaRemoteCommandHandlerStatusCommandFailed;
- break;
- }
-
- CFNumberGetValue(positionRef, kCFNumberDoubleType, &argument.asDouble);
- platformCommand = PlatformMediaSession::SeekToPlaybackPositionCommand;
- break;
- }
default:
- LOG(Media, "RemoteCommandListenerMac::RemoteCommandListenerMac - command %u not supported!", command);
- status = MRMediaRemoteCommandHandlerStatusCommandFailed;
- return;
+ ASSERT_NOT_REACHED();
};
if (!weakThis)
return;
- weakThis->m_client.didReceiveRemoteControlCommand(platformCommand, &argument);
- completion(static_cast<CFArrayRef>(@[@(status)]));
+ weakThis->m_client.didReceiveRemoteControlCommand(platformCommand);
+ completion(static_cast<CFArrayRef>(@[@0]));
});
#endif // USE(MEDIAREMOTE)
}
Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.cpp (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/testing/Internals.cpp 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.cpp 2016-08-03 21:08:18 UTC (rev 204102)
@@ -2861,11 +2861,10 @@
element.mediaSession().addBehaviorRestriction(restrictions);
}
-void Internals::postRemoteControlCommand(const String& commandString, float argument, ExceptionCode& ec)
+void Internals::postRemoteControlCommand(const String& commandString, ExceptionCode& ec)
{
PlatformMediaSession::RemoteControlCommandType command;
- PlatformMediaSession::RemoteCommandArgument parameter { argument };
-
+
if (equalLettersIgnoringASCIICase(commandString, "play"))
command = PlatformMediaSession::PlayCommand;
else if (equalLettersIgnoringASCIICase(commandString, "pause"))
@@ -2882,14 +2881,12 @@
command = PlatformMediaSession::BeginSeekingForwardCommand;
else if (equalLettersIgnoringASCIICase(commandString, "endseekingforward"))
command = PlatformMediaSession::EndSeekingForwardCommand;
- else if (equalLettersIgnoringASCIICase(commandString, "seektoplaybackposition"))
- command = PlatformMediaSession::SeekToPlaybackPositionCommand;
else {
ec = INVALID_ACCESS_ERR;
return;
}
- PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command, ¶meter);
+ PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command);
}
bool Internals::elementIsBlockingDisplaySleep(HTMLMediaElement& element) const
Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.h (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/testing/Internals.h 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.h 2016-08-03 21:08:18 UTC (rev 204102)
@@ -407,7 +407,7 @@
void applicationWillEnterBackground() const;
void setMediaSessionRestrictions(const String& mediaType, const String& restrictions, ExceptionCode&);
void setMediaElementRestrictions(HTMLMediaElement&, const String& restrictions);
- void postRemoteControlCommand(const String&, float argument, ExceptionCode&);
+ void postRemoteControlCommand(const String&, ExceptionCode&);
bool elementIsBlockingDisplaySleep(HTMLMediaElement&) const;
#endif
Modified: branches/safari-602-branch/Source/WebCore/testing/Internals.idl (204101 => 204102)
--- branches/safari-602-branch/Source/WebCore/testing/Internals.idl 2016-08-03 21:08:06 UTC (rev 204101)
+++ branches/safari-602-branch/Source/WebCore/testing/Internals.idl 2016-08-03 21:08:18 UTC (rev 204102)
@@ -402,7 +402,7 @@
[Conditional=VIDEO, RaisesException] void setMediaSessionRestrictions(DOMString mediaType, DOMString restrictions);
[Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
[Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
- [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
+ [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command);
[Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
[Conditional=WIRELESS_PLAYBACK_TARGET, RaisesException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
[Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled);