hallo leute nach langen hin und her bin ich gestern noch auf einen skript gestoßen ,wo auch deie track anzeige geht ,aber nun taucht auch schon das nächste problem auf,der track aktuallisiert sich nicht von alleine .erst wenn ich einmal den player stoppe und wieder play drücke zeigt er mir den aktuellen song an der gerad gespielt wird.
kann mir jemand helfen und mir sagen in welcher zeile ich was verändern muss bzw hinzufügen muss ,damit er selbst die titel aktuallisiert ohne das ich nach jeden lied den player einmal stoppen muss und wieder starten muss?
hier der aktuelle skript den ich nutze:
HTML-Code:
<html>
<head>
<title>Webradio Sidebar Gadget</title>
<style type="text/css">
body{
width:125px;
height:125px;
margin:0px;
}
.style1 {
margin-top: 0px;
}
#apDiv1 {
position:absolute;
width:114px;
height:18px;
z-index:15;
left: 7px;
top: 39px;
}
#apDiv2 {
position:absolute;
width:64px;
height:50px;
left: 61px;
top: 53px;
}
#apDiv3 {
position:absolute;
width:66px;
height:16px;
z-index:16;
left: 56px;
top: 74px;
}
#apDiv4 {
position:absolute;
width:61px;
height:16px;
z-index:17;
left: 56px;
top: 92px;
}
a:link {
text-decoration: none;
color: #CCC;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
a {
font-family: Comic Sans MS, cursive;
color: #CCC;
}
#apDiv5 {
position:absolute;
width:66px;
height:13px;
z-index:15;
left: 61px;
top: 51px;
}
#apDiv6 {
position:absolute;
width:64px;
height:15px;
z-index:15;
left: 63px;
top: 50px;
}
#apDiv7 {
position:absolute;
width:58px;
height:14px;
z-index:16;
left: 65px;
top: 68px;
}
#apDiv8 {
position:absolute;
width:49px;
height:15px;
z-index:17;
left: 65px;
top: 86px;
}
#apDiv9 {
position:absolute;
width:63px;
height:48px;
z-index:18;
left: 56px;
top: 58px;
}
#apDiv10 {
position:absolute;
width:54px;
height:15px;
z-index:19;
left: 59px;
top: 54px;
}
#apDiv10 a {
color: #000;
}
#apDiv11 {
position:absolute;
width:48px;
height:15px;
z-index:20;
left: 59px;
top: 72px;
}
#apDiv12 {
position:absolute;
width:39px;
height:9px;
z-index:21;
left: 59px;
top: 88px;
}
</style>
<script type="text/javascript">
var gadgetTimeout;
var currentVol = 100;
var currentIndex;
var currentURL = "";
var currentName = "";
var ForReading = 1;
var arrList = new Array();
var i = 0;
var l1 = 8; // left of ticker in pixel
var t1 = 40; // top of ticker in pixel
var w1 = 113; // width of ticker in pixel
var first = true;
var l2 = l1 + w1;
var l3 = (l1 - l2)*2;
var l = l2;
function inittick() {
ticktext.style.posTop = t1;
l2 = l1 + w1;
l3 = (l1 - l2)*2;
l = l2;
setInterval('tick()', 40);
}
function getLeft(ll) {
if (ll.offsetParent){
return (ll.offsetLeft + getLeft(ll.offsetParent));
}else{
return (ll.offsetLeft);
}
}
function getTop(ll) {
if (ll.offsetParent){
return (ll.offsetTop + getTop(ll.offsetParent));
}else{
return (ll.offsetTop);
}
}
function tick() {
l = l - 1;
if (l < l3) l = l2;
cl = l1 - l;
cr = l2 - l;
ticktext.style.posLeft = l;
ticktext.style.posTop = t1;
ticktext.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
if (first) ticktext.style.visibility = "visible";
first = false;
}
function initGadget(){
objFSO = new ActiveXObject("Scripting.FileSystemObject");
if (System.Gadget.Settings.read("SettingsExist")){
currentURL = unescape(System.Gadget.Settings.readString("stationURL"));
currentVol = unescape(System.Gadget.Settings.readString("stationVol"));
currentName = unescape(System.Gadget.Settings.readString("stationName"));
}else{
currentURL = "http://213.165.84.80:8000";
currentName = "";
currentIndex = 0;
}
mediaPlayer.url = currentURL;
mediaPlayer.settings.volume = currentVol;
Volume.innerText = currentVol + "%";
gadgetTimeout = setTimeout("setImages()",1000);
}
function setImages(){
with (controlImage.style){
left = "10px";
top = "65px";
width = "14px";
height = "12px";
}
controlImage.src = "url(images/play.png)";
with (controlSpeaker.style){
left = "10px";
top = "85px";
width = "23px";
height = "24px";
}
controlSpeaker.src = "url(images/speaker_on.png)";
with (controlLink.style){
left = "113px";
top = "135px";
width = "11px";
height = "11px";
}
controlLink.src = "url(images/link.png)";
with (controlBut.style){
left = "113px";
top = "150px";
width = "10px";
height = "10px";
}
controlBut.src = "url(images/b.png)";
inittick();
}
function PlayPause(){
if(controlImage.src == "images/pause.png"){
mediaPlayer.controls.stop();
}else{
mediaPlayer.url = currentURL;
mediaPlayer.controls.play();
}
}
function speakeronoff(){
if(controlSpeaker.src == "images/speaker_on.png"){
controlSpeaker.src = "images/speaker_off.png"
mediaPlayer.settings.mute = true;
}else{
controlSpeaker.src = "images/speaker_on.png"
mediaPlayer.settings.mute = false;
}
}
function playStateChange(newstate){
switch (newstate){
case 1: // Angehalten
statusText.innerHTML = currentName;
controlImage.src = "images/play.png";
infoText.innerHTML = "";
ticktext.innerHTML = "radio-base-jump ";
l3 = (l1 - l2)*2;
break;
case 2: // Pause
statusText.innerHTML = "Pause";
break;
case 3: // Wiedergabe
statusText.innerHTML = currentName;
controlImage.src = "images/pause.png";
infoText.innerHTML = parseInt(mediaPlayer.currentMedia.getItemInfo("Bitrate")/2400,25) + " kBit/s";
ticktext.innerHTML = mediaPlayer.currentMedia.getItemInfoByType("Title", "", 0);
l3 = (l1 - l2)*(ticktext.innerHTML.length/25);
break;
case 6: // Laden
statusText.innerHTML = "Laden";
break;
case 7: // Warten
statusText.innerHTML = "Warten";
break;
case 8: // Beendet
statusText.innerHTML = "Beendet";
controlImage.src = "images/play.png";
break;
case 9: // Übertragen
statusText.innerHTML = "Übertragen";
break;
case 10: // Bereit
statusText.innerHTML = currentName;
infoText.innerHTML = "";
ticktext.innerHTML = "radio-base-jump";
l3 = (l1 - l2)*2;
break;
}
}
function mousewheelVolume(){
oldVol = mediaPlayer.settings.volume;
if (event.wheelDelta >= 20){
mediaPlayer.settings.volume = oldVol + 2;
}else{
if (event.wheelDelta <= -20){
mediaPlayer.settings.volume = oldVol - 2;
}
}
controlSpeaker.src = "images/speaker_on.png"
Volume.innerText = mediaPlayer.settings.volume + "%";
}
function winOpen(){
if (currentName == "Radio-Base-Jump"){
window.open('http://radio-base-jump.de/');
}
}
System.Gadget.settingsUI = "Settings.html";
</script>
<script for="mediaPlayer" event="playstatechange(newstate)">
playStateChange(newstate);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body onLoad="initGadget();" scroll="no" unselectable="on" onmousewheel="mousewheelVolume();">
<g:background id="background" src="images/beckground.png" style="z-index:-1;" />
<g:image id="controlImage" unselectable="on" onclick="PlayPause();" style="position:absolute; z-index:1;" />
<g:image id="controlSpeaker" unselectable="on" onclick="speakeronoff();" style="position:absolute; z-index:2;" />
<g:image id="controlLink" unselectable="on" onclick="winOpen();" style="position:absolute; z-index:2;" />
<g:image id="controlBut" unselectable="on" onclick="window.open('http://www.radio-base-jump.de');" style="position:absolute; z-index:2;" />
<div id="Volume" style="position:absolute; top:107px; left:8px; font-family:Segoe UI, Tahoma; font-size:11px; color:white; text-align:center; width:30px; z-index:11; height: 13px;">
</div>
<div id="statusText" style="position:absolute; top:1px; left:12px; font-family:Segoe UI, Tahoma; font-size:11px; color:white; text-align:left; width:105px; z-index:12;">
</div>
<div id="infoText" style="position:absolute; top:110px; left:65px; font-family:Segoe UI, Tahoma; font-size:11px; color:white; text-align:left; width:60px; z-index:13;">
</div>
<nobr>
<div id="ticktext" style="position:absolute;font-family:Segoe UI, Tahoma;font-size:12px;color:white;visibility:hidden;z-index:14;">Fun-Radio Station Sidebar Gadget
</div>
</nobr>
<OBJECT id="mediaPlayer" width="0" height="0"
style="position:absolute; left:0; top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="False">
<PARAM NAME="uiMode" VALUE="invisible">
</OBJECT>
<div id="apDiv9"><img src="images/sendeplan.png" width="67" height="17"><img src="images/wunschbox.png" width="67" height="17"><img src="images/chat.png" width="67" height="17"></div>
<div id="apDiv10"><a href="http://www.radio-base-jump.de/sendeplan.php">______</a></div>
<div id="apDiv11"><a href="http://www.radio-base-jump.de/viewpage.php?page_id=6">______</a></div>
<div id="apDiv12"><a href="http://server3.webkicks.de/basejump/">______</a></div>
</body>
</html>