Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between <video src=""> </video > and <video> <source> </source></video>?

Tags:

html

Could you please explain me the difference between

<video src=""> </video>

and

<video><source> </source></video>

?

like image 826
SPGuar Avatar asked Aug 27 '16 10:08

SPGuar


1 Answers

By using <video> <source> </source> </video>. You can add multiple source elements. Multiple source elements can link to different video files. The browser will use the first recognized format.

 <video width="320" height="240" controls>
<source src=http://techslides.com/demos/sample-videos/small.webm type=video/webm> 
  <source src=http://techslides.com/demos/sample-videos/small.ogv type=video/ogg> 
  <source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
  <source src=http://techslides.com/demos/sample-videos/small.3gp type=video/3gp>
Your browser does not support the video tag.
</video> 
like image 144
Arpit Svt Avatar answered Sep 20 '22 05:09

Arpit Svt