skip to Main Content

I have this

<video playsinline autoplay loop width="100%" height="100%" id="mainVideo">
        <source src="1.mp4">
    </video>

and its showing the poster but no video. I have tried using controls and pressing play there but it just didnt do anything with my clicks.

No, there isnt anything wrong with my codecs. No the video isnt corrupt. Yes I am on mobile, but Ive gone through deep measures to assure that doesnt affect anything video. It is not a security measure put in place by what I am using to develop. I have looked at every other post on here about this and tried everything. I am on and off trying to tackle this and it has taken up almost 5 hours total. Can somebody please tell me what could possibly be going wrong here๐Ÿ™๐Ÿ™

2

Answers


  1. Can you change your code as per below code and see if it works:

    <video playsinline autoplay loop width="100%" height="100%" id="mainVideo" src="1.mp4">
        </video>
    
    Login or Signup to reply.
  2. Add the type attribute to the source tag and a fallback notice to see if your browser can handle mp4 files:

    <video playsinline autoplay loop width="100%" height="100%" id="mainVideo">
        <source src="1.mp4" type="video/mp4">
        Sorry, this browser cannot play mp4 files.
    </video>
    

    If the fallback output "Sorry, this browser cannot play mp4 files." appears,
    the problem lies in the browser you use. In this case (and actually anyway, since other people will use different browsers) you should also add an ogg version of the video and a second source tag for it.

    Appart from that you should also check the filepath to the video file.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search