Это уже можно сделать.У меня так на странице с радио сделано71Gavrik71 писал(а):С кодом Fantom все заработало огромное спасибо,
Было-бы супер куда нибудь в плеер еще вытащить плейлись и то что играет в данный момент.
Хоть то что просто проигрывается
Код: Выделить всё
$ot=$this->object_title;
clearTimeOut($ot.'_update');
$url=$this->getProperty('URL');
$data=getURL($url.'/requests/status.xml',0,$this->getProperty('Username'),$this->getProperty('Password'));
if (preg_match('/<state>/is',$data)) {
$this->setProperty('active',1);
setTimeout($ot.'_update',"callMethod('$ot.update');",5);
sg('Update.Update', );
} else {
$this->setProperty('active',0);
setTimeout($ot.'_update',"callMethod('$ot.update');",30);
}
if (preg_match('/<state>playing<\/state>/is',$data)) {
if (preg_match('/<volume>(\d+)<\/volume>/is',$data,$m)) {
$this->setProperty('Volume',$m[1]);
}
$this->setProperty('isPlaying',1);
if (preg_match('/\'artist\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('Artist',$m[1]);
} elseif ($this->getProperty('Artist')!='') {
$this->setProperty('Artist','');
}
if (preg_match('/\'album\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('Album',$m[1]);
} elseif ($this->getProperty('Album')!='') {
$this->setProperty('Album','');
}
if (preg_match('/\'title\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('Title',$m[1]);
} elseif ($this->getProperty('Title')!='') {
$this->setProperty('Title','');
}
if (preg_match('/\'filename\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('Filename',$m[1]);
} elseif ($this->getProperty('Filename')!='') {
$this->setProperty('Filename','');
}
if (preg_match('/\'now_playing\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('now_playing',$m[1]);
} elseif ($this->getProperty('now_playing')!='') {
$this->setProperty('now_playing','');
}
if (preg_match('/\'artwork_url\'>(.+?)<\/info>/is',$data,$m)) {
//$this->setProperty('ArtURL',$url.'/art?'.urlencode($m[1]));
$filename='art_'.md5($m[1]);
if (!file_exists(ROOT.'cached/'.$filename.'.png')) {
$art_img=getURL($url.'/art?'.$filename,0,$this->getProperty('Username'),$this->getProperty('Password'));
if ($art_img!='Error') {
SaveFile(ROOT.'cached/'.$filename.'.png',$art_img);
$this->setProperty('ArtURL','/cached/'.$filename.'.png');
} else {
$this->setProperty('ArtURL','');
}
} elseif ($this->getProperty('ArtURL')!='/cached/'.$filename.'.png') {
$this->setProperty('ArtURL','/cached/'.$filename.'.png');
}
} elseif ($this->getProperty('ArtURL')!='') {
$this->setProperty('ArtURL','');
}
if (preg_match('/\'track_number\'>(.+?)<\/info>/is',$data,$m)) {
$this->setProperty('Track',$m[1]);
} elseif ($this->getProperty('Track')!='') {
$this->setProperty('Track','');
}
} else {
$this->setProperty('isPlaying',0);
if ($this->getProperty('ArtURL')!='') {
$this->setProperty('ArtURL','');
}
}
URL http://localhost:8080
Username (пустой)
Password (Свой пароль, от vlc)