<?xml version="1.0" encoding="utf-8"?>

The <source> tag for video

The <source> tag for video

There are 2 ways to specify the path to the media you want to embed. The easiest is to use the src attribute inside the <video> tag. However, sometimes you want to offer alternative sources for multiple file formats to provide compatibility with a broad range of browsers. In that case, use the <source> element for each format inside the <video> tag. For each source, you need to specify the URL with the required src attribute. 

You also want to add the type attribute to let the browsers know the embedded media type (aka MIME type).

For video content, the syntax could be:

video/ogg

video/mp4

video/webm

Top contributors

Adrian Ye

Topics

From Lesson

Share

Improve your UX & Product skills with interactive courses that actually work