Explain with the help of code, how audio and video clips can be added in an HTML document.
Answers
Explanation:
<video> element + autoplay attribute (without controls attribute)
Audio can be added in an HTML document using <audio> tag
Example 1
<audio controls>
<source src="dhun.ogg" type="audio/ogg">
<source src="dhun.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Example 2
<audio src="dhun.ogg" controls>
audio element not supported by your browser
</audio>
- 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.
- Currently there are three supported file formats for the <audio> element: mp3, wav and ogg.
- we can also use autoplay attribute to auto start playing the audio in the browser.
<audio controls autoplay>
- we can also use loop attribute to play the audio in loop.
<audio controls autoplay loop>
video can be added in an HTML document using <video> tag
It is similar to audio element.
Example 1
<video width="320" height="240" controls>
<source src="youtube.mp4" type="video/mp4">
<source src="youtube.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
Example 2
<video src="youtube.mp4" controls>
video is not supported by your browser.
</video>
- we can also use autoplay, loop attributes for video element.
- currently there are three supported video formats for the <video> element: mp4, webm and ogg.
More Question:
HTML Meaning: what is html?
https://brainly.in/question/643321