A new element in HTML5 is the video element. The video element can be used to display a video in the browser, and it is intended to replace the object element.
Example Usage of the HTML5 Video Element
The following example code can be used to play a video on your webpage using the HTML5 video element:
<video src='http://domain.com/video.mp4' controls> Your browser does not support the HTML5 Video Element. </video>
For more information on getting the HTML5 video to work in all browsers, please see the previous tutorial on Using HTML5 to add videos.
Optional HTML5 Video Attributes
|Attribute||Description and Example Usage|
Determines if the video will play automatically
Determines if controls should be displayed (such as play/pause and volume)
|width / height||
Sets the width and height of the element
Determines if the video should loop automatically when it is finished playing
Determines if the video’s sound should be muted by default
Allows you to set an image to load. This will show while the video is downloading and before the user presses play.
Specifies if the video should begin to download automatically when the page is loaded