Title: [272589] trunk/Source/WebCore
Revision
272589
Author
[email protected]
Date
2021-02-09 10:33:24 -0800 (Tue, 09 Feb 2021)

Log Message

[Mac] Connect MediaSession with MediaRemote and NowPlaying
https://bugs.webkit.org/show_bug.cgi?id=221431
<rdar://problem/74000363>

Unreviewed, fix a layout test assert.


* Modules/mediasession/MediaSession.cpp:
(WebCore::platformCommandForMediaSessionAction): Map "skipad" to "nexttrack".
(WebCore::MediaSession::setActionHandler): Don't try to register media session actions
for which there is no platform command.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (272588 => 272589)


--- trunk/Source/WebCore/ChangeLog	2021-02-09 18:20:17 UTC (rev 272588)
+++ trunk/Source/WebCore/ChangeLog	2021-02-09 18:33:24 UTC (rev 272589)
@@ -1,3 +1,16 @@
+2021-02-09  Eric Carlson  <[email protected]>
+
+        [Mac] Connect MediaSession with MediaRemote and NowPlaying
+        https://bugs.webkit.org/show_bug.cgi?id=221431
+        <rdar://problem/74000363>
+
+        Unreviewed, fix a layout test assert.
+
+        * Modules/mediasession/MediaSession.cpp:
+        (WebCore::platformCommandForMediaSessionAction): Map "skipad" to "nexttrack".
+        (WebCore::MediaSession::setActionHandler): Don't try to register media session actions
+        for which there is no platform command.
+
 2021-02-09  Youenn Fablet  <[email protected]>
 
         MediaStream-backed video elements should not compute the mediaType based on track muted states

Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp (272588 => 272589)


--- trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp	2021-02-09 18:20:17 UTC (rev 272588)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp	2021-02-09 18:33:24 UTC (rev 272589)
@@ -58,6 +58,7 @@
             { MediaSessionAction::Nexttrack, PlatformMediaSession::PreviousTrackCommand },
             { MediaSessionAction::Stop, PlatformMediaSession::StopCommand },
             { MediaSessionAction::Seekto, PlatformMediaSession::SeekToPlaybackPositionCommand },
+            { MediaSessionAction::Skipad, PlatformMediaSession::NextTrackCommand },
         };
     }());
 
@@ -116,7 +117,9 @@
     if (handler) {
         ALWAYS_LOG(LOGIDENTIFIER, "adding ", action);
         m_actionHandlers.set(action, handler);
-        PlatformMediaSessionManager::sharedManager().addSupportedCommand(platformCommandForMediaSessionAction(action));
+        auto platformCommand = platformCommandForMediaSessionAction(action);
+        if (platformCommand != PlatformMediaSession::NoCommand)
+            PlatformMediaSessionManager::sharedManager().addSupportedCommand(platformCommand);
     } else {
         if (m_actionHandlers.contains(action)) {
             ALWAYS_LOG(LOGIDENTIFIER, "removing ", action);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to