Loading tutorials
audio and video elements. This one covers the simplest way to load a file into them, the src attribute, and what the browse4 min readaudio or video element with a src attribute and read a MIME type such as video/mp4. You don't need any encoding experience. By the end you should be able to read a codec string, predict whether a file will play, and pick sensible formats for the web.5 min read<audio> and <video> accept a src attribute, and have a rough idea of what a container and a codec are. Here you will learn how the <source> element lets the browser choose among several files, how it makes that choice, and what goes wr5 min read<audio> and <video> load a file with src, and have seen the <source> element. It covers what fallback content is, when a browser shows it, and what it cannot do.4 min read<video> or <audio> element with a src or <source> children. It covers the six attributes that set a media element's default playback behavior: controls, loop, muted, autoplay, preload, and `p4 min readvideo element with controls and source children. It also assumes you know basic CSS sizing: width, max-width, and the box model. Here you will control how large a video appears before and after it loads. You will also choose what viewers see bef4 min readasync/await work. It builds on the autoplay, muted, and playsinline attributes from the previous chapter on playback attributes. It also prepares you for 5 min readvideo element with controls, and know what a source element does. By the end you will be able to add captions and subtitles with the track eleme5 min readaudio and video, add a track element, and write basic JavaScript event handlers. It covers what accessibility requires of media, which parts the browser handles, and which parts you must supply.4 min readasync/await work. It covers the HTMLMediaElement API, which is the set of properties, methods, and events that <audio> and <video> elements share. You 4 min readasync/await. It also assumes you know the autoplay rules from the earlier chapter on browser restrictions. Here the focus is on what play() returns and how to react when it fails.4 min readplay() returns and the basics of the <audio> and <video> elements from earlier chapters. Here you will learn which events a media element fires, in what order, and how to use them to 4 min readHTMLMediaElement API, media events, and native form elements. It assumes you know the video element and its attributes, can add event listeners and use async/await, and have read the earlier cha4 min readvideo element is and why source elements offer several formats. The earlier chapters on containers, codecs, a5 min read<video> and <source> markup, and that you know basic HTTP: request and response headers, status codes, and what a web server does with a static file. The markup can be perfect and playback can still fail because of how the server delivers the file. Two things m5 min readhttps://app.example.com and a file at https://cdn.example.net/clip.mp4 are on different origins.5 min readvideo element, the src attribute, the HTMLMediaElement API, fetch, promises and async/await, and the basics of CORS and range requests from earlier chapters.5 min read