Don Tomato
Don Tomato

Reputation: 3539

HTML5 video doesn't work in Firefox and IE when I use video files locally

Maybe somebody had faced with such problem? I just have tried to use Video-JS player. First time I used the following markup:

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" 
        width="640" height="264"
        poster="http://video-js.zencoder.com/oceans-clip.png"
        data-setup="{}">
    <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
    <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
    <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
    <track kind="captions" src="captions.vtt" srclang="en" label="English" />
</video>

Everything was ok. Then I downloaded these three files - mp4, webm and ogv, and placed them locally into the directory of my site. Markup:

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" 
  width="640" height="264"
  poster="http://video-js.zencoder.com/oceans-clip.png"
  data-setup="{}">
      <source src="/Content/Images/Data/Media/oceans-clip.mp4" type='video/mp4' />
      <source src="/Content/Images/Data/Media/oceans-clip.webm" type='video/webm' />
      <source src="/Content/Images/Data/Media/oceans-clip.ogv" type='video/ogg' />
      <track kind="captions" src="/Scripts/video-js/captions.vtt" srclang="en" 
            label="English" />
</video>

Now it works fine in Chrome, but doesn't work in Firefox and IE. Before I tried to use the other HTML5 player - Leanpack, and I had faced with the same behaviour. What is cause of problem?

Upvotes: 0

Views: 6402

Answers (3)

Igshaan
Igshaan

Reputation: 11

Change the file extension from .ogv to .ogg. It works well.

Upvotes: 1

Dirty Bird Design
Dirty Bird Design

Reputation: 5553

Add the absolute path to the mp4 file and IE9 will play it. See answer on video.js help guide from Jonas

Upvotes: 0

Olly Hodgson
Olly Hodgson

Reputation: 15793

Your server (even if it's localhost) needs to be set up to provide the correct mime types or the fussier browsers won't play back the files. See dive into html5 for more information.

Upvotes: 2

Related Questions