I don't understand yesterday's class, what is the process of inserting video and audio

@kadilakshmi59
Here I will attach answer for your query which you have posted on MS Teams.
Please refer to this.

Have a Happy Learning!

1 Like

A. The HTML < video > Element

  1. To show a video in HTML, use the < video > element:

Example

< video width=“320” height=“240” controls >

 < source src="movie.mp4" type="video/mp4" >
 < source src="movie.ogg" type="video/ogg" >

< /video >

How it Works

The controls attribute adds video controls, like play, pause, and volume.

It is a good idea to always include width and height attributes. If height and width are not set, the page might flicker while the video loads.

The < source > element allows you to specify alternative video files which the browser may choose from. The browser will use the first recognized format.

The text between the < video > and < /video > tags will only be displayed in browsers that do not support the < video > element.

  1. HTML < video > Autoplay

To start a video automatically, use the autoplay attribute:

Example

< video width=“320” height=“240” autoplay >

 < source src="movie.mp4" type="video/mp4" >
 < source src="movie.ogg" type="video/ogg" >

< /video >

  1. Add muted after autoplay to let your video start playing automatically (but muted):

Example

< video width=“320” height=“240” autoplay muted >

 < source src="movie.mp4" type="video/mp4" >
 < source src="movie.ogg" type="video/ogg" >

< /video >

B. The HTML < audio > Element

1.To play an audio file in HTML, use the < audio > element:

Example

< audio controls >

<  source src="horse.ogg" type="audio/ogg"  >
<  source src="horse.mp3" type="audio/mpeg"  >

< /audio >

HTML Audio - How It Works

The controls attribute adds audio controls, like play, pause, and volume.

The < source > element allows you to specify alternative audio files which the browser may choose from. The browser will use the first recognized format.

The text between the < audio > and < /audio > tags will only be displayed in browsers that do not support the < audio > element.


HTML < audio > Autoplay

2.To start an audio file automatically, use the autoplay attribute:

Example

< audio controls autoplay >

<  source src="horse.ogg" type="audio/ogg"  >
<  source src="horse.mp3" type="audio/mpeg"  >

< /audio >

  1. Add muted after autoplay to let your audio file start playing automatically (but muted):

Example

< audio controls autoplay muted >

<  source src="horse.ogg" type="audio/ogg"  >
<  source src="horse.mp3" type="audio/mpeg"  >

< /audio >