video object
Specifies the video content to be played in a document.
![]() ![]() |
Standards information
- HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.6
DOM Information
Inheritance Hierarchy
Examples
The following code example shows how to play a video by using HTML5.
Using one of the following formats, type the name of an MP4-format video file into the text box:
- Local file syntax: "file://C:\yourfilepath.mp4"
- Web file syntax: "http://webfilepath.mp4"
<html> <head> <title>Simple Video Example</title> <script type="text/javascript"> function playVideo() { var oInput = document.getElementById('videoFile'); //text box var oVideo = document.getElementById('video1'); //video element oVideo.src = oInput.value; oVideo.play(); } function pauseVideo() { var oVideo = document.getElementById('video1'); oVideo.pause(); } </script> </head> <body> <video id="video1" controls >HTML5 video is not supported</video> <input type="text" id="videoFile" size="60" /> <button onclick="playVideo();">Play</button> <button onclick="pauseVideo();">Pause</button> </body> </html>
See also
Send comments about this topic to Microsoft
Build date: 2/14/2012

