Jump to content

HTML5 video is not displayed in Firefox

Recommended Posts

This is my site:


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 -->
      (function() {
         * Video element
         * @type {HTMLElement}
        var video = document.getElementById("my-video");

         * Check if video can play, and play it
        video.addEventListener( "canplay", function() {

I need to add something for Firefox?

Link to post
Share on other sites
  • 1 month later...

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">
Edited by Ash!
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.

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.

  • Create New...