Playing an audio file in <video> is allowed and works fine. However, when the audio starts playing, the poster image is removed. Per the spec, the poster image should stay visible: "When no video data is available (... the media resource does not have a video channel), the video element represents the poster frame." This also provides a better experience. A poster image is nicer than a white screen.
Safari on 10.7.2 behaves correctly.
But Safari 5.1 on 10.6.8 does not, so it apparently depends on the media engine.
We display the poster until HTMLVideoElement::hasAvailableVideoFrame returns true. That method asks the media engine if has video to display. The QTKit based method (MediaPlayerPrivateQTKit::hasAvailableVideoFrame) can't tell if a QTMovieLayer actually has frames ready to display, but it also doesn't check to see if the movie has video at all.
This could be fixed in each of the media engines that have a problem (at least QTKit, QuickTime, and Chrome), or by adding one test to HTMLVideoElement. I am going to go with the later.
Created attachment 117265 [details] Proposed patch
Comment on attachment 117265 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=117265&action=review > Source/WebCore/ChangeLog:8 > + No new tests. (OOPS!) Bad to not have tests. Also can’t land the patch without removing the OOPS ;-)
<rdar://problem/10511668>
http://trac.webkit.org/changeset/101675