Let visitors play a recording.
What to build
An audio player.
Requirements
- An
audioelement with thecontrolsattribute. - A
sourceinside it, withsrc="talk.mp3"andtype="audio/mpeg". - A fallback link inside the
audioelement, going totalk.mp3.
Constraints
Use source, rather than a src on audio.
Example
The fallback only appears in browsers that cannot play the audio.
Why it works
The browser plays the first source it supports, and it shows the fallback only if it cannot.
Hints
Hint 1
Without the controls attribute, there is nothing to press.
Solution
Show one correct solution (try it yourself first)
<h1>Yesterday's talk</h1> <audio controls> <source src="talk.mp3" type="audio/mpeg"> <a href="talk.mp3">Download the talk</a> </audio>