HTML Media

  • These are the elements which allow you to include images, audio files, videos, and other multimedia elements within your HTML documents.
  • Multimedia files have formats and different extensions like: .wav, .mp3, .mp4, .mpg, .wmv, and .avi.
block-inline

Here are HTML media elements:

1- HTML Video

  • HTML video element is used to show the video on the web page.
  • For this <video> tag is used.

Example:

class-image

How it Works

a) Controls:

  • With the help of control you can add play, pause and volume.

b) Height:

  • It is used to set the height of the element.

c) Width:

  • It is used to set the width of the element.

d) source:

  • It allows you to provide multiple sources for the media content, allowing the browser to choose the most appropriate source based on its supported formats.

Add muted after autoplay to your video to start playing video automatically but the video will be muted.

Example:

class-image

πŸš€ Try it yourself! Click the button below to run the code and see the output in action.

HTML Code

Output

Upar wale code pe src pe apne video ka path laga kr check karo πŸ˜€πŸ€ͺ

2- HTML Audio

  • HTML video element is used to show the audio file on the web page.
  • For this <audio> tag is used.

Example:

audio-example-image

How it Works

a) Controls:

  • With the help of control you can add play, pause and volume.

b) source:

  • It allows you to provide multiple sources for the media content, allowing the browser to choose the most appropriate source based on its supported formats.

Add muted after autoplay to your video to start playing video automatically but the video will be muted.

Example:

audio-example

πŸš€ Try it yourself! Click the button below to run the code and see the output in action.

HTML Code

Output

Important Note: Want to download the full HTML course as a PDF? Click here to save it locally!

Leave a Comment