views:

498

answers:

2

Is there a Flash MP3 player that would allow me to do following to pass URL to mp3 file and get it automatically played. To help out with answer - here is detailed code that describes what I would like to do:

<object id="mp3PlayerSwf" type="application/x-shockwave-flash" data="mp3Player.swf">
 <param name="movie" value="mp3Player.swf">
</object>

<input type="button" id="soundPlay1" value="Sound Play 1" />

<script type="text/javascript">
    function eventHandler1(sender) {
        var mp3Player = document.getElementById("mp3PlayerSwf");
        mp3Player.playSound("http://myUrl.com/my.mp3");
    }

    var soundPlay1 = document.getElementById('soundPlay1');
    if (soundPlay1.addEventListener) {
        soundPlay1.addEventListener('click', eventHandler1, false);
    }
    // IE
    else if (soundPlay1.attachEvent) {
        soundPlay1.attachEvent('onclick', eventHandler1);
    }
</script>

Constraint is that I can't use libraries that have JavaScript initialization - like for example SoundManager2 - http://www.schillmania.com/content/projects/soundmanager2/

Thanks for any help!

+2  A: 
Joel Alejandro
Thanks for your response... I think this is closest I'll get.I just don't understand why every single developer needs to turn their simple play button in _full_blown_oh_it_has_all_these_stupid_options_that_show_how_great_programmer_I_am_ fiasco...
kape123
+1  A: 

Another player would be http://musicplayer.sourceforge.net

Regis Frey