MediaElementJS play on startup with canPlay event

MediaElementJS is a cross platform video and music player, you can use it on desktop, mobile phone, mac… and it work smooth on almost browser. The good thing is it auto switch to client player html5, flash or silverlight if need. So it take care everything, we just install and use it.

In this article, we will focus to solve the problem about auto play after load, so you want to media play auto when user visit the site or open it on popup. It look easy but it take me entire of day to make it work on mobile browser iOS. And here is the key

MediaElement_js_-_HTML5_video_player_and_audio_player_with_Flash_and_Silverlight_shims

 

If you use HTML to embed player you can use like this

And use this js to play

Now try and see the result.

Good luck!

Leave a Reply

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

*