Bug 232124

Summary: video appears blank with only audio playing if video element isn't appended to the dom tree
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: MediaAssignee: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=232125
https://bugs.webkit.org/show_bug.cgi?id=232193
Attachments:
Description Flags
Patch
none
Patch none

Description Jean-Yves Avenard [:jya] 2021-10-21 18:07:40 PDT
If you do on iOS:

    let parent = document.getElementById("videoContainer");
    let ve = document.createElement("video");
    ve.src = "https://devstreaming-cdn.apple.com/videos/wwdc/2021/10073/7/53148F9F-7E28-46AA-AD05-CC2ABEC68EDC/downloads/wwdc2021-10073_sd.mp4";
    ve.play();

https://codepen.io/iffwang/pen/powQodO

Then only the audio will play, the image stays black.
Comment 1 Jean-Yves Avenard [:jya] 2021-10-21 18:07:57 PDT
rdar://83438282
Comment 2 Jean-Yves Avenard [:jya] 2021-10-22 05:42:56 PDT
Created attachment 442153 [details]
Patch
Comment 3 Eric Carlson 2021-10-22 09:09:53 PDT
Comment on attachment 442153 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=442153&action=review

> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:483
> +    if (RefPtr player = m_player.get()) {

Is this ref count churn helpful, wouldn't `auto* player = m_player.get()` work?
Comment 4 Jean-Yves Avenard [:jya] 2021-10-22 20:47:58 PDT
Created attachment 442246 [details]
Patch

apply comment
Comment 5 EWS 2021-10-22 22:58:23 PDT
Committed r284741 (243450@main): <https://commits.webkit.org/243450@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442246 [details].