| Summary: | Video poster disappears prematurely on play, leaving transparent video element. | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Johannes Odland <johannes.odland> | ||||||||||||||||||||||
| Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||||||
| Severity: | Normal | CC: | cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hello, jer.noble, philipj, sergio, webkit-bug-importer | ||||||||||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||
| Version: | Safari 14 | ||||||||||||||||||||||||
| Hardware: | iPhone / iPad | ||||||||||||||||||||||||
| OS: | iOS 14 | ||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||
|
Description
Johannes Odland
2021-06-13 22:29:41 PDT
The issue is still present in Safari 15. Created attachment 454331 [details]
Video of the issue on twitter
This issue makes every video on twitter and other sites flash on play. Any hope you will look into it?
Created attachment 454615 [details]
Patch
Created attachment 454626 [details]
Patch
Comment on attachment 454626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454626&action=review r=me with nits: > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:543 > + bool hasAvailableVideoFrame = this->hasAvailableVideoFrame(); > + if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo && hasAvailableVideoFrame) { > + haveFirstVideoFrameChanged = true; > + m_haveReportedFirstVideoFrame = true; > + } else if (!hasAvailableVideoFrame) > + m_haveReportedFirstVideoFrame = false; This section of code confused me. What about this instead?: if (!hasAvailableVideoFrame()) m_haveReportedFirstVideoFrame = false else if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo) { m_haveReportedFirstVideoFrame = true; haveFirstVideoFrameChanged = true; } > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:561 > - if (m_readyState != MediaPlayer::ReadyState::HaveEnoughData && maxTimeLoaded() > currentMediaTime()) > + if (m_readyState != MediaPlayer::ReadyState::HaveEnoughData && (!m_cachedHasVideo || m_haveReportedFirstVideoFrame) && maxTimeLoaded() > currentMediaTime()) I wonder if we should have a `shouldBlockAdvancingToFutureData` variable (initialized to the same as above) here. > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:582 > - if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo && hasAvailableVideoFrame()) { > + if (haveFirstVideoFrameChanged) { `haveFirstVideoFrameChanged` is slightly weird (because it's really saying the media player has a video frame available for the first time). Maybe `videoFrameBecomeAvailable`? Comment on attachment 454626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454626&action=review >> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:543 >> + m_haveReportedFirstVideoFrame = false; > > This section of code confused me. What about this instead?: > > if (!hasAvailableVideoFrame()) > m_haveReportedFirstVideoFrame = false > else if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo) { > m_haveReportedFirstVideoFrame = true; > haveFirstVideoFrameChanged = true; > } Good idea, changed. >> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:561 >> + if (m_readyState != MediaPlayer::ReadyState::HaveEnoughData && (!m_cachedHasVideo || m_haveReportedFirstVideoFrame) && maxTimeLoaded() > currentMediaTime()) > > I wonder if we should have a `shouldBlockAdvancingToFutureData` variable (initialized to the same as above) here. I think it makes more sense to have the logic here so I'll leave this. >> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:582 >> + if (haveFirstVideoFrameChanged) { > > `haveFirstVideoFrameChanged` is slightly weird (because it's really saying the media player has a video frame available for the first time). Maybe `videoFrameBecomeAvailable`? I changed it to `firstVideoFrameBecomeAvailable`. Created attachment 454642 [details]
Patch for landing
Created attachment 454710 [details]
Patch for landing
Created attachment 454713 [details]
Patch for landing
Created attachment 454720 [details]
Patch for landing
Created attachment 454771 [details]
Patch for landing
The Windows bot test failure, streams/readable-stream-lock-after-worker-terminates-crash.html, is unrelated. Committed r291326 (248465@main): <https://commits.webkit.org/248465@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 454771 [details]. Which Safari version should this patch be included in? Current Safari Technology Preview (Release 142 (Safari 15.4, WebKit 17614.1.5.16)) seems to not include those changes. At least codepen test from comment #0 still reproduces for me. (Asking, because I experience similar bug with my own page) Created attachment 459526 [details]
Video of the bug on Safari 15.5
Tested on Safari 15.5, and the bug is still there.
Should we register a new issue, or should this issue be reopened?
|