Basic HTML5 <video>
Before HTML5 Technology, we used flash player plugin to play video on website. HTML5 <video> elements. This is a basic HTML5 <video> element :<video width="320" height="240" controls>
<source src="https://youtu.be/ZG4s2llvQXA.mp4" type="video/mp4">
<source src="https://youtu.be/ZG4s2llvQXA.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
This is explanation :<source src="https://youtu.be/ZG4s2llvQXA.mp4" type="video/mp4">
<source src="https://youtu.be/ZG4s2llvQXA.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
- "Control" attributes add video controls such play, pause, rewind, etc
- "width" and "height" is option, if you want video embedded with good looking without flicker this atributes will be helpfull.
- "source" elements will choose the video come from
- The text between <source> and </video> will appear if video is not supported the <video> element
.Autoplay
<video width="320" height="240" autoplay>
<source src="https://youtu.be/ZG4s2llvQXA.mp4" type="video/mp4">
<source src="https://youtu.be/ZG4s2llvQXA.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
If you want this video play automatically, change the "controls" attribute with "autoplay"<source src="https://youtu.be/ZG4s2llvQXA.mp4" type="video/mp4">
<source src="https://youtu.be/ZG4s2llvQXA.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
HTML <video> tags
Header Tags | Explanation |
---|---|
<video> | Defines a video or movie |
<source> | Defines multiple media resources for media elements, such as "video" and "audio" |
<track> | Defines text tracks in media players |
No comments
Mohon untuk berkomentar yang baik dan bijak