Advertisement
Home Open Editor ❯

HTML <video> src Attribute

Example

<video src="video.mp4" width="340" height="260" controls>
  Your browser does not support the video tag.
</video>

Try this code ❯

Meaning

src attribute is set to the URL of the video to show.

To support all browsers - add several <source> elements inside the <video> element. Each <source> elements can link to different video files. The browser will use the first recognized format and play the video which support.

Example

<video width="340" height="260" controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.webm" type="video/webm">
  Your browser does not support the video tag.
</video>

Try this code ❯

Standard Syntax

<video src="URL">...</video>


Advertisement

Attribute Values

Value Description
URL

Value can be

  • An absolute URL - source within or another web site ( href="http://www.example.com/index.html")
  • A relative URL - source within a web site ( href="index.html")
Home Open Editor ❯
Advertisement