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.

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

<video src='http://domain.com/video.mp4' controls autoplay>


Determines if controls should be displayed (such as play/pause and volume)

<video src='http://domain.com/video.mp4' controls>

width / height

Sets the width and height of the element

<video src='http://domain.com/video.mp4' controls width='320' height='240'>


Determines if the video should loop automatically when it is finished playing

<video src='http://domain.com/video.mp4' controls loop>


Determines if the video's sound should be muted by default

<video src='http://domain.com/video.mp4' controls muted>


Allows you to set an image to load. This will show while the video is downloading and before the user presses play.

<video src='http://domain.com/video.mp4' controls poster='/url/to/image.gif'>


Specifies if the video should begin to download automatically when the page is loaded

<video src='http://domain.com/video.mp4' controls preload="none">

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve our Support Center:
Email Address
Optional, but our team may contact you for more information.
Like this Article?

Post a Comment

Email Address:
Are you a bot?

Please note: Your name and comment will be displayed, but we will not show your email address.

Write New!
Do you want to publish a tutorial to our support center?

News / Announcements

SSL Certficate Warnings
Updated 2014-04-14 11:34 am EST
Hits: 2080
Heartbleed 0-day OpenSSL security bug
Updated 2014-04-14 04:43 pm EST
Hits: 5444

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!