bhe,se cerchi online trovi oggetti sullo streaming..
ti posso passare il codice che utilizzo io su uno dei miei siti..ovviamente la struttura html te la devi costruire tu...ciao
questo nell head
Codice:
<head>
<script>
var streams = new Array();
streams[0] = new makeStream("mms://wmt.albacom.net/qsrl@albanet/radiorock", "Radio Rock - Roma");
streams[1] = new makeStream("http://www.radiojukebox.info/jb.asx", "Radio JukeBox");
streams[2] = new makeStream("http://www.radiomaria.org/media/italy.asx", "Radio Maria");
streams[3] = new makeStream("http://www.105.net/105.asx", "Radio 105");
streams[4] = new makeStream("http://live.rcc.it/Ascolta%20RCC%20su%20Internet.asx", "RCC");
streams[5] = new makeStream("http://www.rds.it/pandora/streaming/rds.asx", "RDS");
streams[6] = new makeStream("mms://wmedia.rin.it/rin", "RIN");
streams[7] = new makeStream("http://www.rtl.it/mediaplayer/rtl1025.asx", "RTL 102.5");
streams[8] = new makeStream("http://radiozeta.fabbricadigitale.it/asx/radioZeta.asx", "Radio Zeta");
streams[9] = new makeStream("http://www.radioitaly.net/live.asx", "Radio Italy");
streams[10] = new makeStream("http://www.streaming-media.it/public/GammaRadio.asx", "Radio Gamma");
streams[11] = new makeStream("http://212.48.126.114/radiomondo", "Radio Mondo 106");
streams[12] = new makeStream("http://ra.marilu.it:8000/birikina.mp3", "Radio Birikina");
streams[13] = new makeStream("http://streaming.radiodolomiti.it:8000", "Radio Dolomiti");
streams[14] = new makeStream("http://www.doctordance.it/doctordance.asx", "Dottor Dance");
streams[15] = new makeStream("http://62.48.43.242/RDF", "Radio RDF");
streams[15] = new makeStream("mms://wm12.spacialnet.com/RadioNorba", "RadioNorba");
streams[16] = new makeStream("http://mediaplayer2.rtl.it/hitchannelmulticast", "Hit Channel");
streams[17] = new makeStream("http://live.mediaserver.kataweb.it/m2o", "m2o");
streams[18] = new makeStream("http://live.mediaserver.kataweb.it/radiodeejay", "Radio Deejay");
function makeStream(url, name) {
this.url = url;
this.name = name;
}
function handleControlsOnOffClick() {
if (document.mediaPlayer.showControls == true) {
document.mediaPlayer.showControls = false;
document.playerCtrl.controls.value = " Show Controls ";
}
else {
document.mediaPlayer.showControls = true;
document.playerCtrl.controls.value = " Hide Controls "
}
}
function handlePlayOrPauseClick(){
var state;
playerStatus = document.mediaPlayer.playState;
if (playerStatus == 6) {
document.mediaPlayer.play();
document.playerCtrl.playOrPause.value = " Pause ";
}
else if (playerStatus == 1) {
document.mediaPlayer.play();
document.playerCtrl.playOrPause.value = " Pause ";
}
else if (playerStatus == 2) {
document.mediaPlayer.pause();
document.playerCtrl.playOrPause.value = " Play ";
}
}
function changeSize(newSize) {
document.mediaPlayer.displaySize = newSize;
}
function change() {
var list = document.playerCtrl.streams;
var streamURL = list.options[list.selectedIndex].value;
document.mediaPlayer.stop();
document.playerCtrl.playOrPause.value = " Pause ";
document.mediaPlayer.fileName = streamURL;
pstatus.innerHTML = "In attesa";
speed.innerHTML = "In attesa";
buffer.innerHTML = "In attesa";
}
function playerstatus() {
code = mediaPlayer.OpenState;
if (code == 0) code = "In attesa";
if (code == 1 || code == 2) code = "Caricamento dati";
if (code == 3) code = "Ricerca...";
if (code == 4) code = "Connesso";
if (code == 5) code = "Cambio...";
if (code == 6) code = "Connesso";
pstatus.innerHTML = code;
buffer.innerHTML = " " + mediaPlayer.BufferingProgress + "%";
speed.innerHTML = " " + parseInt(mediaPlayer.Bandwidth / 1024) + " Kbps";
}
</script>
</head>
inserisce in una select i titoli delle radio attraverso l'array costruito precedentemente
Codice:
<FORM NAME="playerCtrl">
<INPUT TYPE="hidden" VALUE=" Pause " NAME="playOrPause">
<SCRIPT>
with (document) {
writeln('<SELECT NAME="streams" onChange="change()" style="font-family: Verdana; color: #ffcf63; font-size: 9; height:25px; width:110px; background-color: #cc6600; float:left;">');
for (var i = 0; i < streams.length; i++) {
writeln('<OPTION VALUE="', streams[i].url, '">', streams[i].name);
}
writeln('</SELECT>');
}
</SCRIPT>
</FORM>
vari indicatori
Codice:
<font>Velocita':<span id="speed">In attesa</span></font>
<font>Stato:<span id="pstatus">In attesa</span></font>
<font>Buffer:<span id="buffer">In attesa</span></font>
Codice:
<OBJECT
ID="mediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
STANDBY="Loading Microsoft Windows Media Player components..."
TYPE="application/x-oleobject"
STYLE="WIDTH:0px;HEIGHT:0px">
<PARAM NAME="SendOpenStateChangeEvents" VALUE="true">
<PARAM NAME="fileName" VALUE="mms://wmt.albacom.net/qsrl@albanet/radiorock">
<PARAM NAME="animationatStart" VALUE="false">
<PARAM NAME="transparentatStart" VALUE="true">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">
<PARAM NAME="AudioStream" VALUE="true">
<PARAM NAME="ShowControls" VALUE="true">
<PARAM NAME="ShowAudioControls" VALUE="true">
<PARAM NAME="ShowDisplay " VALUE="false">
</OBJECT>
oggetto usato..
spero che riesco a farla funzionare :P
ciao