Bug 232124 - video appears blank with only audio playing if video element isn't appended to the dom tree
Summary: video appears blank with only audio playing if video element isn't appended t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jean-Yves Avenard [:jya]
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-21 18:07 PDT by Jean-Yves Avenard [:jya]
Modified: 2021-10-22 22:58 PDT (History)
12 users (show)

See Also:


Attachments
Patch (17.88 KB, patch)
2021-10-22 05:42 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff
Patch (18.26 KB, patch)
2021-10-22 20:47 PDT, Jean-Yves Avenard [:jya]
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].