This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse the repository at this point in the history
bbc.co.uk: Video goes black with only audio playing when exiting PiP …
…mode https://bugs.webkit.org/show_bug.cgi?id=257711 rdar://108304377 Reviewed by Jer Noble. Only fire the fullscreen change event once we did enter fullscreen. This gives time for the UI process to complete exiting PiP in the UI process. The process for exiting PiP and go back into fullscreen is a complicated (and unnecessary) dance between the content and the UI process. didStopPictureInPicture (UI) -> requestRestoreFullScreen (CP) -> EnterFullScreen (UI) -> WillEnterFullscreen (CP) -> beganEnterFullScreen (UI) -> didEnterFullScreen (UI) -> didEnterFullScreen (CP) Previously, the events `fullscreenchange` was fired in WillEnterFullscreen. if a JS event listener was set, and attempted to exit PiP then (as BBC website is doing) it would have left VideoFullscreenInterfaceAVKit in a broken state once it received `beganEnterFullScreen` as it's not an handled chained of event. By letting the UI process complete the exit of PiP back to fullscreen, we can avoid the problem from occurring alltogether, and this is simply done by firing the events and resolving the promise in didEnterFullScreen. We limit this behaviour to BBC.com This entire code is in serious need of a rewrite. Manually tested under all possible interface scenarios: - Entering PiP, Exiting PiP using BBC main player control. - Entering PiP, Exiting PiP using PiP controller button. - Entering fullscreen via BBC control, entering PiP using PiP button, exiting PiP using BBC main player control - As above but using PiP controller button as last step. - Going into Auto-Pip by swiping home and exiting PiP. - Entering PiP, quitting PiP (X button) * Source/WebCore/dom/FullscreenManager.cpp: (WebCore::FullscreenManager::willEnterFullscreen): (WebCore::FullscreenManager::didEnterFullscreen): * Source/WebCore/page/Quirks.cpp: (WebCore::Quirks::shouldDelayFullscreenEventWhenExitingPictureInPictureQuirk const): * Source/WebCore/page/Quirks.h: Canonical link: https://commits.webkit.org/264974@main
- Loading branch information
Showing 3 changed files with 27 additions and 1 deletion.