Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML video src Attribute

HTML

HTML video Tag Reference HTML

Example

Play a video:

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

Note: Internet Explorer 8 and earlier IE versions are not supported.


Definition and Usage

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

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

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

If you want to play a video file in all browsers - you can use

Example

Try it »


Differences between HTML 4.01 and HTML5


Syntax

Attribute values

Value Description
URL

The URL of the video file.

Possible values:

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

    HTML video Tag Reference HTML