问题
Yahoo has a mediaplayer to play media on a webpage:
http://mediaplayer.yahoo.com/
but there is no option to make it auto start.
What is the best way to make it autostart, by hacking into the code, or it can also be using jQuery to "click" on one of the media to auto start it, although, how do you know the Yahoo code has finish initializing? We can use a setTimeout(function() { // click first one }, 3000)
but it seems too much of a hack.
回答1:
There is an option for this.
Plz check at this page http://mediaplayer.yahoo.com/api/#example_usage
If u set autoplay:true, the first song will be started automatically..
来源:https://stackoverflow.com/questions/3130471/what-is-the-best-way-to-make-the-yahoo-media-player-autostart-jquery