From the course: Learning Web Audio and Video

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Include fallback content

Include fallback content

From the course: Learning Web Audio and Video

Start my 1-month free trial

Include fallback content

- [Instructor] What would happen if an older web browser is being used which doesn't support the HTML 5 audio element at all? We can easily specify fallback content in such cases. What we'll do is just insert a little bit of content within the audio tag just directly after our different source listings. So, I'll paste in a little text message here that says sorry, your browser does not support the audio element. Now we have a fallback in case it's an HTML 5 compatible browser that does not support MP3. It'll go to OGG, and if it doesn't support the audio element altogether, it'll display this fallback content. Note that you could also use something like an image here if you wished. We'll go ahead and save this and have a look inside the web browser. Of course, since Google Chrome does support the HTML 5 audio element and the MP3 file format, that's what's being loaded here. However, we can see in the source code that our fallback text does exist. For older browsers that don't support…

Contents