Easy Tutorial
❮ Att Audio Preload Att Select Multiple ❯

HTML <video> src Attribute

HTML <video> Tag

Example

Play a video:


Browser Support

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

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 example above uses an Ogg file, which can be displayed correctly in Firefox, Opera, and Chrome.

To play videos in Internet Explorer and Safari, you must use an MPEG4 file.

To play video files in all browsers, you can use the <source> element within the <video> element. The <source> element can link to different video files. The browser will use the first recognizable format:

Example


Differences Between HTML 4.01 and HTML5

The <video> tag is a new tag in HTML5.


Syntax

Attribute Values

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")<br>relative URL - points to a file within the website (e.g., href="song.ogg")

❮ Att Audio Preload Att Select Multiple ❯