Lecture

HTML Video Tag

The <video> tag allows you to display videos on a webpage.

The HTML video tag utilizes the src attribute to specify the path of the video file.

The video file path can either point to a local (same computer) file or an Internet URL address.

Inside the <video> tag, you can write alternative content to display when the video is not supported.

For example, you can specify the path of a video file with the following HTML code.

Local Video File
<video src="/src/birthday.mp4">Birthday</video>

Internet URL
<video src="https://www.my-drive.com/birthday.mp4">Birthday</video>

To actually display a video URL like http://media.w3.org/2010/05/sintel/trailer.mp4 on your website, you can write HTML as shown below.

Add a Video
<video src="http://media.w3.org/2010/05/sintel/trailer.mp4">Test Video</video>

However, using the video tag like this doesn't allow you to play or pause the video.

To add playback controls, you need to include the controls attribute in the video tag.

These controls consist of buttons like play/pause, volume adjustment, and a slider for adjusting the video progress.

Add Video Controls
<video src="http://media.w3.org/2010/05/sintel/trailer.mp4" controls> Test Video </video>

By adding the "controls" attribute to the video tag as shown above, you can play or pause the video.

Lecture

AI Tutor

Design

Upload

Notes

Favorites

Help