Skip to content

Commit

Permalink
Disable default media controls scrubber on Netflix.com on macOS
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=274128
rdar://126645029

Reviewed by Jer Noble.

When the default media controls are showing on Netflix.com on macOS
(notably in in-window mode), Netflix interferes with scrubbing
And breaks video playback. To fix this, we should disable scrubbing
When the default media controls are showing and we are in fullscreen.

* Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::supportsSeeking const):
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.h:
* Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl:
* Source/WebCore/Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._updateControlsIfNeeded):

Canonical link: https://commits.webkit.org/278784@main
  • Loading branch information
danae404 committed May 14, 2024
1 parent feff12f commit fe2235a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,11 @@ bool MediaControlsHost::shouldForceControlsDisplay() const
return m_mediaElement && m_mediaElement->shouldForceControlsDisplay();
}

bool MediaControlsHost::supportsSeeking() const
{
return m_mediaElement && m_mediaElement->supportsSeeking();
}

String MediaControlsHost::externalDeviceDisplayName() const
{
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Modules/mediacontrols/MediaControlsHost.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class MediaControlsHost final : public RefCounted<MediaControlsHost>, public Can
bool isInMediaDocument() const;
bool userGestureRequired() const;
bool shouldForceControlsDisplay() const;
bool supportsSeeking() const;

enum class ForceUpdate : bool { No, Yes };
void updateCaptionDisplaySizes(ForceUpdate = ForceUpdate::No);
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Modules/mediacontrols/MediaControlsHost.idl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum DeviceType {
readonly attribute boolean userGestureRequired;
readonly attribute boolean isInMediaDocument;
readonly attribute boolean shouldForceControlsDisplay;
readonly attribute boolean supportsSeeking;

readonly attribute DOMString externalDeviceDisplayName;
readonly attribute DeviceType externalDeviceType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,9 @@ class MediaController

this.controls.shouldUseSingleBarLayout = this.controls instanceof InlineMediaControls && this.isYouTubeEmbedWithTitle;

if (this.host && !this.host.supportsSeeking && this.layoutTraits.isFullscreen)
this.controls.timeControl.scrubber.disabled = true;

this._updateControlsAvailability();
}

Expand Down

0 comments on commit fe2235a

Please sign in to comment.