MP3 Player v2 - XML

Can I see the playlist too ?


<?xml version="1.0" encoding="iso-8859-1"?>
<playlist>
<song title="Lovers Tale"><![CDATA[loverstale.mp3]]></song>
<song title="Hungry"><![CDATA[hungry.mp3]]></song>
<song title="Hurricane"><![CDATA[hurricane.mp3]]></song>
<song title="Everybody's Girl"><![CDATA[everybodysgirl.mp3]]></song>
<song title="Vale of Avoca"><![CDATA[valeofavoca.mp3]]></song>
<song title="Amelie"><![CDATA[amelie.mp3]]></song>
<song title="Rolling Dice"><![CDATA[rollingdice.mp3]]></song>
<song title="You"><![CDATA[you.mp3]]></song>
<song title="Then Came The Rain"><![CDATA[thencametherain.mp3]]></song>
</playlist>

hi Voets, great player, trying to get my head around the coding…

for my needs, id like the player to appear but only for a track to start streaming if the user requests it by pressing play…save bandwith in case they dont want music…

is this possible?

This answer has been asked before - what you need to do is to execute the onRelease handler of the stop button right after the player has initialized. I’ve posted this before, and in the comments on my site too I think.

Voetsjoeba:

Is that answer for me?

Hey Voets. Is there a way to make the track loop continuously without gaps? In effect turning the MP3 player into a loop selector.

Oh … that’s really not what it’s made for FG. That would require major changes to the code.

That’s what I thought. Thx anyway.

Voetsjoeba:

Have you managed to see why my movie was behaving strangely?

Nick - I’ve been very busy lately and haven’t really had the time to look at it thoroughly, though I will when I find the time.

Here’s your error. This is what it should be:


songsArray.push({title:this.firstChild.childNodes[j].attributes.title, artist:this.firstChild.childNodes[j].attributes.artist, url:this.firstChild.childNodes[j].firstChild.nodeValue, duration:ms, totalbytes:Number(this.firstChild.childNodes[j].attributes.filesize)});

You cut out more than half of that line, cutting away more than half of all the required info causing it to freak.

I changed the code and it still behaves strangely. Could there be anything else?

Not that I could see from your fla.

Oh right, what about the XML file? Could it just be a bug?

Oh right, I changed something else too - your songbox being a graphic ! Why are you changing everything ?

Hi, i’m not doing too many changes, but there is alot of the code that I don’t need. like a stop button and volume control, not too bothered about the button animations either. The client wants it fairly simple to use.

So does the problem lie with the songbox being a graphic?

Sorry to be a pain, I really appreciate the help.

I think it may be the XML file, because when I copy your code into my fla, and then run it, it works ok, then when I change the xml part of the code to load in my xml file it starts to behave strangely. On your XML I don’t need to have artist, because it is all the same artist, but do I need to have the duration and filesize?

Of course ! You need everything that my playlist has ! Now I see - I indeed used my own playlist because your paths to your mp3s were relative so I couldn’t use it !

Don’t forget to use the absolute bytesize “on disk” for the filesize.

So I can discard the artist tag, but keep the other two (filesize and duration)

Also what do you mean bytesize on disk, where is that?

No you can not discard the artist tag, unless you type it in manually in the line I corrected.

Bytesize on disk you can see by rightclicking the file, and look at the “Size on Disk”. Next to it is the size in bytes. Copy that number, without .'s or ,'s, so not 6.123.568 for example, but 6123568.