HTML5 Radio Player PHP Veriyi Çekememesi

Mert Nalkıran

Hectopat
Katılım
17 Haziran 2015
Mesajlar
174
Makaleler
2
Yer
Zonguldak
Daha fazla  
Cinsiyet
Erkek
Meslek
Öğrenci
Elimde bir tane radyo sitesi var ve Shoutcast v2 kurulu. WHMSonic panelinde kendi verdiği Advanced HTML5 Radio Player dosyaları mevcut fakat doğru şekilde siteye ekleyemedim verileri çekemiyor sanırım. PHP'den anlamıyorum o yüzden sorun nedir bilenler yardımcı olursa sevinirim.
Paneldeki playerin orijinal dosyalarını buraya paylaşırsam sanırım daha mantıklı olur.

>> advanced.zip <<

player.php
Kod:
<?include "inc/config.php";?>
<head>

<meta charset="utf-8">
<title>HTML5 WHMSonic Radio Player</title>
<link rel="stylesheet" href="js/player.css">
<script type="text/javascript" src="js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.js"></script>
<script type="text/javascript" src="js/system.js"></script>

<script type="text/javascript">
$(document).ready(function(){
$(document).find('.webPlayer').each(function() { $('#'+this.id).videoPlayer(); });
});
</script>

<script type="text/javascript">
$(document).ready(function(){
//********* songname is a div set to the player, in js/system.js line 27. #artist and #trackname comes from get_info.php *********//
function songtitle() {
$.get("inc/get_info.php",{} ,function(data){ $("#songname").html(data); $('#songname').fadeIn("fast");


var artist = $('#artist').val();
var track = $('#trackname').val();
artist= artist,
track= track
$.ajax({
url: '<? if($show_album_art == 'on' && $show_song_title == 'on') { echo 'http://itunes.apple.com/search'; } ?>',
data: {
term: artist + ' ' + track,
media: 'music'
},
dataType: 'jsonp',
success: function(json) {
if(json.results.length === 0) {
$('img[name="nowplayingimage"]').attr('src', '');
return;
}

// trust the first result blindly...
var artworkURL = json.results[0].artworkUrl100;
$('img[name="nowplayingimage"]').attr('src', artworkURL);
}
});
});


setInterval(songtitle, <? echo 1000 * 60 * $song_title_update; ?>);
} // Song title function
songtitle();

$("#songname").css({"color":"<? echo $song_title_color; ?>"});
$("#songname").css({"width":"<? echo $song_title_width; ?>"});
$("#uniquePlayer-5").css({"background":"<? echo $player_background_color; ?>"});
$("#art").css({"background":"<? echo $player_background_color; ?>"});
});
</script>
</head>

<div id=art class=albumart><img src="" name="nowplayingimage"></div>
<div id="uniquePlayer-5" class="webPlayer light audioPlayer">
<div id="uniqueContainer-5" class="videoPlayer"></div>
<div style="display:none;" class="playerData">
                    {
                    "autoplay": "true",
                    "size": { "width": "<? echo $player_size_width; ?>" },
                    "media": {
                    "m4a": "http://<? echo $radio_ip; ?>:<? echo $radio_port; ?>/;"
                    }
                    }
</div>
</div>

config.php
Kod:
<?
//Radio Options
$radio_ip = '192.168.1.186';
$radio_port = '8000';
$show_song_title = 'on'; // show_song_title: on - off. When it is on, it will show the currently playing song name on the player.
$show_album_art = 'on'; // Options: on - off. If this is on, the script will search the itunes search API for the currently playing song image and will show it on the player. If it doesnt find the image on itunes, it will not show the image and div. The script inserts the image file into <img src= name=nowplayingimage> in the player.php file. You can change the location of this image on the page or on your website. If $show_song_title is set off, this option will be ignored and set off. This is only available when $show_song_title is on.
$song_title_update = '1'; // The song name update interval in MINUTE form. 2 means 2 minute. That means the script will update the song name and album art every 2 minutes.
// Color Options, if you need white or transparent background use preimg.light.png and other .png files in the img folder, set them in js/player.css.
$song_title_color = '#049f21';
$player_background_color = '#0b0b0b';
$player_size_width = '400px'; // Minumum 400px is suggested, below 300 the song name will expand if it is long.
$song_title_width = '400px';
?>
Not: Bir de get_radio.php dosyamız var fakat uzun diye buraya atamadım.
Config.php dosyasından radio_ip ve radio_port kısmına kendi radyo ip ve portunu yazdım fakat kod burdan çekip alamıyor veriyi.
 
Konudan anlamam ama config.php içindeki $radio_ip = '192.168.1.186'; lokal IP, belki oraya doğru IP yazılırsa çalışır
 
Tarayıcınızın console bölümüne bakın ve orda yazan hata kodlarını çözmeye çalışın.
 
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…