/    Sign up×
Reference /Pin to ProfileBookmark

The video tag, or Video Embed element, embeds video content in an HTML document.

Syntax

Text within the <video> tag is only displayed in browsers that do not support it. The <video> tag contains one or more <source> tags, each with a URL to a media file.

<video width="600" height="400" controls>
  <source src="videoname.mp4" type="video/mp4">
  <source src="videoname.ogg" type="video/ogg">
  This browser does not support the video tag.
</video>

Attributes

autoplay
If included, the video will immediately begin playing as soon as enough of the file is loaded. This is a Boolean value.

controls
When present, the browser renders controls for video playback, such as play, pause/resume, etc.

height
Provides the height of the video in pixels.

loop
When specified, the video will replay from the beginning every time it finishes.

muted
When specified, the audio output of the video will be muted.

poster
Provides the URL address of an image file to be displayed while the video is downloading or until the user presses the play button if autoplay is not enabled.

preload
This tells the browser how the video should be loaded when the page loads. Allowed values are auto, metadata, and none.

src
Provides the URL of the video file.

width
Provides the width of the video in pixels.

Browser Compatibilty

Demos

User-submitted codepen.io examples of <video>

@marccurtis321

See the Pen on CodePen.

Want to Contribute?

Submit a codepen.io link that demonstrates <video>:

to submit a demo.
HTML
×

Success!

Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...