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?
Bv202
source share