HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <video> tag

The HTML <video> element is used to embed video player in web pages.

It may contain one or more video sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one.

Run code

Any text between <video> and </video> will be displayed in browsers that do not support the <video> tag.

Browser compatibility

The numbers in the table specify the first browser version that fully supports the <video> element:

<video> 3 3.5 10.5 3.1 9

Media Types

File Format Media Type
MP4 video/mp4
OGG video/ogg
WebM video/webm


The following table shows the attributes that are specific to the <video> tag:

Attribute Value Description
autoplay - A boolean attribute; if specified, the video or audio automatically begins to play back as soon as it can do so without stopping to finish loading the data
controls - A boolean attribute if this attribute is present, the browser will offer controls to allow the user to control audio/video playback, including volume, seeking, and pause/resume playback
height pixels Specifies the height of the video player
loop - A boolean attribute; if specified, the browser will automatically seek back to the start upon reaching the end of the video/audio
muted - A boolean attribute specifies that the audio output of the video should be muted
poster URL Specifies the image to be shown while the video is downloading
This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience
src URL Specifies the URL of the video file
width pixels Specifies the width of the video player

Global Attributes

The <video> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <video> tag supports the event attributes described in HTML Events Reference

More Examples

A video player with subtitles:

Run code

The poster attribute specifies an image to be shown while the video is downloading, or until the user hits the play button.

Run code

Last updated: Wednesday 03 Oct, 2018