Ja se snasao pa ako nekom zatreba...
Code:
/* EXAMPLE-CHANNELS */
var chans = new Array();//[title,ip:port;stream.nsv,description]
chans[0] = ["Radio #1", "http://s2.viastreaming.net:7130;stream.nsv", "Latest hits.\nhttp://www.radio1.com"];
chans[1] = ["Classics", "http://193.112.14.122:8080;stream.nsv", "Classical music 24/7.\nhttp://www.classicradio.com"];
chans[2] = ["FunkRadio", "http://stream.funkradio.com:7130;stream.nsv", "Funk music!.\nVisit http://www.funkradio.com"];
/* END OF CHANNEL-ARRAY */
stream = new Sound();//Create new sound
current = 0;//Current channeø
vol = 75;//Volume
function update() {//Update channel
if (current<0) {
current = 0;
}
if (current>chans.length-1) {
current = chans.length-1;
}
stream.stop();//Stop stream
stream.loadSound(chans[current][1], true);//Load new stream
setvol();//Set new volume
_root.txtChan = chans[current][0];//Set title-text
_root.txtDesc = chans[current][2];//Set description-text
}
function setvol() {//Set volume
if (vol>100) {
vol = 100;
}
if (vol<0) {
vol = 0;
}
stream.setVolume(vol);//Set volume
}
_root.onLoad = function() {//On load
update();//Update channel
};
_root.volu.onPress = function() {//Volume up
vol += 5;
setvol();
};
_root.vold.onPress = function() {//Volume down
vol -= 5;
setvol();
};
_root.nextChan.onPress = function() {//Next channel
current += 1;//Go to next channel
update();//Update channel
};
_root.prevChan.onPress = function() {//Previous channel
current -= 1;//Go to previous channel
update();//Update channel
};
_root.rndbtn.onPress = function() {//Random channel
current = Math.round(Math.random()*(chans.length-1));//Get random channel
update();//Update channel
};
Treba postaviti jos dugmad sa instance name: volu, vold, nextChan, prevChan i u chans promeniti "
http://s2.viastreaming.net:7130" sa adresom radia koji hocete da slusate.