Type of the source attribute for video in HTML 5
Bad value video/webm; codecs='vp8, vorbis' for attribute type on element source: Expected a token character, whitespace or a semicolon but saw , instead.
src="../video/test.webm" type="video/webm; codecs='vp8, vorbis'" />
And I get this error for each type of video format I'm using.
However, while reading on this page, 4.8.6 The video element — HTML5 , it seems that I'm doing things right. Like I said I don't rely on the validator other than to help me see errors in my code, but I'm wondering if I'm missing something here, or is it because the validator is still experimental. Thanks everybody!Try changing your type from this:
type="video/webm; codecs='vp8, vorbis'"
to this
type='video/webm; codecs="vp8, vorbis"'
EDIT
While checking the HTML5 spec for the source element, the way I state above is how it is defined in the spec. If you are still getting validation errors I would assume it is a bug with the validator. I'd submit a bug report here so that it will get fixed.
<source type='video/webm; codecs="vp8, vorbis"' src="media/video.webm" />
You can use single quotes for the type
attribute and the double quotes for the codecs
value.
This is valid and it doesn't harm your document.
精彩评论