Autoplay for mediaElementJS on mobile

The autoplay on mediaElementJS work a little different from normal way. If you think you just need to capture the success event then play it, you will be fail to play. That ‘s why I post this tips, hope it will save your time.

mediaelementplayer

This is a bug in MediaElementJS, autoplay works for native and silverlight, but needs a little help with Flash.

You can listen for canPlay event and start playing as soon as the flash player is ready.

setTimeout tricks may fail in race conditions.

It solved my problem and now it ‘s yours.

2 comments

  1. Does it work on desktop or only the solution for mobile?

Leave a Reply

Your email address will not be published. Required fields are marked *

*