Free Web Development Online Tutorials, Learn to Code
Learn HTML5 Syntax, Webpage Designing using HTML, HTML5 Tags, HTML Tutorial for Beginners

Video tag html5 example

HTML5 Video Tag Example

Adding a video to any webpage is single element, as easy as adding an image. You don’t need to write any complicated markup for plug-ins

Adding Single Video, you can set video autoplay property

<video autoplay="autoplay" src="~/sound/dance.mp4" controls="controls">
</video>

Adding Multiple Videos, setting video autoplay and loop property

<video width="320" height="240" autoplay="autoplay"  controls="controls" loop="loop">
<source src="~/sound/dance.mp4">
<source src="~/sound/dance2.mp4">  
</video>

video tag attributes

Here are few important attributes for video

  • src

    this property is for setting up the file source, like source src="~/suound/file1.mp3"

  • autoplay

    autoplay="autoplay", This Boolean attribute specifies that if the video will automatically start playing, the value is "autoplay" which means "true".

  • controls

    controls="controls", Indicates browsers will display the control, that will allow the user to control video play/pause, volume etc.

  • loop

    loop="loop", Indicates that video will automatically start over again

  • muted

    muted="muted", if the property value set to muted then, then the audio will be muted when loaded for the first time

HTML5 Tags Examples

Implementing video in HTML5 is as simple as image, is just one element in Html5

Comment
Name
Email
Website
Subscribe