Loading tutorials
src attribute on audio and video, how the browser loads the file, and the errors you will meet most often.2 min read<audio> or <video> element on a page. Here you will learn why a file that plays on one device can fail on another, and how to choose formats that work widely.2 min readsrc points an element at a file, and know the difference between a container and a codec. No JavaScript is needed except in the last example.2 min readsource elements list alternative formats, and that a video or audio element can contain child elements. Here you will learn what fallback content is, when a browser shows it, and how to write fallback that helps people.2 min readaudio and video load a file with src, and have seen a source element. Boolean attributes (ones that are on when present) control most playback behavior. You will see what each attribute does and which ones to combine for common use case2 min readvideo element loads a file. It covers how a video gets its size, how to reserve space before it loads, and how to show a poster image.2 min readvideo element's basic attributes, JavaScript event listeners, and promises with async/await.2 min readvideo element with controls and a source list, and that you know how HTML attributes work. Here you add timed text to a video with the track element and a WebVTT file.2 min readvideo element and source element work, and are comfortable with JavaScript event listeners. It covers what a page must provide so that people who cannot see, hear, or use a mouse can use your media.2 min readquerySelector, attach event listeners, and use promises with async/await. It also assumes you can already embed a <video> or <audio> element.2 min readasync/await work. It also assumes you have read the chapter on why autoplay is restricted.2 min readplay() and pause() work on a media element.2 min readHTMLMediaElement API, media events, and how play() returns a promise. You also need basic keyboard behavior for form controls.2 min readsource element from earlier chapters. It shows how to ask the browser whether it can play a given format before you choose a file.2 min readaudio and video markup, read HTTP headers in browser developer tools, and edit a basic web server configuration. Markup can be perfect and a video will still fail if the server delivers the file badly. Two things matter most: the Content-Type header and suppo2 min readsource and track elements from earlier chapters.2 min readvideo element, its src attribute, and basic JavaScript with async/await. It explains why a plain src is sometimes not enough, and what to use instead.2 min read