English

In a webpage, an audio file is embedded using element as per following code. But when HTML page is opened in Chrome browser, nothing is shown. What could be the possible reason?

Advertisements
Advertisements

Question

In a webpage, an audio file is embedded using element as per following code. But when HTML page is opened in Chrome browser, nothing is shown. What could be the possible reason?

<audio src="beyonce.mp3" >
   Your browser does not support
   AUDIO element.
</audio>
Code Writing
Short Answer
Advertisements

Solution

Because there was no method to play the music due to the missing controls attribute, the audio file was invisible. To enable the user to hit “play”, we need to provide the audio file with some controls.

Therefore, the corrected code is:

<audio src="beyonce.mp3" controls="controls">
Your browser does not support AUDIO element.
</audio>
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: HTML- III: Audio, Video and Forms - Assisted Practice [Page 229]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 5 HTML- III: Audio, Video and Forms
Assisted Practice | Q 1. | Page 229
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×