This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GPU Process] MSE videos are unable to AirPlay
https://bugs.webkit.org/show_bug.cgi?id=222956 rdar://72798835 When a user picks an device from the AirPlay menu, WebKit fires a 'webkitcurrentplaybacktargetiswirelesschanged' event at the <video> element and sets `video.webkitCurrentPlaybackTargetIsWireless` to true so script in the page is aware that the user wants to use AirPlay. AirPlay requires a <video> element to be backed by a url that an AppleTV can load and play, so this is also a signal for a page's script to change the <video> source if it is currently backed by a source that is incompatible with AirPlay, e.g. MSE, MediaStream, data:. If the current media engine does not support AirPlay (`m_player->canPlayToWirelessPlaybackTarget()` returns false) by the next runloop, HTMLMediaElement fires `webkitcurrentplaybacktargetiswirelesschanged` again and sets `video.webkitCurrentPlaybackTargetIsWireless` to false to signal that AirPlay is not active. When media is played in the GPU Process, one turn of the runloop isn't long enough for the new media engine to be set up, configured, and have the new state pushed back to the web process, so HTMLMediaElement will now wait for up to 500ms for `m_player->canPlayToWirelessPlaybackTarget()` to return true. Reviewed by Jer Noble. Tested manually, this requires and AppleTV to test. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity): (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget): * html/HTMLMediaElement.h: Canonical link: https://commits.webkit.org/235096@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing 3 changed files with 44 additions and 8 deletions.