title: Is there a way to play mpeg videos in HTML5?
body: <p>My pc based web application uses HTML5, and I want to import mpeg files to play in my browser which have been saved that way by other application. Is there a way to play these video files with HTML5? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The application tries to play the mpeg files from the local hard drive rather than from the server. So, user has an ability to choose the mpeg files to play the selected mpeg files. </p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input id="t20provideoinput" type="file" multiple accept="video/*"/&gt;
  &lt;video id="t20provideo" controls controls&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>(function localFileVideoPlayerInit(win) {
      var URL = win.URL || win.webkitURL;
      var sources = [];
      var j = 1;
      var videoNode = document.querySelector('video');
      var videoNode1 = document.querySelector('object');
      var groupElement = document.getElementsByClassName('metric')[0];
      console.log('this is group element ' + groupElement);
  
      var playSelectedFile = function playSelectedFileInit(event) {
              for(var i=0; i&lt;this.files.length; i++){
                  var file = this.files[i];
  
                  var type = file.type;
  
  
                  var fileURL = URL.createObjectURL(file);
  
                  sources.push(fileURL);
              }
  
              groupElement.addEventListener('click', function(){
                  videoNode.src = sources[0];
              });
          };
  
      var inputNode = document.getElementById('t20provideoinput');
  
      videoNode.addEventListener('ended', function(){
         videoNode.src = sources[j++];
         videoNode.load();
         videoNode.play();
      }, false);
  
      if (!URL) {
          displayMessage('Your browser is not ' + 
             '&lt;a href="http://caniuse.com/bloburls"&gt;supported&lt;/a&gt;!', true);
  
          return;
      }                
  
      console.log(inputNode);
      if (inputNode != null) { 
          inputNode.addEventListener('change', playSelectedFile, false);
      }
  
  }(window)); 
  </code></pre>
  
  <p>modified from <a href="http://jsfiddle.net/dsbonev/cCCZ2/embedded/result,js,html,css/presentation/" rel="noreferrer">http://jsfiddle.net/dsbonev/cCCZ2/embedded/result,js,html,css/presentation/</a></p>
  
  <p>I tried few things like adding plugins to the browser, used <code>Mediaelement.js</code>, used <code>object</code> tag to see if those selected mpeg files can be played. But, the attempts were unsuccessful.</p>
  
  <p>Below is the code snippet where I used the object tag in html5</p>
  
  <pre><code>&lt;object type="video/mpeg" data="test.mpeg" width="200" height="40"&gt;
    &lt;param name="src" value="test.mpeg" /&gt;
    &lt;param name="autoplay" value="false" /&gt;
    &lt;param name="autoStart" value="0" /&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>Any suggestion is highly appreciated.</p>