Hallo zusammen.
Ich arbeite gerade an meiner 1. Homepage und will einen "Radioempfänger" für diverse Radiostationen auf meiner Homepage integrieren. Das Ziel ist es: Der Besucher wählt den gewünschten Radiosender über ein Selctfeld aus. Hinter dem Radiosender ist eine URL hinterlegt zum jeweiligen Livestream. Diese URL wird danach in den Array "Sendersuche" gespeichert und an den Player übergeben.
Nur funktioniert das System nicht. Kann mir jemand erklären wieso?
Freundliche Grüsse
Mathias Oertle
Code:
<script type="text/javascript">
function CheckUrl() {
if(window.location.search() != "") {
var url = window.location.href;
var cut = url.indexOf("?");
var adr = url.slice(cut+1,url.length);
document.embeds["Sendersuche"].src = adr;
}
}
function Senderwahl(Frequenz)
{
document.embeds["Sendersuche"].src = Frequenz;
window.location.href = this.location + "?" + Frequenz;
}
</script>
</head>
<body onload="CheckUrl()">
<select name="Sendersucher" onChange="Senderwahl(this.options[this.selectedIndex].value);" size="1">
<option value="http://radio24.stream.green.ch/radio24.asx">Radio 24</option>
<option value="http://grischa.stream.green.ch/grischa.wax">Radio Grischa</option>
<option value= "http://sunshine.stream.green.ch/sunshine.wax">Radio Sunshine</option>
<option value="http://radioz.stream.green.ch/radioz.wax">HitRadio Z</option>
</select>
</form>
<OBJECT ID="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
width="150" height="53" standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="Sendersuche">
<PARAM NAME="TransparentAtStart" Value="true">
<PARAM NAME="AutoStart" Value="true">
<PARAM NAME="AnimationatStart" Value="false">
<PARAM NAME="ShowStatusBar" Value="true">
<PARAM NAME="ShowControls" Value="true">
<PARAM NAME="autoSize" Value="false">
<PARAM NAME="displaySize" Value="false">
<PARAM NAME="ShowAudioControls" Value="true">
<PARAM NAME="ShowPositionControls" Value="false">
<Embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"
src="Sendersuche" Name="MediaPlayer"
width="150" height="53" transparentAtStart="1" autostart="0"
animationAtStart="0" ShowControls="true" ShowAudioControls="1"
ShowPositionControls="0" autoSize="0" ShowStatusBar="1" displaySize="false">
</embed></OBJECT>