Mediaelement.js autoplay function does not work on mobile devices

I am using mediaelement.js to display a video. I am using this code:

<body> <video id="player1" style="width: 100%; height: 100%;" preload="auto" autoplay="true" src="video.mp4" /> <script> $('video').mediaelementplayer({ features: ['playpause','progress','current','duration','tracks','volume','fullscreen'], }); var player = new MediaElementPlayer('player1'); player.play(); </script> </body> 

When the page loads, I would like to start the video automatically. This works great on desktop browsers, but video doesn't play automatically on mobile browsers.

What am I doing wrong?

+8
javascript android
source share
1 answer

A duplicate of this, I think: How to auto-play HTML5 mp4 video on Android?

+1
source share

All Articles