PDA

View Full Version : Kindly Help needed with my mp3 player.


Imoracle
06-04-2008, 07:26 AM
Hello All,

The quest for making mp3 player perfect continues. As discussed before I am facing following two problems with my mp3 player: (I have attached the code for a single button player I made for my site)

1. When I play a song, the song starts buffering from a remote site. Now suppose you pause the song, the song keeps buffering. But as soon as the song buffering is complete, the player starts playing the song from where it left.

Probably there is an event sent out when the buffer completes which activates the song playing again. But I don't know how to rectify this.

2. Another problem which I am having and is a MAJOR issue, is that, if my user have a download manager configured with the browser. My player instead of playing the song, starts the download. Now I surely don't want this to happen with my user's personal compositions. Over this I am unable to understand how can I stop this from happening.

May be some header information needs to be sent out.

Can someone please see to my code attached with this message and suggest some solutions to the problem ?

Any other suggestions or corrections are also welcomed.

If attachment doesn't works correctly, download the code for mp3 from here
http://tinyurl.com/5t8qdj

Thanks in advance,
Imoracle.

Imoracle
06-04-2008, 01:51 PM
Any helpers out there ??

senshi
06-05-2008, 07:08 AM
1. When I play a song, the song starts buffering from a remote site. Now suppose you pause the song, the song keeps buffering. But as soon as the song buffering is complete, the player starts playing the song from where it left.

Probably there is an event sent out when the buffer completes which activates the song playing again. But I don't know how to rectify this.

In your code, I see this handler:

<handler name="onload">
this.play();
</handler>


Doesn't that mean to start playing after the "onload"-event has been fired, so after the resource was completely loaded!?

@issue 2: no plain idea what's happening there...

Imoracle
06-05-2008, 07:45 AM
Oh is it, well i thought that onload means, when for the first time the song is loaded.

Not when the song completely buffers.

Is the onLoad event fired when the song completes its buffering.

Anyways i will try out and let you know about it.

Also did you tried and see that the Download manager do download the files?? Were you able to observer it ??

Thanks a lot man,
Will get back to you,
Imoracle

Imoracle
06-05-2008, 08:04 AM
WOW! Bingo.

Some knowledge gained.

So its confirmed that the onload event is fired once again when the buffering is complete.

It obviously gets fired i suppose when a song is loaded to it.

However I am still foxed on issue No. 2.

Why the hell does it starts downloading the song, I really cant apply this to my site if it continues to let users download the songs.

Hoping for some more expert reviews and comments.
Imoracle

Imoracle
06-07-2008, 03:08 PM
Any thoughts upon problem no. 2 ??