Computer Applications
Gulzar is a talented musician. He is trying to create a web page so as to share his creations with music lovers across the world. He wants to embed audio and video files in the web page with the following specifications :
To embed audio files :
(i) The name of audio file is GulzarNote1.mp3
(ii) The audio should start playing automatically when the page loads.
(iii) The audio controls such as Play, Pause and Volume should be visible.
To embed video files :
(i) The name of video file is GulzarMovie1.mp4
(ii) The video should play in a window of width 350 pixels and height 250 pixels.
(iii) The video controls such as Play, Pause and Volume should be visible.
To complete the task, Gulzar has written the following HTML code :
To embed audio :
<audio controls autoplay>
<source src = "GulzarNote1.mp3">
</audio controls>
To embed video :
<video width = "350" height = "250">
<source src = "GulzarMovie1.mp4">
</video>
Gulzar is not getting the desired output as the code contains errors. Rewrite the correct statements to help him to complete the task. Underline all the corrections made.
Answer
Gulzar's HTML code for embedding audio and video has a few errors. The correct HTML code is as follows:
To embed audio :
<audio controls autoplay>
<source src = "GulzarNote1.mp3">
</audio>
Explanation
controls attribute should be written only in the opening audio tag and not in the closing audio tag.
To embed video :
<video width = "350" height = "250" controls>
<source src = "GulzarMovie1.mp4" type="video/mp4">
</video>
Explanation
Controls attribute has been added to the opening video tag and the type attribute has been added to source tag.
Related Questions
Differentiate between the terms Web Site and Web Page.
What is a Web Browser? Write the names of any two commonly used Web Browsers.
Rohan is creating a Web page in HTML. He wants to insert a link in his Web page to appear with the text as "Click to Open" which on clicking should open the URL named
'http://www.Mywebsite.com'in a new window. Help him to write the HTML code to create the hyperlink.Write any two differences between the Outline and Border-style properties of CSS.