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
Can you change your code as per below code and see if it works:
Add the
type
attribute to thesource
tag and a fallback notice to see if your browser can handle mp4 files: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 secondsource
tag for it.Appart from that you should also check the filepath to the video file.