harry_ord Posted November 16, 2016 Share Posted November 16, 2016 This is my site:http://feriapixel.cl/cleanway/index.phpAs 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? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 16, 2016 Share Posted November 16, 2016 I see the video in Firefox, maybe you have an extension blocking it. Link to comment Share on other sites More sharing options...
Ash! Posted December 18, 2016 Share Posted December 18, 2016 (edited) 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 December 18, 2016 by Ash! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now