tag:blogger.com,1999:blog-7218232242203115351.post2006481594741118815..comments2022-12-03T19:15:22.416-07:00Comments on One Man Clapping: Hacking the Yahoo! Media PlayerGary Dusbabekhttp://www.blogger.com/profile/02822527825865902304noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7218232242203115351.post-5614647202648035382011-11-15T10:29:10.782-07:002011-11-15T10:29:10.782-07:00As a public service I hacked up a function that al...As a public service I hacked up a function that allows you to programatically play tracks by title. This is useful when trying to make images play, which the player doesn't seem to support.<br /><br />img src="...jpg" style="cursor:pointer" onClick="play('Song Title')"><br /><br />function play(id){<br /> for(var i=0;i<10;i++){ // Rewind to beginning of playlist. I use a for counter just to avoid a possible infinite loop.<br /> // If you have more than 10 tracks on page then increase this<br /> YAHOO.MediaPlayer.previous();<br />var media=YAHOO.MediaPlayer.getMetaData();<br /> if(media.title=="First Song Title") break; // Not totally necessary but if you know the title of the first song then this is clean<br /> }<br /> for(var i=0;i<10;i++){ // This advances the player until the track title matches the title you passed in. Then it plays the song.<br /> <br /> var media=YAHOO.MediaPlayer.getMetaData();<br /> if(media.title==id){<br /> YAHOO.MediaPlayer.play();<br /> break;<br /> }<br /> YAHOO.MediaPlayer.controller.EventManager.onNextRequest.fire();<br /> }<br />}Terry Thorsenhttps://www.blogger.com/profile/06056692124531657442noreply@blogger.comtag:blogger.com,1999:blog-7218232242203115351.post-87728297579049288802009-04-14T09:36:00.001-06:002009-04-14T09:36:00.001-06:00These are valuable hacks. If you posted a note to...These are valuable hacks. If you posted a note to the mailing list at http://groups.yahoo.com/group/yhoomediaplayer it would help other people to reuse your experience.<br /><br />About skinnability, the intent from the beginning was to empower developers to use CSS rather than Flash. Also you can replace the standard image sprite master with your own.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7218232242203115351.post-38454890932194909012009-04-14T09:36:00.000-06:002009-04-14T09:36:00.000-06:00These are valuable hacks. If you posted a note to...These are valuable hacks. If you posted a note to the mailing list at http://groups.yahoo.com/group/yhoomediaplayer it would help other people to reuse your experience.<br /><br />About skinnability, the intent from the beginning was to empower developers to use CSS rather than Flash. Also you can replace the standard image sprite master with your own.Anonymousnoreply@blogger.com