Skip to content

Commit

Permalink
[iOS] Define a runtime feature flag for LinearMediaPlayer
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=269210
rdar://122814889

Reviewed by Eric Carlson.

Defined a LinearMediaPlayerEnabled web preference with a default value of false. When the
preference is enabled, deactivated the code path in HTMLMediaElement that requires element
fullscreen for video fullscreen.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WTF/wtf/PlatformEnable.h:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):

Canonical link: https://commits.webkit.org/274486@main
  • Loading branch information
aestes committed Feb 12, 2024
1 parent 4d9acd3 commit fb92aa9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3962,6 +3962,21 @@ LegacyOverflowScrollingTouchEnabled:
WebCore:
default: true

LinearMediaPlayerEnabled:
type: bool
status: unstable
category: media
humanReadableName: "Linear Media Player"
humanReadableDescription: "Enable LinearMediaPlayer for fullscreen video"
condition: ENABLE(LINEAR_MEDIA_PLAYER)
defaultValue:
WebKitLegacy:
default: false
WebKit:
default: false
WebCore:
default: false

LinkModulePreloadEnabled:
type: bool
status: stable
Expand Down
5 changes: 5 additions & 0 deletions Source/WTF/wtf/PlatformEnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -981,3 +981,8 @@
&& USE(EXTENSIONKIT)
#define ENABLE_EXTENSION_CAPABILITIES 1
#endif

#if !defined(ENABLE_LINEAR_MEDIA_PLAYER) \
&& USE(LINEARMEDIAKIT)
#define ENABLE_LINEAR_MEDIA_PLAYER 1
#endif
3 changes: 3 additions & 0 deletions Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6863,6 +6863,9 @@ void HTMLMediaElement::enterFullscreen(VideoFullscreenMode mode)
#if ENABLE(FULLSCREEN_API) && ENABLE(VIDEO_USES_ELEMENT_FULLSCREEN)
#if PLATFORM(IOS_FAMILY)
bool videoUsesElementFullscreen = document().settings().videoFullscreenRequiresElementFullscreen();
#if ENABLE(LINEAR_MEDIA_PLAYER)
videoUsesElementFullscreen &= !document().settings().linearMediaPlayerEnabled();
#endif
#else
constexpr bool videoUsesElementFullscreen = true;
#endif
Expand Down

0 comments on commit fb92aa9

Please sign in to comment.