HTML - SPLessons

HTML5 Examples

Chapter 44

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

HTML5 Examples

HTML5 Examples

shape Introduction

This chapter demonstrates about the HTML5 Examples, some media files are inserted into web documents. Following are the concepts are covered in this chapter.

  • HTML5 Audio
  • HTML5 Video

HTML5 Audio

shape Description

With the use of HTML5 User can play audio, video and also play graphic files without using JavaScript. The below examples demonstrate the use of some HTML5 elements. The image below demonstrates HTML5 media controls.

The code below demonstrates to play the audio file by using the HTML5.

<html>
	<head>
		<title> HTML5 Exampless</title>
	</head>
	<body>
		<audio controls>
		<source src="horse.ogg" type="audio/ogg">
		<source src="horse.mp3" type="audio/mpeg">
		</audio>
	<body>
</html>

Result

By running the above code in a preferred browser user can get the following output as shown in below audio file.

HTML5 Video

shape Description

By using the HTML5 user can insert the video files into the web page. The code below demonstrates how to insert the video file into the HTML document.

<html>
	<head>
		<title> HTML5 Exampless</title>
	</head>
	<body>
		<video width="400" controls>
			<source src="mov_bbb.mp4" type="video/mp4">
			<source src="mov_bbb.ogg" type="video/ogg">
		</video>
	<body>
</html>

Result
By running the above code in a preferred browser user can get the following output as shown below.

Summary

shape Key Points

  • User need to give the source of the media file.
  • HTML5 is the most flexible language.