HTML Basics: Get Noticed – The Ultimate Guide to Embedding Video Content on Your Web Page

Deutsch

Add a Video Player to Your Web Page

Want to add a video player to a web page without knowing how to add a media player to HTML pages? The new HTML5 VIDEO tag is used to add video content to an HTML page. This makes it easy to add a video, such as a movie clip, to your web page without having to use any video plug-in.

All recent web browsers, including mobile versions, support the video command very well. There are no compatibility issues with video playback.

The HTML5 VIDEO-Tag adds native support to playback a video within an HTML page.

The video tag of HTML5 is a standard technique for including video into a web page. Unfortunately, browser manufacturers have yet agreed on a common standard for which video codecs should (or can or must) be used.

The HTML <video> Tag

There are three different video formats that have been established for video. These are: OGV (Ogg Theora), MP4 (H.264), and the royalty-free open-source WebM media file format for storing video content, that was created in 2010 by Google.

WebM is an open-source alternative to the proprietary MPEG4 and H.264 standards. While WebM is typically smaller than MP4, MP4 offers better cross-platform and cross-device compatibility. MP4 is also supported by the overwhelming majority of video players on the market.

Why do two different video formats exist, which are supported or not supported depending on the browser? To keep this from becoming too simple, the browsers only support one or the other video format for licensing reasons.

For the basic functionality of the HTML5 video player, it is sufficient to specify only the video URL in the <video> tag. Add the video URL by using either the src attribute of the <video> tag or by nesting one or more <source> tags between the opening and closing video tags.

The video tag starts with <video> and has to be closed with </video>.

To embed a video player, insert the following code into your web page.

Example
<video controls>
    <source="/en/video/anime-butterfly-480p.mp4" type="video/mp4">
    Your browser does't support this audio format.
</video>
Output of the HTML code

A control panel is displayed when the controls attribute is specified. This allows the user to change the volume or pause and start playback. The controls attribute should always be specified.

The type attribute is required since there are different video formats which are either supported or not supported for licensing reasons, depending on the browser and browser version.

The MP4 format is supported by all current browsers. You only need to specify the Ogg video format if older browsers must also be supported.

Additional Attributes for the Video Player