Summary: | Apple movie trailers play only audio | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Eric Carlson <eric.carlson> | ||||
Component: | Media | Assignee: | Eric Carlson <eric.carlson> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | jer.noble | ||||
Priority: | P2 | Keywords: | InRadar, PlatformOnly | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac (Intel) | ||||||
OS: | Other | ||||||
Attachments: |
|
Description
Eric Carlson
2011-04-12 10:06:55 PDT
This happens because HTMLVideoElement::setDisplayMode assumes that a frame of video will be available immediately after calling a media engine's prepareForRendering function. This is not necessarily the case with AVFoundation so HTMLVideoElement continues to display the @poster, which is a 1x1 white pixel. The solution is to add a mechanism for a media engine to let HTMLMediaElement know when the first frame is ready to render. Created attachment 89286 [details]
Proposed patch.
Comment on attachment 89286 [details] Proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=89286&action=review > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:494 > + if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo && hasAvailableVideoFrame()) { > + m_haveReportedFirstVideoFrame = true; > + m_player->firstVideoFrameAvailable(); > + } > + Is -[AVPlayerLayer isReadyForDisplay] KVO-compliant? Because it seems a shame we have to wait for some other notification before checking to see if there's a frame ready to be rendered. ... Apparently it is observable. You could add a new observer so that we run through updateStates() as soon as a frame is ready. But that's just an optimization and not strictly necessary. Looks good to me. Comment on attachment 89286 [details]
Proposed patch.
r=me with a comment in email
|