← PHP

web radio player

Lida 4445 vezes

Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

Visto que a malta aqui curte imenso rádios  :lol: algum de vocês pode explicar ou facultar o código para aparecer as musicas que está no current song em um web player num site?


agradecido
Offline

tiovivi 
Membro
Mensagens 865 Gostos 0
Troféus totais: 27
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 500 Posts

:/
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Depende.. Por exemplo, o CentovaCast tem isso já pré-feito...
Offline

dementor4842 
Membro
Mensagens 471 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Exacto, no centova já tens um arquivo que e só aplicar no player e ele vai buscar a informação automaticamente, pelo WHMSonic não sei :s
Offline

Thomato 
Membro
Mensagens 4125 Gostos 3
Feedback +2

Troféus totais: 28
Trófeus: (Ver todos)
Apple User Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2

Mas existem scripts globais... Eu tenho uns quantos por aqui, é só procurar ;)
Offline

anjo2 
Membro
Mensagens 3020 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

tiovivi, às vezes em vez de criticares sem teres a noção do que estás a dizer, devias pensar que existe telhados de vidros... mas ok

Para Shoutcast e em php:
<?php
        $ip 
"82.102.13.202";
        
$port "8222";
        
$handle = @fsockopen($ip$port$errno$errstr30);
        if(!
$handle) die("Problem connecting to radio");

        
$header "GET /7 HTTP/1.1\n";
        
$header .= "User-Agent:Mozilla\n\n";
        
fwrite($handle$header);
        
$data "";
        while(!
feof($handle))
                
$data .= fgets($handle,128);
        
fclose($handle);
        if(
preg_match("/<body>(.*)<\/body>/"$data$result))
                list(
$listeners,$status,$peak,$max,$unique,$bitrate,$song) = explode(","$result[1], 7);
        else die(
"Problem with data results");
?>


É só mudar o ip e a porta, e usar o $song ou qualquer outra variável que está na lista.