video will play in firefox but not when in html5 video tag?

13,257

Solution 1

When you just load the .mov file, the content-type your server provides causes Firefox to check and see and see if any plugins handle the content. In this case, QuickTime handles it, which is why it plays.

The video tag doesn't launch plugins to play content, however.

Solution 2

Firefox doesn't support h264, as you mentioned, although am surprised it plays the video in its own, unless its forcing it into a Flash player automatically, which is possible.

To get the "sorry" message to display you'll need to use the source element:

<video controls="controls" id="myVideo" poster="/media/uploads/2010/07/1495/still.jpg" height="360" width="640">
   <source src="/media/uploads/2010/07/1495/8_lg-poke.mov">
   Sorry - your browser is not supported!
</video>

I wrote this back in April of last year, but it might help: html5laboratory - using the video element.

Share:
13,257
v3nt
Author by

v3nt

Updated on July 03, 2022

Comments

  • v3nt
    v3nt almost 2 years

    so we're building a video site with a html5 player (and backup flash for windows).

    But what's really stumping me is when i view this file in firefox it plays; http://www.roguefilms.com.local/media/uploads/2010/07/1495/8_lg-poke.mov (stored locally) but when its in the html video tag is does nothing. It shows the poster but doesn't play the video. It doesn't even show the 'Sorry - your browser is not supported!'

    I know ff prefers ogg and we can use the flash backup player but if it can play it as a ht64 .mov without the player why can't it with? Seems a bit daft?

    If anyone knows anything it would be great...

    <video controls="controls"  
        id="myVideo"
        src="/media/uploads/2010/07/1495/8_lg-poke.mov"
        poster="/media/uploads/2010/07/1495/still.jpg" 
        height="360" 
        width="640">
    
                Sorry - your browser is not supported!
    
    </video>
    

    best, Dan.

  • v3nt
    v3nt over 13 years
    Hey Axel - Firebug says its definitely loading it(no errors either) and if it was an apache MIME-type problem wouldn't it be a problem for all the browsers? Just in case can i rectify this with line in a htaccess?
  • Axel Knauf
    Axel Knauf over 13 years
    I am not sure how different browsers behave in this situation. We fixed our MIME-type issue in Apache's mime.types config file using the AddType Directive to associate the file extensions with the proper types.
  • v3nt
    v3nt over 13 years
    thanks Ian - will have a read. FYI its def not using flash to play the direct link to the file - its using quicktime. And <video controls="controls" id="myVideo" height="380" width="640" > <source src="/media/uploads/2010/03/1422/29_mr-kipling-tiger.mov" type="video/mp4"> Your browser does not support the <code>video</code> element.</video> still doesn't show alt content? Just a big video element with a dark grey cross...
  • v3nt
    v3nt over 13 years
    ok Axel - just to clarify - this to just get ogg files playing? (which we prob wont be using due to server space)
  • Ian Devlin
    Ian Devlin over 13 years
    I believe that might mean that the .mov file is completely confusing Firefox so it fails at the first/only source element and doesn't go any further. Perhaps try addined the type (and codec) to it, which might tell Firefox to ignore it?
  • Axel Knauf
    Axel Knauf over 13 years
    Yes, just for .ogv files. As Ian mentioned above, FF does not support H.264 (.mp4) files for HTML5 video - we were using both formats to support multiple browser variants and a Flash player using .flv for anything not playing HTML5 videos.
  • Ian Devlin
    Ian Devlin over 13 years
    Flash will also play the MP4 which is useful if you're also provising MP4 for Safari and Chrome (although Chrome is dropping support for H.264 soon).
  • v3nt
    v3nt over 13 years
    ah - well that explains it then! Thanks sdwilsh.
  • v3nt
    v3nt over 13 years
    agh - seems like video is getting worse not better! Think we'll have to go h264 for everything and use html5 for safari/ipda etc but flash for everything else. There's no way our clients would pay for the extra space needed to have an ogg version too. Would double what was needed! Thanks guys. Dan.