Q. 8 Write a program to insert an audio on web page.(4 M)
Answers
Explanation:
Steps For Inserting Video and Audio
Step 1
As I said in my older article, you can create a file and attach the template files to that file. Make sure that the file is saved under an .HTML extension.
Inserting Video And Audio In A Website
Step 2
After that an empty file will open on the screen. You can code on that, based on your requirements.
Inserting Video And Audio In A Website
Step 2.a
During the time when you need to insert only the video file, you can use the code given below:
<!DOCTYPE html>
<html>
<body>
<video width="1000" controls>
<source src="E:\Movies\The Expendables 3 (2014) HD (640x360).mp4" type="video/mp4">
</video>
</audio>
</body>
</html>
Step 2.b
When you need to insert only an audio file, you can use the code given below:
<!DOCTYPE html>
<html>
<body>
<audio width="200" controls>
<source src="E:\Download_2\Penne En Kannae Final Track.wav" type="audio/mpeg">
</audio>
</body>
</html>
Step 2.c
When you need to insert both a video and audio file, you can use the code below:
<!DOCTYPE html>
<html>
<body>
<video width="1000" controls>
<source src="E:\Movies\The Expendables 3 (2014) HD (640x360).mp4" type="video/mp4">
</video>
<audio width="200" controls>
<source src="E:\Download_2\Penne En Kannae Final Track.wav" type="audio/mpeg">
</audio>
</body>
</html>
The alignment of video and audio tag may change based on your needs.
Be aware of the extension of the file you are using. When you are using the do not forget to change the type = video/ogg.
Step 3
Now you can save the file. That file will be available at the place where you chose as the destination of the file.
Inserting Video And Audio In A Website
Now you can click and open it in a browser, there you can play those two media.
Inserting Video And Audio In A Website