Embedding a video in html5

Hello everyone. Please tell me how to make the insertion of a video in html5 displayed in all browsers. Which extensions should be used (. ogg, mp4, etc.) and what exactly should be specified in the TYPE attribute of the SOURCE tag.

Here is my example:

<VIDEO CONTROLS POSTER="IMAGES/poster.png">    
<SOURCE SRC="VIDEO/video.mp4" TYPE="video/mp4">    
<SOURCE SRC="VIDEO/video.ogg" TYPE="video/ogg">    
</VIDEO>

In my case, the video is only displayed in Safari, Chrome.

Author: Nicolas Chabanovsky, 2012-08-28

3 answers

In fact, video support, and indeed almost all HTML5 features are still very poorly supported in many modern browsers. An example is IE. Everything is very sparse there. Developers can only wait and slowly dare...

 0
Author: Salivan, 2012-08-28 11:14:39

With a combination of HTML5 and Flash, you can watch this video on almost any device and browser.

<!DOCTYPE html>
    <html>
     <head>
      <meta charset="utf-8" />
      <title>Видео</title>
     </head>
     <body>
      <video id="movie" width="400" height="320" preload controls>
       <source src="video/snowman.mp4" />
       <source src="video/snowman.webm" type='video/webm; codecs="vp8, vorbis"' />
       <source src="video/snowman.ogv" type='video/ogg; codecs="theora, vorbis"' />
       <object id="flowplayer" type="application/x-shockwave-flash" 
          width="400" height="320">
        <param name="movie" value="video/flowplayer-3.2.5.swf" /> 
        <param name="flashvars" value='config={"clip":"video/snowman.mp4"}' />
        <p>Загрузить видео в <a href="video/snowman.mp4">MP4</a>, 
             <a href="video/snowman.ogv">OGG</a> или 
             <a href="video/snowman.webm">WebM</a></p>
       </object>
      </video>
      <script>
       var v = document.getElementById("movie");
       v.onclick = function() {
        if (v.paused) {
         v.play();
        } else {
         v.pause();
        }
       };
      </script>
     </body>
    </html>
 0
Author: zloctb, 2012-08-28 07:59:07

Type does not need to be specified.

P.S. go here: Tag <video>.

 0
Author: kandi, 2012-08-28 11:10:16