-
Senior Member
Playing a stream from a position
Hi,
flash can play streams (mp3, wav) from any position (if it was loaded). I can't figure out how this works with 3dfa.
Can anyone help me?
I tried this which won't work:
PHP Code:
music.start();
music.position = the_new_position;
thx
-
Senior Member
I figured it out.
music.start(wanted_position_in_seconds/1000); //position in millisecs
now i want to make a mp3 stream player with xml playlist. maybe a server side, php driven playlist.
Last edited by lopez1_de; 08-05-2004 at 12:07 PM.
-
KoolMoves Moderator
Cool I was trying to figure that out myself and was at a loss
-
Senior Member
am i the only one here who never figure my mistakes up by myself...well the hard ones i dont...the small stupid stuff i am (random stuff etc)
-
Senior Member
jeah. watch this..
done with 3dfa
mp3 stream player v1
still working on xml playlist
have a nice day
-
Senior Member
don't forget that you can use the positionbar to goto any loaded song position!
and that id3 tag is displayed in the scroller! (i used getid3.org)
-
KoolMoves Moderator
Very cool indeed
What is Audio Archive?
-
Senior Member
audioarchive is a server where you can place your music files. a free storage for music
-
Senior Member
I need 7 more posts to have an avatar
now 6
-
Senior Member
its always nice to see some one who finished his work...nice job
i afried i toke on myself some project wich will take mounths to finish...
anyway good job on that player ove there , im curiose ,how did you make the song name to appeer as small dots ? and hod did you make it move from right to left ?
-
Senior Member
thx. it's good to hear that somebody like that work.
1:
ok. the dot font is a simple font i found on the web.
be shure that the font has a fixed width!!
2:
and here the scroller code
first place a edit box and set the variable to "scroller"
startup script:
PHP Code:
scroll_max=19; //the maximal characters to display
scroll_pos=0; // initial scroller position
scroll_dir=true; //scroll direction, true=scroll right, false=scroll left
scroller = "MP3 STREAM PLAYER"; //the initial text of the scroller
then we need a timer, started every 10 frames (20 frames/second is the movie set).
timer script:
PHP Code:
if (songname!=""){
if (scroll_dir==true) {
scroll_pos++;
} else {
scroll_pos--;
}
}
now the scroller script: (songname is the string with the song title)
runs every 1 frame!
PHP Code:
scroller = songname.slice(scroll_pos,scroll_pos+scroll_max);
if ((scroll_pos+scroll_max)==songname.length && scroll_dir==true) {
scroll_dir=false;
}
if (scroll_pos==0 && scroll_dir==false) {
scroll_dir=true;
}
thats it
next week i show you the xml playlist feature.
this player will play local files also! listen to cd's, local files and web streams. what a nice thing.
my inspiration:
wimpy player
-
Senior Member
now i have done the xml playlist.
have a look http://www.ejected.de/player/
try do play a local file with
file:///c:\anyfile.mp3
have a nice day
-
Senior Member
please report bugs here.
thank you!
-
Man
That is 1 nice program well u should make it downloadable to becuz its small and alot better to use while playing games then windows media player lol
Kill them the hard,Kill them fast!
-
Senior Member
its cool all right and all but i think i can make it even cooler if ill photo my sterio and make it as a skin for your program , if you like just send me the sorce file and ill try to make it when ill have some free time , all credit of cours will go to you ....
-
KoolMoves Moderator
This is really great... Good work!
I hope you will share your source, but I understand if you don't
-
Ride 'em FISHY!
Being like the only one who has dial-up on this forum...
The player doesn't work exactly right with a dial-up connection. It messes up the song because it doesn't have time to load the entire song before reaching the end. So the bar that shows the position of the song is going back and forth.
Dan
Oops. I broke it.... again.
-
Senior Member
That is 1 nice program well u should make it downloadable to becuz its small and alot better to use while playing games then windows media player lol
yes, if it's finished i'll make it downloadable for everyone. but without the 3dfa source file
its cool all right and all but i think i can make it even cooler if ill photo my sterio and make it as a skin for your program , if you like just send me the sorce file and ill try to make it when ill have some free time , all credit of cours will go to you ....
yeah. another skin would be great. but its hard to change the pictures in the moment.
This is really great... Good work!
I hope you will share your source, but I understand if you don't
thank you. i don't like to share the source. but if somebode have a question. ask me!
Being like the only one who has dial-up on this forum...
The player doesn't work exactly right with a dial-up connection. It messes up the song because it doesn't have time to load the entire song before reaching the end. So the bar that shows the position of the song is going back and forth.
yes you be!
what you think i can do to fix this. for modem users (or somebody who have not anough bandwith to stream files) the player must wait until a minimum ammount auf bytes are loaded until it starts playing. mh
what do the others think?
now most bugs are fixed. the playlist is a fully xml formatted playlist.
note: only id3v2 is supported. because id3v2 is on the beginning of a file (id3v1 at the end). to show id3v1 tags the whole song must be loaded. but the id3tag is received with a php script and downloaded to a webserver. (this is to much traffic)
you can play local files with:
file:///c:\anyfile.mp3
MP3 STREAM PLAYER
please feel free to save playlists and use this player.
please report bugs. the final version is for free download.
bye
-
KoolMoves Moderator
how are you loading the XML file? I notice that the flash player askes for permission to access a file so I assume you are not using loadXML, or is that for the file itself?
I totaly understand about not releasing the source code, but how about a sample of the XML and the parsing of the XML and how you load the mp3 files.
-
Senior Member
how are you loading the XML file? I notice that the flash player askes for permission to access a file so I assume you are not using loadXML, or is that for the file itself?
I totaly understand about not releasing the source code, but how about a sample of the XML and the parsing of the XML and how you load the mp3 files.
loading xml:
PHP Code:
list_xml = new XML;
list_xml.ignoreWhite;
list_xml.load (base_url+"/playlists/"+loadthis_playlist+".xml");
if (list_xml.loaded){
var rootnode = list_xml.childNodes[0];
for (n=0; n<rootnode.childNodes.length; n++){
track_counter++;
var node = rootnode.childNodes[n];
for (var i=0; i<node.childNodes.length; i++){
var chnode = node.childNodes[i];
track_name[track_counter]=getsongname(chnode.childNodes[0].toString());
track_url[track_counter]=chnode.childNodes[0].toString();
}
}
show_tracks();
}
load mp3 file:
PHP Code:
if(track_counter>0){
if (music_pause==true) {
music_pause=false;
music.start(pause_pos/1000);
} else {
if(track_play==0){
track_play=1;
url = track_url[track_play];
}
reset_scroller();
music=new Sound();
music.loadSound (url,true);
music.start();
}
music.setVolume (volume);
element ("playpos").show();
element ("play_perc").show();
music_play=true;
status="PLAY >";
songname=getsongname(url);
trackcount=track_play+"/"+track_counter;
// get id3 tag
if (got_id3==false) {
if (url.substr(0,7)=="http://"){
//web file -> id3v2 only
loadVariables (base_url+"/id3.php?id3v=2&remotefilename="+url,"POST");
} else {
//local file
}
}
}
have a nice day
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|