What is Multimedia?
Multimedia comes in many different formats. It can be almost anything you can hear or see.
Examples: Images, music, sound, videos, records, films, animations, and more.
Web pages often contain multimedia elements of different types and formats.
In this chapter you will learn about the different multimedia formats.
Multimedia comes in many different formats. It can be almost anything you can hear or see.
Examples: Images, music, sound, videos, records, films, animations, and more.
Web pages often contain multimedia elements of different types and formats.
In this chapter you will learn about the different multimedia formats.
* 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.* 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">
Your browser does not support the video tag.
</video>
Example 2
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div style="margin-left:30%;"> | |
<h3> For Example </h3> | |
<video src="mov_bbb.mp4" height="300px," width="300px;" controls> | |
</video> | |
</div> | |
</body> | |
</html>The HTML <audio> Element
To play an audio file in HTML, use the
<audio> element:Example
<audio controls>
|
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.
Comments