haikuwebkit/LayoutTests/media/video-fullscreen-only-playb...

23 lines
660 B
Plaintext
Raw Permalink Normal View History

Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
Enable the mock video presentation mode in related layout tests and fix test failures https://bugs.webkit.org/show_bug.cgi?id=211645 Reviewed by Darin Adler. Source/WebCore: Clean up the internal states of video element regarding video presentation mode to simplify the task to write reliable layout tests for video fullscreen and Picture-in-Picture. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): Update the states after we are sure the video element will enter fullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Remove the unnecessary "fullscreenModeChanged(VideoFullscreenModeNone)". * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::waitingToEnterFullscreen): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): The function webkitDisplayingFullscreen() will return true after the process to enter fullscreen is completed. * html/HTMLVideoElement.h: Expose didBecomeFullscreenElement() when VIDEO_PRESENTATION_MODE is enabled. Source/WebKit: Fix the mistake in VideoFullscreenManager::supportsVideoFullscreen() introduced in r202274. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): Source/WebKitLegacy/mac: Call HTMLVideoElement::didBecomeFullscreenElement() after a video element enters fullscreen (to be consistent with WK2). * WebView/WebVideoFullscreenController.mm: (-[WebVideoFullscreenController windowDidEnterFullScreen:]): * WebView/WebView.mm: (-[WebView _enterVideoFullscreenForVideoElement:mode:]): LayoutTests: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/media-fullscreen-inline.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/media-fullscreen.js: (async beginfullscreen): (async fullscreenerror): (addEventListeners): (beginfullscreen): Deleted. (fullscreenerror): Deleted. * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide-expected.txt: * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr-expected.txt: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback-expected.txt: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/mac-wk2/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/224639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-11 21:03:24 +00:00
Test the play() function of <video> when fullscreen is required.
Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
EVENT(canplaythrough)
EXPECTED (video.webkitSupportsFullscreen == 'true') OK
EXPECTED (video.webkitDisplayingFullscreen == 'false') OK
Enable the mock video presentation mode in related layout tests and fix test failures https://bugs.webkit.org/show_bug.cgi?id=211645 Reviewed by Darin Adler. Source/WebCore: Clean up the internal states of video element regarding video presentation mode to simplify the task to write reliable layout tests for video fullscreen and Picture-in-Picture. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): Update the states after we are sure the video element will enter fullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Remove the unnecessary "fullscreenModeChanged(VideoFullscreenModeNone)". * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::waitingToEnterFullscreen): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): The function webkitDisplayingFullscreen() will return true after the process to enter fullscreen is completed. * html/HTMLVideoElement.h: Expose didBecomeFullscreenElement() when VIDEO_PRESENTATION_MODE is enabled. Source/WebKit: Fix the mistake in VideoFullscreenManager::supportsVideoFullscreen() introduced in r202274. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): Source/WebKitLegacy/mac: Call HTMLVideoElement::didBecomeFullscreenElement() after a video element enters fullscreen (to be consistent with WK2). * WebView/WebVideoFullscreenController.mm: (-[WebVideoFullscreenController windowDidEnterFullScreen:]): * WebView/WebView.mm: (-[WebView _enterVideoFullscreenForVideoElement:mode:]): LayoutTests: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/media-fullscreen-inline.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/media-fullscreen.js: (async beginfullscreen): (async fullscreenerror): (addEventListeners): (beginfullscreen): Deleted. (fullscreenerror): Deleted. * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide-expected.txt: * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr-expected.txt: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback-expected.txt: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/mac-wk2/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/224639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-11 21:03:24 +00:00
RUN(video.play())
Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
EVENT(playing)
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
** Started playing
EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
EXPECTED (video.webkitDisplayingFullscreen == 'true') OK
Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
RUN(video.webkitExitFullScreen())
Enable the mock video presentation mode in related layout tests and fix test failures https://bugs.webkit.org/show_bug.cgi?id=211645 Reviewed by Darin Adler. Source/WebCore: Clean up the internal states of video element regarding video presentation mode to simplify the task to write reliable layout tests for video fullscreen and Picture-in-Picture. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): Update the states after we are sure the video element will enter fullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Remove the unnecessary "fullscreenModeChanged(VideoFullscreenModeNone)". * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::waitingToEnterFullscreen): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): The function webkitDisplayingFullscreen() will return true after the process to enter fullscreen is completed. * html/HTMLVideoElement.h: Expose didBecomeFullscreenElement() when VIDEO_PRESENTATION_MODE is enabled. Source/WebKit: Fix the mistake in VideoFullscreenManager::supportsVideoFullscreen() introduced in r202274. * WebProcess/cocoa/VideoFullscreenManager.mm: (WebKit::VideoFullscreenManager::supportsVideoFullscreen const): Source/WebKitLegacy/mac: Call HTMLVideoElement::didBecomeFullscreenElement() after a video element enters fullscreen (to be consistent with WK2). * WebView/WebVideoFullscreenController.mm: (-[WebVideoFullscreenController windowDidEnterFullScreen:]): * WebView/WebView.mm: (-[WebView _enterVideoFullscreenForVideoElement:mode:]): LayoutTests: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/media-fullscreen-inline.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/media-fullscreen.js: (async beginfullscreen): (async fullscreenerror): (addEventListeners): (beginfullscreen): Deleted. (fullscreenerror): Deleted. * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide-expected.txt: * media/modern-media-controls/css/webkit-cursor-visibility-auto-hide.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button-expected.txt: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html: * media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag.html: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen-expected.txt: * media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr-expected.txt: * media/modern-media-controls/media-controller/media-controller-fullscreen-ltr.html: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback-expected.txt: * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt: * media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/mac-wk2/TestExpectations: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/224639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-11 21:03:24 +00:00
EVENT(webkitpresentationmodechanged)
Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
Let webkitDisplayingFullscreen() return true when a video element’s fullscreen mode is not VideoFullscreenModeNone https://bugs.webkit.org/show_bug.cgi?id=216426 Reviewed by Jer Noble. Source/WebCore: This patch moves m_changingVideoFullscreenMode of HTMLVideoElement to HTMLMediaElement. The flag is used to protect interfaces regarding video presentation mode changes. It also guards the code path when we use element fullscreen to implement video fullscreen (VIDEO_USES_ELEMENT_FULLSCREEN). It is better to store the flag in HTMLMediaElement to have fine control. This patch reverts the changing regarding HTMLVideoElement::webkitDisplayingFullscreen in r262456. This function will return true in the same run loop as a webkitpresentationmodechanged event is fired when a video element is entering fullscreen or picture-in-picture. Also, this patch adds Internals::isChangingPresentationMode which can be used by layout tests to check whether a video presentation mode change is completed. Covered by existing tests. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::isFullscreen const): Align the implementation with isStandardFullscreen(). (WebCore::HTMLMediaElement::enterFullscreen): Set m_changingVideoFullscreenMode to true if the video element is changing presentation mode. Also fix a bug about the flag m_waitingToEnterFullscreen. (WebCore::HTMLMediaElement::exitFullscreen): Ditto. (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto. (WebCore::HTMLMediaElement::didStopBeingFullscreenElement): Ditto. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::setChangingVideoFullscreenMode): (WebCore::HTMLMediaElement::isChangingVideoFullscreenMode const): (WebCore::HTMLMediaElement::waitingToEnterFullscreen): Deleted. * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Revert the change in r262456. Some web sites expect this function to return true if the video element is entering fullscreen and the event webkitpresentationmodechanged is fired. (WebCore::HTMLVideoElement::setPresentationMode): Remove code regarding m_isChangingVideoFullscreenMode. (WebCore::HTMLVideoElement::didEnterFullscreenOrPictureInPicture): Fix an event firing issue when a video element is entering fullscreen while exiting picture-in-picture. (WebCore::HTMLVideoElement::didExitFullscreenOrPictureInPicture): Fix an event firing issue when a video element is exiting picture-in-picture. (WebCore::HTMLVideoElement::isChangingPresentationMode const): This interface is used by layout tests (through Internals) to check whether a video presentation mode change is completed. (WebCore::HTMLVideoElement::didBecomeFullscreenElement): Deleted. * html/HTMLVideoElement.h: * testing/Internals.cpp: (WebCore::Internals::isChangingPresentationMode const): This interface is used by layout tests to check whether a video presentation mode change is completed. * testing/Internals.h: * testing/Internals.idl: Tools: * TestWebKitAPI/Tests/WebKitCocoa/WKWebViewCloseAllMediaPresentations.mm: (TEST): Use internals.isChangingPresentationMode() to make sure a video presentation mode change (from inline to picture-in-picture) is completed before moving to the next step of the test. LayoutTests: Check Internals::isChangingPresentationMode instead of HTMLVideoElement::webkitDisplayingFullscreen to confirm the video presentation mode change is completed before moving to the next step of a test. * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast-expected.txt: * http/tests/media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-live-broadcast.html: * media/context-menu-actions.html: * media/media-fullscreen-loop-inline-expected.txt: * media/media-fullscreen-loop-inline.html: * media/media-fullscreen-pause-inline-expected.txt: * media/media-fullscreen-pause-inline.html: * media/media-fullscreen-return-to-inline-expected.txt: * media/media-fullscreen-return-to-inline.html: * media/presentationmodechanged-fired-once-expected.txt: * media/presentationmodechanged-fired-once.html: * media/video-fullscreen-only-playback-expected.txt: * media/video-fullscreen-only-playback.html: * media/video-playsinline-expected.txt: * media/video-playsinline.html: * media/video-presentation-mode-expected.txt: * media/video-presentation-mode.html: * media/video-webkit-playsinline-expected.txt: * media/video-webkit-playsinline.html: * platform/mac/TestExpectations: Canonical link: https://commits.webkit.org/230793@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-22 15:22:39 +00:00
** Received webkitpresentationmodechanged event
EXPECTED (internals.isChangingPresentationMode(video) == 'false') OK
Exited fullscreen
EXPECTED (video.webkitDisplayingFullscreen == 'false') OK
Allow MediaSessionManager to restrict inline <video> playback https://bugs.webkit.org/show_bug.cgi?id=127113 Reviewed by Jer Noble. Source/WebCore: Test: media/video-fullscreeen-only-playback.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::updatePlayState): Drive-by change to not tell the media session that playback is starting if the media player is already playing. Enter fullscreen if the media session says it is required. * html/HTMLMediaSession.cpp: (WebCore::HTMLMediaSession::clientWillBeginPlayback): Make it const. (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback): New, see if the specified media element must be played in fullscreen based on the media session settings, document settings, and attributes. * html/HTMLMediaSession.h: * platform/audio/MediaSession.h: pauseSession shouldn't be virtual. * platform/audio/MediaSessionManager.cpp: (WebCore::MediaSessionManager::sessionWillBeginPlayback): Return immediately if ConcurrentPlaybackNotPermitted is not set. (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback): New. * platform/audio/MediaSessionManager.h: * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::MediaSessionManageriOS): Set InlineVideoPlaybackRestricted if running on an iPhone or iPod class device. * testing/Internals.cpp: (WebCore::Internals::setMediaSessionRestrictions): Support InlineVideoPlaybackRestricted. LayoutTests: * media/video-fullscreeen-only-playback-expected.txt: Added. * media/video-fullscreeen-only-playback.html: Added. Canonical link: https://commits.webkit.org/145117@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-16 21:26:53 +00:00
END OF TEST