HTML Video

You can add audio and video file to be played as the background sound of a Web page.

The audio and video file start playing when the Web page loads . Lets create a Web page named abc.html to set an audio file as the background sound in a Web page.

 

 

Example of Audio file in a Background : –

<!DOCTYPE HTML>

<html>

<head>

<title> Audio file in a background</h1>

<audio src="abc.ogg" autoplay="true">

</audio>

</body>

</html>

 

When you open the abc.html audio file in a Web browser, you observe that the background sound starts playing automatically. This audio file is played only one.

Embedding an Audio File Using the Embed Element : –

<!DOCTYPE HTML>

<html>

<head>

<title> Embedding example in a Audio file</title>

</head><body>

<h1> Working on Audio file</h1>

<embed src="abc.mp3" width="600" height="200"></embed>

</body>

</html>

Example of video file :- 

<!DOCTYPE HTML>

<html>

<head> <title> Adding a Video file</title>

</head>

<body>

<h1> Playing a Video file</h1>

<br/>

<object data="abc.wmv" type="video/wmv" width="500" height="300"/>

</body>

</html>

 

Example of HTML Video file :- 

<!DOCTYPE HTML>

<html>

<head>

<title>Using Video Element</title>

</head>

<body>

<h1> Video Element</h1>

<video src="abc.mp4" controls></video>

</body>

</html>

 




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top