Sign in to follow this  
Followers 0
harry_ord

HTML5 video is not displayed in Firefox

3 posts in this topic

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

I see the video in Firefox, maybe you have an extension blocking it.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0