I can't launch an autoplay video on a website on mobile, tapping won't work either.
<video width="270" height="533" id="video" autoplay muted loop>
<source src="img/Mockup.mp4" type="video/mp4">
</video>
I also tried with
document.getElementById('video').load();
I have no clues how to fix it. Any tips ?
Thanks !
I can't launch an autoplay video on a website on mobile, tapping won't work either.
<video width="270" height="533" id="video" autoplay muted loop>
<source src="img/Mockup.mp4" type="video/mp4">
</video>
I also tried with
document.getElementById('video').load();
I have no clues how to fix it. Any tips ?
Thanks !
Share Improve this question edited Jun 17, 2020 at 9:39 ADyson 62.2k16 gold badges79 silver badges92 bronze badges asked Jun 17, 2020 at 9:05 Pickle_RickPickle_Rick 1211 silver badge7 bronze badges 4- 1 any errors in the console? "won't work" isn't much in the way of useful debugging info. – ADyson Commented Jun 17, 2020 at 9:08
- Nop no errors, by the way is there a way to inspect it with my phone ? – Pickle_Rick Commented Jun 17, 2020 at 9:12
- Yes. developers.google./web/tools/chrome-devtools/… – ADyson Commented Jun 17, 2020 at 9:17
- 1 Well, just figured it out. There was no problem on Android so I had to add playsinline and now it works fine ! – Pickle_Rick Commented Jun 17, 2020 at 9:24
1 Answer
Reset to default 5For anyone interested for Ios you have to add playsinline
inside your video tag to make it works. See there : HTML5 Video autoplay on iPhone
Cheers !