admin管理员组文章数量:1410724
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 !
本文标签: javascriptVideo won39t play on Safari amp Chrome mobile even with muted autoplayStack Overflow
版权声明:本文标题:javascript - Video won't play on Safari & Chrome mobile even with muted autoplay - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744830923a2627341.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论