Bug 216858

Summary: [iOS] unable to airplay directly loaded fullscreen video
Product: WebKit Reporter: Devin Rousso <hi>
Component: MediaAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, jer.noble, peng.liu6, philipj, sergio, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://devinrousso.com/demo/WebKit/stream_of_water.mp4
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Devin Rousso
Reported 2020-09-22 16:50:03 PDT
By "directly loaded" I mean where the main resource is a video file (e.g. URL ends in `.mp4`). This issue doesn't appear to reproduce on pages that load videos (e.g. HTML pages that have `<video src="...">`).
Attachments
Patch (4.15 KB, patch)
2020-09-22 17:06 PDT, Devin Rousso
no flags
Patch (16.48 KB, patch)
2020-09-23 17:16 PDT, Devin Rousso
no flags
Patch (28.36 KB, patch)
2020-09-25 18:07 PDT, Devin Rousso
no flags
Devin Rousso
Comment 1 2020-09-22 16:50:26 PDT
Devin Rousso
Comment 2 2020-09-22 17:06:16 PDT
Created attachment 409426 [details] Patch This doesn't have any tests yet. I'm mainly uploading it to see what the bots think while I figure out how to test this (if it's even possible, as it only appears to reproduce on directly loaded videos).
Peng Liu
Comment 3 2020-09-22 17:15:28 PDT
Comment on attachment 409426 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409426&action=review > Source/WebCore/ChangeLog:18 > + is initally reported as "disabled" and then almost immediately changed to "enabled". Sounds like AVKit does not use the up-to-date value of the variable?
Devin Rousso
Comment 4 2020-09-23 17:16:34 PDT
Created attachment 409518 [details] Patch Re-approached the fix from another angle. Working on writing tests.
Devin Rousso
Comment 5 2020-09-23 17:21:19 PDT
Comment on attachment 409426 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409426&action=review >> Source/WebCore/ChangeLog:18 >> + is initally reported as "disabled" and then almost immediately changed to "enabled". > > Sounds like AVKit does not use the up-to-date value of the variable? as it turns out, it's more like "WebKit did not propagate the new value if/when the value returned by `wirelessVideoPlaybackDisabled` changes to the UIProcess so that WebKit could call `-[WebAVPlayerController setAllowsExternalPlayback:]` again with the new value" :P please see attachment 409518 [details] for more details :)
Peng Liu
Comment 6 2020-09-23 17:32:48 PDT
Comment on attachment 409518 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409518&action=review > Source/WebCore/html/HTMLMediaElement.cpp:5009 > + if (m_player) { Is this change needed?
Devin Rousso
Comment 7 2020-09-23 17:37:15 PDT
Comment on attachment 409518 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409518&action=review >> Source/WebCore/html/HTMLMediaElement.cpp:5009 >> + if (m_player) { > > Is this change needed? yes, as otherwise this function early-returns before the added code below is able to run I've tried looking at whether any of the other functions after this do in-fact require a `m_player` to exist, and I don't think they do, but this code is quite nested and intertwined so I'm not entirely sure. I figured that EWS would tell me if this was bad :)
Peng Liu
Comment 8 2020-09-23 19:31:50 PDT
Comment on attachment 409518 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409518&action=review >>> Source/WebCore/html/HTMLMediaElement.cpp:5009 >>> + if (m_player) { >> >> Is this change needed? > > yes, as otherwise this function early-returns before the added code below is able to run > > I've tried looking at whether any of the other functions after this do in-fact require a `m_player` to exist, and I don't think they do, but this code is quite nested and intertwined so I'm not entirely sure. I figured that EWS would tell me if this was bad :) Hmm, I see! Sounds a little strange that m_player is nullptr but we need to notify observers regarding the media engine change. :-)
Devin Rousso
Comment 9 2020-09-25 18:07:34 PDT
Eric Carlson
Comment 10 2020-09-25 18:11:14 PDT
Comment on attachment 409764 [details] Patch Thanks for adding a test!
EWS
Comment 11 2020-09-28 11:24:03 PDT
Committed r267709: <https://trac.webkit.org/changeset/267709> All reviewed patches have been landed. Closing bug and clearing flags on attachment 409764 [details].
Note You need to log in before you can comment on or make changes to this bug.