#3 Complete code cleanup!

open
nobody
None
5
2007-02-13
2007-02-13
James Le Cuirot
No

This is it! My cleanup is complete... well my first attempt at it is anyway. A few things to note...

- xspf_player.as and xspf_player_slim.as now only contain code that is relevant to each skin.

- The .fla files are still the same so they were not included.

- The shuffle file had to be named _shuffle.as instead of shuffle.as. I got strange compiler errors otherwise. No idea why.

- Radio mode is not included. It would probably work, I just didn't try it.

- The button skin has not been worked on. I noticed that the code for this is totally different from the other two. Since it relies on shapes rather than text, the new code would need to be made even more generic. I have a few vague ideas. Maybe I'll look at it in a while.

Discussion

  • Logged In: YES
    user_id=770758
    Originator: YES

    Here's a new version. Most importantly, this fixes scrolling, which I didn't realise was broken in the last version. There's a whole load of new stuff too, more than I can remember off the top of my head.

    - Vertical volume sliders are supported. No code changes necessary, just make a slider that's taller than it is wide!

    - Buy button. There wasn't a buy-specific URL in the XSPF specification so I made use of the extension tag. It expects the application attribute to be http://musicplayer.sourceforge.net. The tag name is buy. I realised the code would be much the same as the code for info so I combined the two by making some generic link button code.

    - Starting track. You can use start_index or start_id to tell the player which track to start on.

    - loadTrack JavaScript callback. I wanted a getTrackIndex and getTrackId function but the integration kit doesn't allow return values so I added a callback instead. This opens up a whole bunch of interesting possibilities. The callback passes the current track index and the track object itself to the JavaScript function. I found that the integration kit would fail when handling multibyte characters so I found a function to deep-copy the track object and wrote another function to URL-encode all the strings within the object. This allows it to be passed without any problems.
    File Added: xspf_player-20070221.zip

     
  • Logged In: NO

    Where are the FLA's so we can recompile and turn off options (like downloading)?

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    As I said, they were not included because they are still the same as the official version.

    Anyone seen Fabricio? :-S

     
  • Logged In: NO

    Unfortunately when you recompile the FLA the shuffle no longer works. All I need a shuffling player with no option to download.

    repeat_playlist=true&autoplay=true&shuffle=true

    'shuffle=true' doesn't work if I recompile. Seems most people just want to remove the "Download" option, even if it isn't secure.

    Thanks for all your hard work on making a great player even better. :)

     
  • MikeinSC
    MikeinSC
    2007-07-11

    Logged In: YES
    user_id=1749412
    Originator: NO

    Okay...I will admit. I am new at this. I was able to get the original music player to work. However, after loading this newer version with all the changes, I am not seeing a difference? I placed all the new actionscripts that James worked on within the appropriate directory on my server, yet is looks as though the player is the same as the original. I don't have Flash, but, will the xspf_player.FLA player need to be recompiled in order to recognize the new changes? The function piece I would really like to see work is the "BUY" feature.

    Thanks everyone.

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    The files in the zip aren't enough. You have to compile it into an SWF. I'll try and get it done when I'm next in Windows. Unfortunately, I've basically had to abandon this because someone on my project wrote another player from scratch. I also really wanted Fabricio to give me commit access so that maintaining these changes could be done more easily but he's totally disappeared.

     
  • MikeinSC
    MikeinSC
    2007-07-11

    Logged In: YES
    user_id=1749412
    Originator: NO

    James...I kinda had a hunch the files needed to be compiled. I have someone I can porbably use. For my own knowledge, it sounds like you basically will associate the FLA file with those particular actions scripts within the program itself...then compile them all together. Am I on the right track?

    Thanks for the feedback on this.

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    All you need to do is load the .fla and ensure the .as files are in the same directory when you compile. That's it.

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    Actually sorry, that's not quite it. You also need the font (it's on the web site) and you need to add the Flash JavaScript Integration Kit found at http://weblogs.macromedia.com/flashjavascript.

     
  • MikeinSC
    MikeinSC
    2007-07-12

    Logged In: YES
    user_id=1749412
    Originator: NO

    James...just a update on the helpful information you have provided thus far.

    First, I put all the new .as files you created, along with the xspf_player.fla file and both the javascriptflashgateway.js and javascriptflashgateway.swf files into a local directory on my computer.

    I have downloaded a trial version of Flash CS3. I launched the application and then opened up the xspf_player.fla file.

    I then went to "Publish Previw in html" in Flash, so I could just see some of the changes. However, I ended up getting a compile error.

    This is the error:
    The class or interface 'com.macromedia.javascript.JavaScriptProxy' could not be loaded.

    This is the source of the error:
    var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);

    Do I have the gateway in the correct place? Does it need to be imported somehow into the Flash application? Should I use an older version of Flash? Maybe I don't have the overall steps correct on how to compile everything together?

    Just confused at the moment.

    BTW...so far you have stretched yourself out on a limb to answer my questions. I just wanted to let you know how much I appreciate your input.

    Thanks James,

    Mike

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    I think you normally install those two files using the extension manager or you can just do it manually by sticking them in C:\Documents and Settings\USERNAME\Local Settings\Application Data\Macromedia\Flash 8\en\Configuration\Classes\com\macromedia\javascript. The path will no doubt vary for CS3.

    You're welcome.

     
  • Logged In: YES
    user_id=770758
    Originator: YES

    To anyone who looks at this, please stop pestering me about it. I realised after a while that even after the cleanup, the code is still a total mess and really should be scrapped. I'm not surprised Fabricio did a runner. If you want my advise, use the JW Media Player instead. http://www.jeroenwijering.com/?item=JW_Media_Player