[webkit-changes] [WebKit/WebKit] 87860a: [Cocoa] Support Now Playing presentation suppression

aestes noreply at github.com
Fri Sep 6 22:21:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 87860a9045503955d1996eca13501ceb7a864436
      https://github.com/WebKit/WebKit/commit/87860a9045503955d1996eca13501ceb7a864436
  Author: Andy Estes <aestes at apple.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

  Changed paths:
    M Source/WebCore/Modules/webaudio/AudioContext.cpp
    M Source/WebCore/PAL/pal/spi/mac/MediaRemoteSPI.h
    M Source/WebCore/html/MediaElementSession.cpp
    M Source/WebCore/platform/NowPlayingManager.cpp
    M Source/WebCore/platform/NowPlayingManager.h
    M Source/WebCore/platform/audio/NowPlayingInfo.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
    M Source/WebCore/platform/mac/MediaRemoteSoftLink.h
    M Source/WebCore/platform/mac/MediaRemoteSoftLink.mm
    M Source/WebKit/Scripts/process-entitlements.sh
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/GPU/media/WebMediaStrategy.cpp

  Log Message:
  -----------
  [Cocoa] Support Now Playing presentation suppression
https://bugs.webkit.org/show_bug.cgi?id=279288
rdar://132115578

Reviewed by Eric Carlson.

Taught MediaSessionManagerCocoa to suppress the presentation of Now Playing information for
WebKit's presenting application when certain conditions are met (currently when video is playing).

* Source/WebCore/Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::nowPlayingInfo const):
  Set isVideo to false.

* Source/WebCore/PAL/pal/spi/mac/MediaRemoteSPI.h:
  Declared MRUIControllerProvider SPI.

* Source/WebCore/html/MediaElementSession.cpp:
(WebCore::MediaElementSession::computeNowPlayingInfo const):
  Set isVideo based on whether the media element is a <video>.

* Source/WebCore/platform/NowPlayingManager.cpp:
(WebCore::NowPlayingManager::setNowPlayingInfo):
(WebCore::NowPlayingManager::setNowPlayingInfoPrivate):
  Computed shouldUpdateNowPlayingSuppression and passed it to MediaSessionManagerCocoa.

* Source/WebCore/platform/NowPlayingManager.h:
* Source/WebCore/platform/audio/NowPlayingInfo.h:
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h:

* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::clearNowPlayingInfo):
  Stopped suppressing presentation when clearing Now Playing info.

(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
  Started or stopped suppressing presentation based on shouldUpdateNowPlayingSuppression.

(WebCore::nowPlayingActivityController):
(WebCore::MediaSessionManagerCocoa::updateNowPlayingSuppression):
  Added a helper to start/stop presentation.

* Source/WebCore/platform/mac/MediaRemoteSoftLink.h:
* Source/WebCore/platform/mac/MediaRemoteSoftLink.mm:
  Soft-linked MRUIControllerProvider.
* Source/WebKit/Scripts/process-entitlements.sh:
  Added necessary entitlements to com.apple.WebKit.GPU.

* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
  Updated to serialize NowPlayingInfo::isVideo.

* Source/WebKit/WebProcess/GPU/media/WebMediaStrategy.cpp:
(WebKit::WebMediaStrategy::createNowPlayingManager const):

Canonical link: https://commits.webkit.org/283290@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list