HTML5 Game - Set the Video Source and Format for video element

Introduction

To set the video source, use the src attribute.

You can set the URL of the video file that is required.

The following code shows an example using the src Attribute.

Demo

ResultView the demo in separate window

<!DOCTYPE HTML>
<html>

<head>
    <title>Example</title>
</head>//from w  w w. ja  v a2 s  .c om

<body>
    <video src="http://java2s.com/style/demo/your.webm" controls width="360" height="240">
        Video cannot be displayed
    </video>
</body>

</html>

Related Topic