dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Java music player override?

  1. #1
    Join Date
    Dec 2011
    Posts
    3

    Java music player override?

    Hey all,

    I've built a website for my music and I'm fairly new to all this so bear with me.

    Essentially, I have two flash-based music players on my site. One is a simple single-track player that auto-plays some background music for the site. The functionality is limited to the user starting/stopping the music and adjusting the volume. The other is an advanced music player featuring a playlist of preselected tracks and allows the user to start/stop music, rewind, fast forward, adjust volume and select tracks in the playlist. This player does not start automatically.

    My question is this: when someone visits the site, the single-track background music player will start. Is there code that would allow the advanced music player, should it be turned on (i.e. someone selects a track and plays it), to override and actually stop the play of the single-track?

    TIA!

  2. #2
    Join Date
    May 2010
    Posts
    213
    Quote Originally Posted by krylon80 View Post
    Is there code that would allow the advanced music player
    That depends entirely on your players. Nobody can tell you if it's possible just from this. Well okay, maybe Chuck Norris would....
    But the point is - if it is possible, then it's your players that will allow it to be possible.

    You need an event in your "advanced" player that can fire up a function when triggered (song starts playing). And then you need an API on your background-playing player that will allow you to execute a pause.

    And what's TIA?
    Last edited by 3Nex; 12-31-2011 at 07:36 PM.

  3. #3
    Join Date
    Dec 2011
    Posts
    3
    That depends entirely on your players. Nobody can tell you if it's possible just from this. Well okay, maybe Chuck Norris would....
    But the point is - if it is possible, then it's your players that will allow it to be possible. And what's TIA?
    Yes, Chuck Norris can do anything! "TIA" stands for "Thanks In Advance".

    The players I have are very simple, downloaded from this site: http://flash-mp3-player.net/. I have the two .swf files but I have no idea how to open/read/manipulate them (if such a thing is even possible), I only know how to reference them in the site code to make the player work properly on the website.

    Here is the code for the advanced player (the one I'd need to do the overriding):

    <object data="assets/player_mp3_multi.swf" type="application/x-shockwave-flash" width="210" height="150" align="right">
    <param name="movie" value="assets/player_mp3_multi.swf" />
    <param name="bgcolor" value="#000000" />
    <param name="FlashVars" value="mp3=assets/panacea-screenplay.mp3&amp;height=150&amp;autoplay=0&amp;loop=1&amp;shuffle=1&amp;loadingcolor=0066FF&amp;sl iderovercolor=0066FF&amp;buttonovercolor=0066FF&amp;textcolor=FFFFFF&amp;playlistcolor=1B1B1B&amp;cu rrentmp3color=FFFFFF&amp;scrollbarovercolor=0066FF&amp;showplaylistnumbers=0" />
    </object>

    Here is the code for the simple player (the one I'd need to be overridden):

    <object type="application/x-shockwave-flash" data="assets/player_mp3_maxi.swf" width="200" height="20">
    <param name="movie" value="assets/player_mp3_maxi.swf" />
    <param name="bgcolor" value="#1B1B1B" />
    <param name="FlashVars" value="mp3=assets/panacea-screenplay.mp3&amp;loop=1&amp;autoplay=1&amp;showvolume=1&amp;bgcolor=1B1B1B&amp;loadingcolor=0066FF &amp;sliderovercolor=0066ff&amp;buttonovercolor=0066ff" />
    </object>

    You need an event in your "advanced" player that can fire up a function when triggered (song starts playing). And then you need an API on your background-playing player that will allow you to execute a pause.
    No clue what an "event" or an "API" is or how to create one. Any help you could provide in that area or point me in the right direction would be much appreciated!

    Thanks.

  4. #4
    Join Date
    May 2010
    Posts
    213
    Oh god... I don't really feel like playing with this much right now..

    But basically all you need is on the documentation page, you just have to read it (and understand it): http://flash-mp3-player.net/players/js/documentation/

    It says there's a parameter listener, which is "The javascript listener waiting for the flash events". So i guess you should pass a function name as a parameter called listener, and then in that function you should read what parameter you get to determine which event happened.

    Then if the event is that the song started playing (in the advanced player of course), you would execute this on the other player:
    method: pause "Pauses the track."

    I'm too lazy to try it out, but play with it enough and you'll figure it out i guess.

  5. #5
    Join Date
    Dec 2011
    Posts
    3
    thanks for all your help. i'll try that out.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles