Search code examples
htmlhtml5-videomultiple-browsers

'src' attribute inside html video tag


I want to use short video tag format like

<video src="path" controls></video>

And tutorial in w3school says:

To make it work in all browsers - use <source> elements inside the <video> element.

But as far as I can see my browsers handle short syntax very good (I have Google Chrome and Firefox). So should I be worried about any possible issues with short video tag notation?


Solution

  • source part is about making it compatible with all browsers by including alternative formats for browsers that could not support the format specified in src.

    In example: If you tried to play an .ogg file in IE12, which doesn't support .ogg with the code above, there would be no video whatsoever. If you provided alternative formats inside source, IE would eventually find the one it can handle and would play it instead.