Jump to content
Sign in to follow this  
harry_ord

HTML5 video is not displayed in Firefox

Recommended Posts

This is my site:

http://feriapixel.cl/cleanway/index.php


As you can see, if you are using Chrome, it has a video background at the beginning, but when i view it with Firefox, the video doesn't appear at all.

This is the HTML and javascript of my video:

 <video id="my-video" class="video" muted loop>
      <source src="videos/Clean_Way.mp4" type="video/mp4">
      <source src="videos/Clean_Way.webm" type="video/webm">
    </video><!-- /video -->
   
    <script>
      (function() {
        /**
         * Video element
         * @type {HTMLElement}
         */
        var video = document.getElementById("my-video");

        /**
         * Check if video can play, and play it
         */
        video.addEventListener( "canplay", function() {
          video.play();
        });
      })();
      </script>

I need to add something for Firefox?

Share this post


Link to post
Share on other sites

Hi harry_ord!

 

Looks like the MP4 format is not working on Firefox, but the WebM works fine.

I think swapping the orders of mp4 and webm files, like below, would do the trick.

<video id="my-video" class="video" muted="" loop="" controls="">
    <source src="videos/Clean_Way.webm" type="video/webm">
    <source src="videos/Clean_Way.mp4" type="video/mp4">
</video>
Edited by Ash!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...