0 out of 3 rated this helpful - Rate this topic

video object

Specifies the video content to be played in a document.

HTML5 A vocabulary and associated APIs for HTML and XHTML, Section 4.8.6Internet Explorer 9

Standards information

DOM Information

Inheritance Hierarchy

 Node
  Element
   HTMLElement
    HTMLMediaElement
      video

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

HTMLVideoElement

 

 

Send comments about this topic to Microsoft

Build date: 2/14/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Local file syntax not working
Local file syntax: "file://C:\yourfilepath.mp4" not working on Firefox and on Chrome , not checked on i.e. 9