⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 204068 in webkit


Ignore:
Timestamp:
Aug 2, 2016, 11:15:54 PM (10 years ago)
Author:
bshafiei@apple.com
Message:

Merge r203982. rdar://problem/27547583

Location:
branches/safari-602-branch
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/LayoutTests/ChangeLog

    r204056 r204068  
     12016-08-02  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Merge r203982. rdar://problem/27547583
     4
     5    2016-08-01  Eric Carlson  <eric.carlson@apple.com>
     6
     7            [Mac][iOS] Adopt MediaRemote "seek to playback position"
     8            https://bugs.webkit.org/show_bug.cgi?id=160405
     9            <rdar://problem/27547583>
     10
     11            Reviewed by Dean Jackson.
     12
     13            * media/remote-control-command-seek-expected.txt: Added.
     14            * media/remote-control-command-seek.html: Added.
     15
    1162016-08-02  Ryan Haddad  <ryanhaddad@apple.com>
    217
  • branches/safari-602-branch/Source/WebCore/ChangeLog

    r204015 r204068  
     12016-08-02  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Merge r203982. rdar://problem/27547583
     4
     5    2016-08-01  Eric Carlson  <eric.carlson@apple.com>
     6
     7            [Mac][iOS] Adopt MediaRemote "seek to playback position"
     8            https://bugs.webkit.org/show_bug.cgi?id=160405
     9            <rdar://problem/27547583>
     10
     11            Reviewed by Dean Jackson.
     12
     13            Test: media/remote-control-command-seek.html
     14
     15            * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change.
     16
     17            * html/HTMLMediaElement.cpp:
     18            (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand.
     19            Drive by fix, support Stop command.
     20            (WebCore::HTMLMediaElement::supportsSeeking): New.
     21            * html/HTMLMediaElement.h:
     22
     23            * platform/RemoteCommandListener.h:
     24            (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument.
     25            (WebCore::RemoteCommandListenerClient::supportsSeeking): New.
     26            (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto.
     27            (WebCore::RemoteCommandListener::client): Ditto.
     28
     29            * platform/audio/PlatformMediaSession.cpp:
     30            (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument.
     31            (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client.
     32            * platform/audio/PlatformMediaSession.h:
     33
     34            * platform/audio/PlatformMediaSessionManager.cpp:
     35            (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to
     36            update supported commands.
     37            (WebCore::PlatformMediaSessionManager::currentSession): Make const.
     38            (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument.
     39            (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session.
     40            * platform/audio/PlatformMediaSessionManager.h:
     41
     42            * platform/ios/RemoteCommandListenerIOS.h:
     43            (WebCore::RemoteCommandListenerIOS::createWeakPtr):
     44            * platform/ios/RemoteCommandListenerIOS.mm:
     45            (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand.
     46            (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target.
     47            (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand.
     48
     49            * platform/mac/MediaRemoteSoftLink.cpp:
     50            * platform/mac/MediaRemoteSoftLink.h:
     51
     52            * platform/mac/RemoteCommandListenerMac.h:
     53            * platform/mac/RemoteCommandListenerMac.mm:
     54            (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor.
     55            (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into
     56            updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when
     57            receiving an unsupported command, it happens. Return error when a command isn't supported or
     58            fails.
     59
     60            * testing/Internals.cpp:
     61            (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support
     62            seektoplaybackposition.
     63            * testing/Internals.h:
     64            * testing/Internals.idl:
     65
    1662016-08-01  Babak Shafiei  <bshafiei@apple.com>
    267
  • branches/safari-602-branch/Source/WebCore/Modules/webaudio/AudioContext.h

    r201013 r204068  
    315315    void suspendPlayback() override;
    316316    bool canReceiveRemoteControlCommands() const override { return false; }
    317     void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override { }
     317    void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override { }
     318    bool supportsSeeking() const override { return false; }
    318319    bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override { return false; }
    319320
  • branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.cpp

    r203969 r204068  
    68396839}
    68406840
    6841 void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
     6841void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
    68426842{
    68436843    LOG(Media, "HTMLMediaElement::didReceiveRemoteControlCommand(%p) - %i", this, static_cast<int>(command));
     
    68486848        play();
    68496849        break;
     6850    case PlatformMediaSession::StopCommand:
    68506851    case PlatformMediaSession::PauseCommand:
    68516852        pause();
     
    68646865        endScanning();
    68656866        break;
     6867    case PlatformMediaSession::SeekToPlaybackPositionCommand:
     6868        ASSERT(argument);
     6869        if (argument)
     6870            fastSeek(argument->asDouble);
     6871        break;
    68666872    default:
    68676873        { } // Do nothing
    68686874    }
     6875}
     6876
     6877bool HTMLMediaElement::supportsSeeking() const
     6878{
     6879    return !isLiveStream();
    68696880}
    68706881
  • branches/safari-602-branch/Source/WebCore/html/HTMLMediaElement.h

    r203066 r204068  
    617617
    618618    bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) override;
    619     void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command); }
     619    void mediaPlayerHandlePlaybackCommand(PlatformMediaSession::RemoteControlCommandType command) override { didReceiveRemoteControlCommand(command, nullptr); }
    620620    String mediaPlayerSourceApplicationIdentifier() const override;
    621621    Vector<String> mediaPlayerPreferredAudioCharacteristics() const override;
     
    758758    double mediaSessionCurrentTime() const override { return currentTime(); }
    759759    bool canReceiveRemoteControlCommands() const override { return true; }
    760     void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
     760    void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override;
     761    bool supportsSeeking() const override;
    761762    bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override;
    762763    bool shouldOverrideBackgroundLoadingRestriction() const override;
  • branches/safari-602-branch/Source/WebCore/platform/RemoteCommandListener.h

    r185006 r204068  
    3535public:
    3636    virtual ~RemoteCommandListenerClient() { }
    37     virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
     37    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) = 0;
     38    virtual bool supportsSeeking() const = 0;
    3839};
    3940
     
    4445    virtual ~RemoteCommandListener() { }
    4546
     47    virtual void updateSupportedCommands() { }
     48
     49    RemoteCommandListenerClient& client() const { return m_client; }
     50
    4651protected:
    4752    RemoteCommandListenerClient& m_client;
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.cpp

    r203560 r204068  
    243243}
    244244
    245 void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command)
    246 {
    247     m_client.didReceiveRemoteControlCommand(command);
     245void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
     246{
     247    m_client.didReceiveRemoteControlCommand(command, argument);
     248}
     249
     250bool PlatformMediaSession::supportsSeeking() const
     251{
     252    return m_client.supportsSeeking();
    248253}
    249254
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSession.h

    r202425 r204068  
    115115#endif
    116116
     117    typedef union {
     118        double asDouble;
     119    } RemoteCommandArgument;
     120
    117121    enum RemoteControlCommandType {
    118122        NoCommand,
     
    125129        BeginSeekingForwardCommand,
    126130        EndSeekingForwardCommand,
     131        SeekToPlaybackPositionCommand,
    127132    };
    128133    bool canReceiveRemoteControlCommands() const;
    129     void didReceiveRemoteControlCommand(RemoteControlCommandType);
     134    void didReceiveRemoteControlCommand(RemoteControlCommandType, const RemoteCommandArgument* argument = nullptr);
     135    bool supportsSeeking() const;
    130136
    131137    enum DisplayType {
     
    203209   
    204210    virtual bool canReceiveRemoteControlCommands() const = 0;
    205     virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) = 0;
     211    virtual void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) = 0;
     212    virtual bool supportsSeeking() const = 0;
    206213
    207214    virtual void setShouldBufferData(bool) { }
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp

    r202642 r204068  
    267267    m_sessions.remove(index);
    268268    m_sessions.insert(0, &session);
     269    if (m_remoteCommandListener)
     270        m_remoteCommandListener->updateSupportedCommands();
    269271   
    270272    LOG(Media, "PlatformMediaSessionManager::setCurrentSession - session moved from index %zu to 0", index);
    271273}
    272274   
    273 PlatformMediaSession* PlatformMediaSessionManager::currentSession()
     275PlatformMediaSession* PlatformMediaSessionManager::currentSession() const
    274276{
    275277    if (!m_sessions.size())
     
    345347#endif
    346348
    347 void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
     349void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument)
    348350{
    349351    PlatformMediaSession* activeSession = currentSession();
    350352    if (!activeSession || !activeSession->canReceiveRemoteControlCommands())
    351353        return;
    352     activeSession->didReceiveRemoteControlCommand(command);
     354    activeSession->didReceiveRemoteControlCommand(command, argument);
     355}
     356
     357bool PlatformMediaSessionManager::supportsSeeking() const
     358{
     359    PlatformMediaSession* activeSession = currentSession();
     360    if (!activeSession)
     361        return false;
     362    return activeSession->supportsSeeking();
    353363}
    354364
  • branches/safari-602-branch/Source/WebCore/platform/audio/PlatformMediaSessionManager.h

    r202425 r204068  
    9191
    9292    void setCurrentSession(PlatformMediaSession&);
    93     PlatformMediaSession* currentSession();
     93    PlatformMediaSession* currentSession() const;
    9494
    9595    PlatformMediaSession* currentSessionMatching(std::function<bool(const PlatformMediaSession&)>);
     
    113113
    114114    // RemoteCommandListenerClient
    115     WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override;
     115    WEBCORE_EXPORT void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType, const PlatformMediaSession::RemoteCommandArgument*) override;
     116    WEBCORE_EXPORT bool supportsSeeking() const override;
    116117
    117118    // AudioHardwareListenerClient
  • branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.h

    r166101 r204068  
    4747protected:
    4848    WeakPtr<RemoteCommandListenerIOS> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
    49    
     49    void updateSupportedCommands() override;
     50
    5051    WeakPtrFactory<RemoteCommandListenerIOS> m_weakPtrFactory;
    5152    RetainPtr<id> m_playTarget;
     
    5455    RetainPtr<id> m_seekForwardTarget;
    5556    RetainPtr<id> m_seekBackwardTarget;
     57    RetainPtr<id> m_seekToTimeTarget;
    5658};
    5759
  • branches/safari-602-branch/Source/WebCore/platform/ios/RemoteCommandListenerIOS.mm

    r185006 r204068  
    3737SOFT_LINK_CLASS(MediaPlayer, MPRemoteCommandCenter)
    3838SOFT_LINK_CLASS(MediaPlayer, MPSeekCommandEvent)
     39#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
     40SOFT_LINK_CLASS(MediaPlayer, MPChangePlaybackPositionCommandEvent)
     41#endif
    3942
    4043namespace WebCore {
     
    5659            if (!weakThis)
    5760                return;
    58             weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand);
     61            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PauseCommand, nullptr);
    5962        });
    6063
     
    6669            if (!weakThis)
    6770                return;
    68             weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand);
     71            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::PlayCommand, nullptr);
    6972        });
    7073
     
    7679            if (!weakThis)
    7780                return;
    78             weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand);
     81            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand, nullptr);
    7982        });
    8083
     
    9194            if (!weakThis)
    9295                return;
    93             weakThis->m_client.didReceiveRemoteControlCommand(command);
     96            weakThis->m_client.didReceiveRemoteControlCommand(command, nullptr);
    9497        });
    9598
     
    106109            if (!weakThis)
    107110                return;
    108             weakThis->m_client.didReceiveRemoteControlCommand(command);
     111            weakThis->m_client.didReceiveRemoteControlCommand(command, nullptr);
    109112        });
    110113
    111114        return MPRemoteCommandHandlerStatusSuccess;
    112115    }];
     116
     117#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
     118    m_seekToTimeTarget = [[center changePlaybackPositionCommand] addTargetWithHandler:^(MPRemoteCommandEvent *event) {
     119        ASSERT([event isKindOfClass:getMPChangePlaybackPositionCommandEventClass()]);
     120
     121        if (!client.supportsSeeking())
     122            return MPRemoteCommandHandlerStatusCommandFailed;
     123
     124        MPChangePlaybackPositionCommandEvent* seekEvent = static_cast<MPChangePlaybackPositionCommandEvent *>(event);
     125        PlatformMediaSession::RemoteCommandArgument argument { [seekEvent positionTime] };
     126
     127        callOnMainThread([weakThis, argument] {
     128            if (!weakThis)
     129                return;
     130            weakThis->m_client.didReceiveRemoteControlCommand(PlatformMediaSession::TogglePlayPauseCommand, &argument);
     131        });
     132
     133        return MPRemoteCommandHandlerStatusSuccess;
     134    }];
     135#endif
    113136}
    114137
     
    121144    [[center seekForwardCommand] removeTarget:m_seekForwardTarget.get()];
    122145    [[center seekBackwardCommand] removeTarget:m_seekBackwardTarget.get()];
     146#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
     147    [[center changePlaybackPositionCommand] removeTarget:m_seekToTimeTarget.get()];
     148#endif
     149}
     150
     151void RemoteCommandListenerIOS::updateSupportedCommands()
     152{
     153#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 90100
     154    [[[getMPRemoteCommandCenterClass() sharedCommandCenter] changePlaybackPositionCommand] setEnabled:!!client().supportsSeeking()];
     155#endif
    123156}
    124157
  • branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.cpp

    r202642 r204068  
    4747SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoElapsedTime, CFStringRef);
    4848SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
     49SOFT_LINK_CONSTANT_FOR_SOURCE(WebCore, MediaRemote, kMRMediaRemoteOptionPlaybackPosition, CFStringRef);
    4950
    5051#endif // USE(MEDIAREMOTE)
  • branches/safari-602-branch/Source/WebCore/platform/mac/MediaRemoteSoftLink.h

    r202642 r204068  
    6262SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteNowPlayingInfoPlaybackRate, CFStringRef);
    6363#define kMRMediaRemoteNowPlayingInfoPlaybackRate get_MediaRemote_kMRMediaRemoteNowPlayingInfoPlaybackRate()
     64SOFT_LINK_CONSTANT_FOR_HEADER(WebCore, MediaRemote, kMRMediaRemoteOptionPlaybackPosition, CFStringRef);
     65#define kMRMediaRemoteOptionPlaybackPosition get_MediaRemote_kMRMediaRemoteOptionPlaybackPosition()
    6466
    6567#endif // USE(MEDIAREMOTE)
  • branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.h

    r202642 r204068  
    4343    WeakPtr<RemoteCommandListenerMac> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
    4444
     45    void updateSupportedCommands() override;
     46
    4547    WeakPtrFactory<RemoteCommandListenerMac> m_weakPtrFactory { this };
    4648    void* m_commandHandler { nullptr };
  • branches/safari-602-branch/Source/WebCore/platform/mac/RemoteCommandListenerMac.mm

    r202642 r204068  
    4141}
    4242
    43 RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& client)
    44     : RemoteCommandListener(client)
     43void RemoteCommandListenerMac::updateSupportedCommands()
    4544{
    4645#if USE(MEDIAREMOTE)
     
    6766    }
    6867
     68    auto seekCommandInfo = adoptCF(MRMediaRemoteCommandInfoCreate(kCFAllocatorDefault));
     69    MRMediaRemoteCommandInfoSetCommand(seekCommandInfo.get(), MRMediaRemoteCommandSeekToPlaybackPosition);
     70    MRMediaRemoteCommandInfoSetEnabled(seekCommandInfo.get(), client().supportsSeeking());
     71    CFArrayAppendValue(commandInfoArray.get(), seekCommandInfo.get());
     72
    6973    MRMediaRemoteSetSupportedCommands(commandInfoArray.get(), MRMediaRemoteGetLocalOrigin(), nullptr, nullptr);
     74#endif // USE(MEDIAREMOTE)
     75}
     76
     77RemoteCommandListenerMac::RemoteCommandListenerMac(RemoteCommandListenerClient& client)
     78    : RemoteCommandListener(client)
     79{
     80#if USE(MEDIAREMOTE)
     81    if (!isMediaRemoteFrameworkAvailable())
     82        return;
     83
     84    updateSupportedCommands();
    7085
    7186    auto weakThis = createWeakPtr();
    7287    m_commandHandler = MRMediaRemoteAddAsyncCommandHandlerBlock(^(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef)) {
    73         UNUSED_PARAM(options);
     88
     89        LOG(Media, "RemoteCommandListenerMac::RemoteCommandListenerMac - received command %u", command);
    7490
    7591        PlatformMediaSession::RemoteControlCommandType platformCommand { PlatformMediaSession::NoCommand };
     92        PlatformMediaSession::RemoteCommandArgument argument { 0 };
     93        MRMediaRemoteCommandHandlerStatus status = MRMediaRemoteCommandHandlerStatusSuccess;
    7694
    7795        switch (command) {
     
    8199        case MRMediaRemoteCommandPause:
    82100            platformCommand = PlatformMediaSession::PauseCommand;
     101            break;
     102        case MRMediaRemoteCommandStop:
     103            platformCommand = PlatformMediaSession::StopCommand;
    83104            break;
    84105        case MRMediaRemoteCommandTogglePlayPause:
     
    97118            platformCommand = PlatformMediaSession::EndSeekingBackwardCommand;
    98119            break;
     120        case MRMediaRemoteCommandSeekToPlaybackPosition: {
     121            if (!client.supportsSeeking()) {
     122                status = MRMediaRemoteCommandHandlerStatusCommandFailed;
     123                break;
     124            }
     125
     126            CFNumberRef positionRef = static_cast<CFNumberRef>(CFDictionaryGetValue(options, kMRMediaRemoteOptionPlaybackPosition));
     127            if (!positionRef) {
     128                status = MRMediaRemoteCommandHandlerStatusCommandFailed;
     129                break;
     130            }
     131
     132            CFNumberGetValue(positionRef, kCFNumberDoubleType, &argument.asDouble);
     133            platformCommand = PlatformMediaSession::SeekToPlaybackPositionCommand;
     134            break;
     135        }
    99136        default:
    100             ASSERT_NOT_REACHED();
     137            LOG(Media, "RemoteCommandListenerMac::RemoteCommandListenerMac - command %u not supported!", command);
     138            status = MRMediaRemoteCommandHandlerStatusCommandFailed;
     139            return;
    101140        };
    102141
    103142        if (!weakThis)
    104143            return;
    105         weakThis->m_client.didReceiveRemoteControlCommand(platformCommand);
    106         completion(static_cast<CFArrayRef>(@[@0]));
     144        weakThis->m_client.didReceiveRemoteControlCommand(platformCommand, &argument);
     145        completion(static_cast<CFArrayRef>(@[@(status)]));
    107146    });
    108147#endif // USE(MEDIAREMOTE)
  • branches/safari-602-branch/Source/WebCore/testing/Internals.cpp

    r203560 r204068  
    28622862}
    28632863
    2864 void Internals::postRemoteControlCommand(const String& commandString, ExceptionCode& ec)
     2864void Internals::postRemoteControlCommand(const String& commandString, float argument, ExceptionCode& ec)
    28652865{
    28662866    PlatformMediaSession::RemoteControlCommandType command;
    2867    
     2867    PlatformMediaSession::RemoteCommandArgument parameter { argument };
     2868
    28682869    if (equalLettersIgnoringASCIICase(commandString, "play"))
    28692870        command = PlatformMediaSession::PlayCommand;
     
    28822883    else if (equalLettersIgnoringASCIICase(commandString, "endseekingforward"))
    28832884        command = PlatformMediaSession::EndSeekingForwardCommand;
     2885    else if (equalLettersIgnoringASCIICase(commandString, "seektoplaybackposition"))
     2886        command = PlatformMediaSession::SeekToPlaybackPositionCommand;
    28842887    else {
    28852888        ec = INVALID_ACCESS_ERR;
     
    28872890    }
    28882891   
    2889     PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command);
     2892    PlatformMediaSessionManager::sharedManager().didReceiveRemoteControlCommand(command, &parameter);
    28902893}
    28912894
  • branches/safari-602-branch/Source/WebCore/testing/Internals.h

    r203075 r204068  
    408408    void setMediaSessionRestrictions(const String& mediaType, const String& restrictions, ExceptionCode&);
    409409    void setMediaElementRestrictions(HTMLMediaElement&, const String& restrictions);
    410     void postRemoteControlCommand(const String&, ExceptionCode&);
     410    void postRemoteControlCommand(const String&, float argument, ExceptionCode&);
    411411    bool elementIsBlockingDisplaySleep(HTMLMediaElement&) const;
    412412#endif
  • branches/safari-602-branch/Source/WebCore/testing/Internals.idl

    r203075 r204068  
    403403    [Conditional=VIDEO] void setMediaElementRestrictions(HTMLMediaElement element, DOMString restrictions);
    404404    [Conditional=WEB_AUDIO] void setAudioContextRestrictions(AudioContext context, DOMString restrictions);
    405     [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command);
     405    [Conditional=VIDEO, RaisesException] void postRemoteControlCommand(DOMString command, optional unrestricted float argument = 0);
    406406    [Conditional=WIRELESS_PLAYBACK_TARGET] void setMockMediaPlaybackTargetPickerEnabled(boolean enabled);
    407407    [Conditional=WIRELESS_PLAYBACK_TARGET, RaisesException] void setMockMediaPlaybackTargetPickerState(DOMString deviceName, DOMString deviceState);
Note: See TracChangeset for help on using the changeset viewer.