{"id":6273,"date":"2015-08-18T12:15:34","date_gmt":"2015-08-18T09:15:34","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=6273"},"modified":"2017-12-19T13:49:17","modified_gmt":"2017-12-19T11:49:17","slug":"html5-video-tag-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/","title":{"rendered":"HTML5 Video Tag Example"},"content":{"rendered":"<p>The aim of this example is to introduce and show the usage of the <code>video<\/code> tag of HTML5.<\/p>\n<p>Before HTML5, there was no standard for showing videos on a web page and videos could only be played with a plug-in (like flash).<\/p>\n<p>The HTML <code>video<\/code> element is used to embed video content. It may contain several video sources, represented using the src attribute or the  element; the browser will choose the most suitable one.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;tgm4cmEWcKUikZNn&#8217;]<\/p>\n<h2>1. Basics<\/h2>\n<h3>1.1 Initial Document Setup<\/h3>\n<p>Go ahead and create a new html document and add the basic sytnax in it like so:<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n\t&lt;title&gt;HTML5 Video Tag Example&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;!-- STYLE SECTION --&gt;\r\n\r\n&lt;style type=\"text\/css\"&gt;\r\n\r\n&lt;\/style&gt;\r\n\r\n&lt;!-- HTML SECTION --&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>1.2 Understanding the Attributes<\/h3>\n<p><code>autoplay<\/code><br \/>\nA Boolean attribute; if specified, the video will automatically begin to play back as soon as it can do so without stopping to finish loading the data.<\/p>\n<p><code>buffered<\/code><br \/>\nAn attribute you can read to determine which time ranges of the media have been buffered. This attribute contains a TimeRanges object.<\/p>\n<p><code>controls<\/code><br \/>\nIf this attribute is present, Gecko will offer controls to allow the user to control video playback, including volume, seeking, and pause\/resume playback.<\/p>\n<p><code>height<\/code><br \/>\nThe height of the video&#8217;s display area, in CSS pixels.<\/p>\n<p><code>loop<\/code><br \/>\nA Boolean attribute; if specified, we will, upon reaching the end of the video, automatically seek back to the start.<\/p>\n<p><code>muted<\/code><br \/>\nA Boolean attribute which indicates the default setting of the audio contained in the video. If set, the audio will be initially silenced. Its default value is false, meaning that the audio will be played when the video is played.<\/p>\n<p><code>played<\/code><br \/>\nA TimeRanges object indicating all the ranges of the video that have been played.<\/p>\n<p><code>poster<\/code><br \/>\nA URL indicating a poster frame to show until the user plays or seeks. If this attribute isn&#8217;t specified, nothing is displayed until the first frame is available; then the first frame is displayed as the poster frame.<\/p>\n<p><code>src<\/code><br \/>\nThe URL of the video to embed. This is optional; you may instead use the  element within the video block to specify the video to embed.<\/p>\n<p><code>width<\/code><br \/>\nThe width of the video&#8217;s display area, in CSS pixels.<\/p>\n<h3>1.3 Media Formats Supported<\/h3>\n<p><strong>1. WebM<\/strong><br \/>\nThe WebM format is based on a restricted version of the Matroska container format. It always uses the VP8 or VP9 video codec and the Vorbis or Opus audio codec. WebM is natively supported in desktop and mobile Gecko (Firefox), Chrome and Opera, and support for the format can be added to Internet Explorer and Safari (but not on iOS) by installing an add-on.<\/p>\n<p><strong>video\/webm<\/strong><br \/>\nA WebM media file containing video (and possibly audio as well).<\/p>\n<p><strong>2. Ogg Theora Vorbis<\/strong><br \/>\nThe Ogg container format with the Theora video codec and the Vorbis audio codec is supported in desktop\/mobile Gecko (Firefox), Chrome, and Opera, and support for the format can be added to Safari (but not on iOS) by installing an add-on. The format is not supported in Internet Explorer in any way.<\/p>\n<p>WebM is generally preferred over Ogg Theora Vorbis when available, because it provides a better compression to quality ratio and is supported in more browsers. The Ogg format can however be used to support older browser versions (for example Firefox 3.5\/3.6 don&#8217;t support WebM, but do support Ogg.)<\/p>\n<p><strong>video\/ogg<\/strong><br \/>\nAn ogg file containing video (and possibly also audio).<\/p>\n<p><strong>3. MP4 H.264<\/strong><br \/>\nThe MP4 container format with the H.264 video codec and the AAC audio codec is natively supported by desktop\/mobile Internet Explorer, Safari and Chrome, but Chromium and Opera do not support the format. IE and Chrome also support the MP3 audio codec in the MP4 container, but Safari does not. Firefox\/Firefox for Android\/Firefox OS supports the format in some cases, but only when a third-party decoder is available, and the device hardware can handle the profile used to encode the MP4.<\/p>\n<h3>1.4 A Basic Application<\/h3>\n<p>A very basic application where we insert a video into a webpage would be the following:<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!-- HTML SECTION  --&gt;\r\n&lt;video src=\"videos\/minions.mp4\" controls&gt;&lt;\/video&gt;\r\n&lt;!-- src to locate the video, controls attribute to show video controls --&gt;\r\n<\/pre>\n<p>In the top left side of your browser the video would show and require to press the play button to start:<br \/>\n<figure id=\"attachment_6282\" aria-describedby=\"caption-attachment-6282\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag1.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag1.jpg\" alt=\"Basic Video in HTML5\" width=\"820\" height=\"446\" class=\"size-full wp-image-6282\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag1.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag1-300x163.jpg 300w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6282\" class=\"wp-caption-text\">Basic Video in HTML5<\/figcaption><\/figure><\/p>\n<h3>1.5 HTML5 Video Browser Support<\/h3>\n<p>The following graphics show the support given to HTML5 video and its features by browsers.<br \/>\n<figure id=\"attachment_6285\" aria-describedby=\"caption-attachment-6285\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2.jpg\" alt=\"Browser Compatibility\" width=\"820\" height=\"822\" class=\"size-full wp-image-6285\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2-150x150.jpg 150w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2-300x300.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag2-70x70.jpg 70w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6285\" class=\"wp-caption-text\">Browser Compatibility<\/figcaption><\/figure><\/p>\n<h2>2. Cases and Examples<\/h2>\n<h3>2.1 Include Various Formats<\/h3>\n<p>There are three video formats that work natively in some browsers. Unfortunately, no format works in all browsers, so you need to do at least two if you want meaningful HTML5 video support.<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!-- HTML SECTION  --&gt;\r\n&lt;video controls&gt;\r\n  &lt;source src=\"videos\/minions.mp4\" type=\"video\/mp4\"&gt;\r\n  &lt;source src=\"videos\/minions.webm\" type=\"video\/webm\"&gt;\r\n  &lt;source src=\"videos\/minions.ogg\" type=\"video\/ogg\"&gt;\r\n&lt;\/video&gt;\r\n<\/pre>\n<p>Notice we used the <code>source<\/code> tag to add videos of different formats, and not inside the video tag as an attribute.<\/p>\n<p>Minimally, you must use MP4 + H.264, with AAC or MP3. MP4 video plays natively in Safari, Chrome, and IE9 (Vista\/Windows 7). It is also your best option for a Flash video fallback, and plays natively on many devices (iOS, Android, Blackberry, PSP, Xbox, PS3, etc.). Use H.264 High Profile for the best quality, or Baseline profile if you want the same video to be playable on mobile devices.<\/p>\n<p>Beyond that, use either WebM + VP8 or Ogg + Theora with Vorbis audio for other browsers. WebM works in Firefox (4+), Chrome (6+ or Chromium), and Opera (10.60+), and Ogg works in Firefox (3.5+), Chrome (3+), and Opera (10.54+).<\/p>\n<p>The result in the browser woulld be just the same video but compatible (able to be read) by all browsers.<br \/>\n<figure id=\"attachment_6287\" aria-describedby=\"caption-attachment-6287\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag3.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag3.jpg\" alt=\"Browser&#039;s interface for HTML5 Video\" width=\"840\" height=\"822\" class=\"size-full wp-image-6287\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag3.jpg 840w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag3-300x294.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag3-70x70.jpg 70w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/a><figcaption id=\"caption-attachment-6287\" class=\"wp-caption-text\">Browser&#8217;s interface for HTML5 Video<\/figcaption><\/figure><\/p>\n<h3>2.2 Custom Video Size<\/h3>\n<p>Attributes (most of which we mentioned and explained in the first section) are very useful when considering a customized video element that fits your needs inside the page. So in this section, we&#8217;ll have a look at how we can use the various attributes offered for the video element to enhance our content.<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!-- HTML SECTION  --&gt;\r\n&lt;!-- added a custom width and height for the video size and also autoplay --&gt;\r\n&lt;video width=\"640px\" height=\"320px\" autoplay controls&gt;\r\n  &lt;source src=\"videos\/minions.mp4\" type=\"video\/mp4\"&gt;\r\n  &lt;source src=\"videos\/minions.webm\" type=\"video\/webm\"&gt;\r\n  &lt;source src=\"videos\/minions.ogg\" type=\"video\/ogg\"&gt;\r\n&lt;\/video&gt;\r\n<\/pre>\n<p>The result would be a scaled video size that would automatically play as soon as the webpage is opened.<br \/>\n<figure id=\"attachment_6290\" aria-describedby=\"caption-attachment-6290\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag4.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag4.jpg\" alt=\"Autoplay is ON and the video is in a custom size!\" width=\"820\" height=\"440\" class=\"size-full wp-image-6290\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag4.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag4-300x160.jpg 300w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6290\" class=\"wp-caption-text\">Autoplay is ON and the video is in a custom size!<\/figcaption><\/figure><\/p>\n<h3>2.3 Using a Custom Poster for the Video<\/h3>\n<p>Attributes also provide us a very cool feature called the <code>poster<\/code>. It gives the video an inital default image to display before being played.<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!-- HTML SECTION  --&gt;\r\n&lt;!-- added a 'poster' attribute and specified the location of the poster image --&gt;\r\n&lt;video width=\"856px\" height=\"480px\" poster=\"image.jpg\" controls&gt;\r\n  &lt;source src=\"videos\/minions.mp4\" type=\"video\/mp4\"&gt;\r\n  &lt;source src=\"videos\/minions.webm\" type=\"video\/webm\"&gt;\r\n  &lt;source src=\"videos\/minions.ogg\" type=\"video\/ogg\"&gt;\r\n&lt;\/video&gt;\r\n<\/pre>\n<p>The result would be a poster image overlaying our video.<br \/>\n<figure id=\"attachment_6292\" aria-describedby=\"caption-attachment-6292\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag5.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag5.jpg\" alt=\"Poster Image over a HTML5 Video\" width=\"840\" height=\"568\" class=\"size-full wp-image-6292\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag5.jpg 840w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag5-300x203.jpg 300w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/a><figcaption id=\"caption-attachment-6292\" class=\"wp-caption-text\">Poster Image over a HTML5 Video<\/figcaption><\/figure><\/p>\n<h3>2.4 Fullscreen HTML5 Video<\/h3>\n<p>When talking about fullscreen video of HTML5, it all comes down to CSS (unless you want to use javascript). You can actually override any attributes regarding the size of the video and force a video to display fullscreen like this:<\/p>\n<pre class=\"brush:xml\">\r\n&lt;!-- HTML SECTION  --&gt;\r\n&lt;video width=\"856px\" height=\"480px\" autoplay&gt;\r\n  &lt;source src=\"videos\/minions.mp4\" type=\"video\/mp4\"&gt;\r\n  &lt;source src=\"videos\/minions.webm\" type=\"video\/webm\"&gt;\r\n  &lt;source src=\"videos\/minions.ogg\" type=\"video\/ogg\"&gt;\r\n&lt;\/video&gt;\r\n<\/pre>\n<p>Applying this CSS snippet will make it possible:<\/p>\n<pre class=\"brush:css\">\r\n&lt;!-- STYLE  SECTION --&gt;\r\n&lt;style type=\"text\/css\"&gt;\r\nvideo {\r\n    position: fixed;\r\n    top: 50%;\r\n    left: 50%;\r\n    min-width: 100%;\r\n    min-height: 100%;\r\n    width: auto;\r\n    height: auto;\r\n    z-index: -100;\r\n    -webkit-transform: translateX(-50%) translateY(-50%);\r\n    transform: translateX(-50%) translateY(-50%);\r\n}\r\n&lt;\/style&gt;\r\n<\/pre>\n<figure id=\"attachment_6295\" aria-describedby=\"caption-attachment-6295\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag6.jpg\"><img decoding=\"async\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag6.jpg\" alt=\"Fullscreen HTML5 Video\" width=\"840\" height=\"568\" class=\"size-full wp-image-6295\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag6.jpg 840w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/video-tag6-300x203.jpg 300w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><\/a><figcaption id=\"caption-attachment-6295\" class=\"wp-caption-text\">Fullscreen HTML5 Video<\/figcaption><\/figure>\n<h2>3. Conclusion<\/h2>\n<p>To conclude, HTML5 video is a quick and easy way to add video content to websites. It provides full compatibility with browsers and has a solid mobile device support. Built in video\/audio playback make it useless to consider third party players like before with quicktime, flash and silverlight (even though there are certain advantages why some pages still use them).<\/p>\n<p>Customization is pretty good for now and provides a very clean code. Do remember to convert videos into the right formats for all-browser compatibility, and shrink them in size as much as you can to prevent a slow page loading experience to the user.<\/p>\n<h2>4. Download<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/07\/HTML5-Video-Tag.zip\"><strong>HTML5 Video Tag<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page and videos could only be played with a plug-in (like flash). The HTML video element is used to embed video content. It may contain &hellip;<\/p>\n","protected":false},"author":75,"featured_media":914,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-6273","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML5 Video Tag Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML5 Video Tag Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/fabiocimo\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-18T09:15:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T11:49:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fabio Cimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fabiocimo\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fabio Cimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\"},\"author\":{\"name\":\"Fabio Cimo\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\"},\"headline\":\"HTML5 Video Tag Example\",\"datePublished\":\"2015-08-18T09:15:34+00:00\",\"dateModified\":\"2017-12-19T11:49:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\"},\"wordCount\":1225,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"articleSection\":[\"HTML5\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\",\"name\":\"HTML5 Video Tag Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"datePublished\":\"2015-08-18T09:15:34+00:00\",\"dateModified\":\"2017-12-19T11:49:17+00:00\",\"description\":\"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/html5\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML5 Video Tag Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\",\"name\":\"Fabio Cimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"caption\":\"Fabio Cimo\"},\"description\":\"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.\",\"sameAs\":[\"https:\/\/www.facebook.com\/fabiocimo\",\"https:\/\/al.linkedin.com\/in\/fabiocimo\",\"https:\/\/x.com\/fabiocimo\",\"https:\/\/www.youtube.com\/fabiocimo1\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML5 Video Tag Example - Web Code Geeks - 2026","description":"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/","og_locale":"en_US","og_type":"article","og_title":"HTML5 Video Tag Example - Web Code Geeks - 2026","og_description":"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page","og_url":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/fabiocimo","article_published_time":"2015-08-18T09:15:34+00:00","article_modified_time":"2017-12-19T11:49:17+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","type":"image\/jpeg"}],"author":"Fabio Cimo","twitter_card":"summary_large_image","twitter_creator":"@fabiocimo","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Fabio Cimo","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/"},"author":{"name":"Fabio Cimo","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22"},"headline":"HTML5 Video Tag Example","datePublished":"2015-08-18T09:15:34+00:00","dateModified":"2017-12-19T11:49:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/"},"wordCount":1225,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","articleSection":["HTML5"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/","url":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/","name":"HTML5 Video Tag Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","datePublished":"2015-08-18T09:15:34+00:00","dateModified":"2017-12-19T11:49:17+00:00","description":"The aim of this example is to introduce and show the usage of the video tag of HTML5. Before HTML5, there was no standard for showing videos on a web page","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-video-tag-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"HTML5","item":"https:\/\/www.webcodegeeks.com\/category\/html5\/"},{"@type":"ListItem","position":3,"name":"HTML5 Video Tag Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22","name":"Fabio Cimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","caption":"Fabio Cimo"},"description":"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.","sameAs":["https:\/\/www.facebook.com\/fabiocimo","https:\/\/al.linkedin.com\/in\/fabiocimo","https:\/\/x.com\/fabiocimo","https:\/\/www.youtube.com\/fabiocimo1"],"url":"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=6273"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6273\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/914"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=6273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=6273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=6273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}