Video - Multiple Sources - Exercise

Contact Us or call 1-877-932-8228
Video - Multiple Sources - Exercise

Video - Multiple Sources

Duration: 10 to 15 minutes.

In this exercise, you will create an HTML5 file from scratch that plays video files.

  1. Create a new HTML5 file called video-multiple-sources.html in the html5-audio-and-video/Exercises directory.
  2. Write the code to include the justin.mp4 (mime type is video/mp4) and justin.ogv (mime type is video/ogg) files as source options. Both files are located in the html5-audio-and-video/Media directory.
  3. Play around with video attributes such as: controls, autoplay, and loop.

Solution:

html5-audio-and-video/Solutions/video-multiple-sources.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>HTML5 Video - controls</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>HTML5 Video - controls</h1>
<video controls autoplay height="480" width="360">
	<source src="../Media/justin.mp4" type="video/mp4">
	<source src="../Media/justin.ogv" type="video/ogg">
</video>
</body>
</html>
Next