HTML <video> srcProperty

HTML <video> Tag

Example

Play a video:

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

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the src attribute. However, not all browsers support the file formats defined.

Note:Internet Explorer 8 and earlier versions do not support the <video> tag.


Definition and Usage

The src attribute specifies the local path (URL) of the video file.

The above example uses an Ogg file, which displays correctly in Firefox, Opera, and Chrome.

To play video in Internet Explorer and Safari, you must use MPEG4 files.

If you want to play video files in all browsers - you can use the <source> element inside the <video> element.<source>The <source> element can link to different video files. The browser will use the first recognizable format:

Example

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

Try it »


Differences between HTML 4.01 and HTML5

The <video> tag is new in HTML5.


Syntax

<video src="URL.html">

Property value

Value Description
URL

The URL of the video file.

Possible values:

  • Absolute URL - Points to another site (e.g., href="http://www.example.com/song.ogg")
  • Relative URL - points to a file within a website (like href="song.ogg")


HTML <video> Tagother extensions