title: Firefox opens MP4 file in a new tab instead of an HTML video player
body: <p>I have made an MP4 video player according to this tutorial: <a href="http://www.lastrose.com/html5-audio-video-playlist/" rel="nofollow noreferrer">http://www.lastrose.com/html5-audio-video-playlist/</a>.</p>
  
  <p>It works well in Chrome and Internet Explorer, but Firefox is opening each link as an MP4 file in a new tab. It plays the first video in the playlist just fine, but when any link in the playlist is clicked, Firefox opens a new tab instead of sending it to the player.</p>
  
  <p>Firefox says:</p>
  
  <blockquote>
    <p>TypeError: video[0].play is not a function.</p>
  </blockquote>
  
  <p>I've just changed the audio variable name to video:</p>
  
  <pre><code>function init() {
      current = 0;
      video = $('#video');
      playlist = $('#playlist');
      tracks = playlist.find('li a');
      len = tracks.length - 1;
      video.volume = .10;
      video[0].play();
      playlist.find('a').click(function (e) {
          e.preventDefault();
          link = $(this);
          current = link.parent().index();
          run(link, video[0]);
      });
      video[0].addEventListener('ended', function (e) {
          current++;
          if (current == len) {
              current = 0;
              link = playlist.find('a')[0];
          } else {
              link = playlist.find('a')[current];
          }
          run($(link), video[0]);
      });
  }
  </code></pre>
  
  <p>I have found old topics about this, saying that Firefox just can't play MP4 in an HTML video player, but I wonder if that's still the case.</p>