TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML Video

HTML video or html 5 video tag with examples, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML Video Tag

HTML 5 supports <video> tag also. The HTML video tag is used for streaming video files such as a movie clip, song clip on the web page.

Currently, there are three video formats supported for HTML video tag:

  1. mp4
  2. webM
  3. ogg

Let's see the table that defines which web browser supports video file format.

Browsermp4webMogg
ie browser Internet Exploreryesnono
chrome browser Google Chromeyesyesyes
firefox browser Mozilla Firefoxyesyesyes
opera browser Operanoyesyes
safari browser Apple Safariyesnono

Android also supports mp4 format.

HTML Video Tag Example

Let's see the code to play mp4 file using HTML video tag.

<video controls>
  <source src="movie.mp4" type="video/mp4">
  Your browser does not support the html video tag.
</video>
Test it Now

Let's see the example to play ogg file using HTML video tag.

<video controls>
   <source src="movie.ogg" type="video/ogg">
  Your browser does not support the html video tag.
</video>

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<video>YesYesYesYesYes

Attributes of HTML Video Tag

Let's see the list of HTML 5 video tag attributes.

AttributeDescription
controlsIt defines the video controls which is displayed with play/pause buttons.
heightIt is used to set the height of the video player.
widthIt is used to set the width of the video player.
posterIt specifies the image which is displayed on the screen when the video is not played.
autoplayIt specifies that the video will start playing as soon as it is ready.
loopIt specifies that the video file will start over again, every time when it is completed.
mutedIt is used to mute the video output.
preloadIt specifies the author view to upload video file when the page loads.
srcIt specifies the source URL of the video file.

HTML Video Tag Attribute Example

Let's see the example of video tag in HTML where are using height, width, autoplay, controls and loop attributes.

<video width="320" height="240" controls autoplay loop>
  <source src="movie.mp4" type="video/mp4">
  Your browser does not support the html video tag.
</video>
Test it Now

MIME Types for HTML Video format

The available MIME type HTML video tag is given below.

Video FormatMIME Type
mp4video/mp4
oggvideo/ogg
webMvideo/webM
Next TopicHTML svg




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf