<?php
// Players Windows/Linux/Android Link
$porta = query_string('1');

if(!is_numeric($porta)) {
die ("Error! Missing data.");
}

$verifica_stm = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM streamings where porta = '".$porta."'"));

if($verifica_stm == 0) {
die ("Error! Missing data.");
}

$dados_config = @mysqli_fetch_array(@mysqli_query($conexao,"SELECT * FROM configuracoes"));
$dados_stm = mysqli_fetch_array(mysqli_query($conexao,"SELECT * FROM streamings where porta = '".$porta."'"));
$dados_servidor = mysqli_fetch_array(mysqli_query($conexao,"SELECT * FROM servidores where codigo = '".$dados_stm["codigo_servidor"]."'"));

$total_pontos = mysqli_num_rows(mysqli_query($conexao,"SELECT * FROM multipoint where codigo_stm = '".$dados_stm["codigo"]."'"));

if($total_pontos > 0) {
$ponto = "/1";
} else {
$ponto = "/stream";
}

if(query_string('2') == "musica") {

if($dados_stm["tipo_servidor"] == "icecast") {

   $porta_admin_icecast = $dados_stm["porta"]+1;

   $dados_icecast = @file_get_contents("http://".$dados_servidor["ip"].":".$porta_admin_icecast."/status-json.xsl?mount=".$ponto);

   $dados_json_icecast = json_decode($dados_icecast, true);

   $musica_completa = ($dados_json_icecast["icestats"]["source"]["artist"]) ? $dados_json_icecast["icestats"]["source"]["artist"]." - ".$dados_json_icecast["icestats"]["source"]["title"] : $dados_json_icecast["icestats"]["source"]["title"];

} else {
   $musica_completa = @file_get_contents("http://".$dados_servidor["ip"].":".$dados_stm["porta"]."/currentsong?sid=1");
}

$musica_completa = $musica_completa;
$musica_completa = str_replace("_"," ",$musica_completa);

header('Content-Type: application/json; charset=utf-8');

echo $_GET['callback'].'({"songtitle":"'.$musica_completa.'"})';

exit();
}

$url_streaming = "https://".strtolower($dados_servidor["nome"]).".".$dados_config["dominio_padrao"].":".$dados_stm["porta"]."";
?>
<!doctype html>
<html>
<head>
   <meta charset="utf-8">
   <title><?php echo $dados_stm["streamtitle"]; ?></title>
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<style>@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700');
.icast .player-wpr{max-width:428px;min-width:270px;height:428px;background-color:#000;font-family:'Roboto Condensed',Arial,sans-serif;position:relative;margin:0 auto;border-radius:8px;overflow:hidden}.icast .blur,.icast .player-ctr{height:428px;position:absolute;top:0}.icast .player-ctr{left:0;right:0;margin:0 auto;z-index:10}.icast .blur{width:100%;background-size:cover;-webkit-filter:blur(20px): -ms-filter: blur(20px);filter:blur(20px);transform:scale(1.15);opacity:.94;z-index:1}.icast .album-cover-wpr{width:210px;margin:0 auto}.icast .album-cover{width:210px;height:210px;background:url(/img/logo.jpg);background-size:100% 100%;position:relative;margin:22px auto 0;border-radius:4px;-webkit-box-shadow:4px 6px 30px 0 rgba(0,0,0,.6);-moz-box-shadow:4px 6px 30px 0 rgba(0,0,0,.6);box-shadow:4px 6px 30px 0 rgba(0,0,0,.6);z-index:2}.icast .track-info-wpr{max-width:440px;height:40px;box-sizing:border-box;color:rgba(255,255,255,1);font-size:28px;text-align:center;position:relative;margin:28px 60px 0;padding-top:3px;border-left:1px solid rgba(255,255,255,.87);border-right:1px solid rgba(255,255,255,.87);overflow:hidden;z-index:4}.icast .track-info-ctr{max-width:280px;position:relative;margin:0 auto;overflow:hidden}.icast .songtitle{color:rgba(255,255,255,.7)}.icast .artist-name{color:rgba(255,255,255,1)}.icast .servertitle{max-width:400px;font-size:14px;color:rgba(255,255,255,.54);text-align:center;position:absolute;left:0;right:0;bottom:108px;margin:0 auto}.icast .listeners{max-width:100px;font-size:14px;color:rgba(255,255,255,.7);position:absolute;top:32px;right:22px}.icast .history-artist-name,.icast .history-songtitle{max-width:300px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.icast .listeners:before{content:"\f0c0";font-size:14px;padding-right:6px;vertical-align:top}.icast .ppBtn{width:64px;height:64px;background-position:center center;position:absolute;bottom:20px;left:0;right:0;margin:0 auto;border:4px solid rgba(255,255,255,.2);border-radius:50%;cursor:pointer}.icast .ppBtn:before{content:"";width:60px;height:60px;background-color:rgba(255,255,255,.54);position:absolute;top:2px;left:2px;border-radius:50%;transition:background-color ease .5s}.icast .icons-left,.icast .icons-right{width:24px;height:24px;font-size:24px;color:rgba(255,255,255,.92);cursor:pointer}.icast .ppBtn:hover:before{background-color:rgba(255,255,255,.44)}.icast .play-btn{background:url(/img/play.svg) center center no-repeat;background-size:42px 42px;-webkit-transition:background .5s;-moz-transition:background .5s;transition:background .5s}.icast .stop-btn{background:url(/img/pause.svg) center center no-repeat;background-size:42px 42px;-webkit-transition:background .5s;-moz-transition:background .5s;transition:background .5s}.icast .icons-left-wpr{position:absolute;bottom:20px;left:20px;z-index:11}.icast .icons-right-wpr{text-align:left;position:absolute;bottom:20px;right:20px;z-index:11}.icast .icons-left{text-align:center;margin-right:28px}.icast .icons-right{text-align:left;margin-left:28px}.icast .icons-serverinfo:before{content:"\f0c9"}.icast .icons-history:before{content:"\f1da"}.icast .icons-share:before{content:"\f1e0"}.icast .icons-volume1:before{content:"\f026"}.icast .icons-volume2:before{content:"\f027"}.icast .icons-volume3:before,.icast .icons-volumeM:before{content:"\f028"}.icast .icons-volumeM{display:none}.icast .icons-volumeM2:before{content:"\f026"}.icast .icons-close:before{content:"\f00d"}.icast .volume-slider{position:absolute;bottom:95px;right:-20px;display:none;z-index:10}.icast input[type=range]{width:90px;height:6px;background:0 0;padding:6px 0;transform:rotate(-90deg);transform-origin:bottom;-webkit-appearance:none;cursor:pointer}.icast input[type=range]:focus{outline:0}.icast input[type=range]::-webkit-slider-runnable-track{width:100%;height:6px;background:rgba(255,255,255,.54);margin:0;padding:0;border:0;border-radius:8px;cursor:pointer;animate:.2s}.icast input[type=range]:focus::-webkit-slider-runnable-track{background:rgba(255,255,255,.54)}.icast input[type=range]::-webkit-slider-thumb{width:16px;height:16px;background:#ccc;margin-top:-5px;border:5px solid #fff;border-radius:50%;cursor:pointer;-webkit-appearance:none}.icast input[type=range]::-moz-range-track{width:100%;height:6px;background:rgba(255,255,255,.54);margin:0;padding:0;border:0;border-radius:8px;cursor:pointer;animate:.2s}.icast input[type=range]::-moz-range-thumb{width:6px;height:6px;background:#ccc;border:5px solid #fff;border-radius:50%;cursor:pointer}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.icast input[type=range]{width:90px;height:16px;background:0 0;margin-top:0;padding:6px 0;cursor:pointer}}.icast input[type=range]::-ms-tooltip{display:none}.icast input[type=range]::-ms-track{width:100%;height:6px;background:0 0;color:transparent;margin:0;padding:0;border:0 transparent;cursor:pointer;animate:.2s}.icast input[type=range]::-ms-fill-lower{background:rgba(255,255,255,.54);border:0;border-radius:8px}.icast input[type=range]::-ms-fill-upper{background:rgba(255,255,255,.54);border:0;border-radius:8px}.icast input[type=range]::-ms-thumb{width:6px;height:6px;background:#ccc;border:5px solid #fff;border-radius:50%;cursor:pointer}.icast input[type=range]:focus::-ms-fill-lower{background:rgba(255,255,255,.54)}.icast input[type=range]:focus::-ms-fill-upper{background:rgba(255,255,255,.54)}.icast .history-wpr{position:absolute;top:0;left:0;right:0;margin:22px auto 0;z-index:5}.icast .history-title{font-size:28px;color:rgba(255,255,255,1);margin:0 22px 15px;padding-bottom:5px;border-bottom:1px solid rgba(255,255,255,.7)}.icast .row-wpr{height:50px;background-color:rgba(255,255,255,.2);position:relative;margin:0 22px 9px;border-radius:5px}.icast .history-cover{width:40px;height:40px;position:absolute;top:6px;left:8px;border-radius:50%}.history-track-info{text-align:left;padding-left:55px;padding-top:5px}.icast .rowNum,.icast .social-share-wpr{text-align:center;position:absolute;right:0}.icast .history-songtitle{font-size:19px;color:rgba(255,255,255,1)}.icast .history-artist-name{font-size:16px;color:rgba(255,255,255,.7)}.icast .rowNum{width:38px;height:50px;font-size:42px;color:rgba(255,255,255,.2);top:0}.icast .social-share-wpr{width:210px;height:210px;box-sizing:border-box;background-color:rgba(0,0,0,.3);color:#fff;font-size:18px;line-height:30px;top:22px;left:0;margin:0 auto;padding:70px 0;border-radius:4px;overflow:hidden;display:none;z-index:11}.icast .social-link{width:38px;height:38px;font-size:24px;color:#fff;line-height:38px;text-decoration:none;margin:0 4px;border-radius:50%;display:inline-block;cursor:pointer}.icast .social-link-facebook{background:#3F51B5}.icast .social-link-facebook:before{content:"\f09a"}.icast .social-link-twitter{background:#2196F3}.icast .social-link-twitter:before{content:"\f099"}.icast .display{display:block}.icast .nodisplay{display:none}@media only screen and (max-width:600px){.icast .track-info-wpr{margin:28px 42px 0}.icast .listeners{max-width:100px;font-size:12px;color:rgba(255,255,255,.7);position:absolute;top:32px;right:16px}.icast .listeners:before{content:"\f0c0";font-size:12px;padding-right:5px;vertical-align:top}}.animated{animation-duration:1s;animation-fill-mode:both}.animated.bounceIn{animation-duration:.75s}@keyframes bounceIn{20%,40%,60%,80%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:scale3d(.3,.3,.3)}20%{transform:scale3d(1.1,1.1,1.1)}40%{transform:scale3d(.9,.9,.9)}60%{opacity:1;transform:scale3d(1.03,1.03,1.03)}80%{transform:scale3d(.97,.97,.97)}to{opacity:1;transform:scale3d(1,1,1)}}.bounceIn{animation-name:bounceIn}@keyframes bounceInDown{60%,75%,90%,from,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}.bounceInDown{animation-name:bounceInDown}.marquee{white-space:nowrap;position:relative;transform:translateX(-50%);display:inline-block;left:50%;padding-top:0;animation:linear infinite;overflow:hidden;text-align:left;animation-duration:10s;animation-name:movement-smooth;animation-direction:normal}.marquee:hover{animation-play-state:paused}.marquee.marquee-speed-custom:before{animation-duration:inherit}.marquee.marquee-speed-normal:before{animation-duration:10s}@keyframes movement-smooth{from{transform:translateX(0);left:100%}to{transform:translateX(-100%);left:0}}.marquee.marquee-movement-smooth:before{animation-name:movement-smooth}.marquee.marquee-direction-left:before,.marquee.marquee-direction-normal:before{animation-direction:normal}</style>
</head>



<body>

    <div class="icast" id="player"></div>
        <script>
		(function($){"use strict";$(".icast").append('<div class="player-wpr"><div class="blur"></div><div class="player-ctr"><div class="listeners fa"></div><div class="album-cover-wpr"><div class="social-share-wpr animated"> Share<br> <a href="" target="_blank" class="social-link social-link-facebook fa animated" id="aface"></a> <a href="" target="_blank" class="social-link social-link-twitter fa animated" id="atwitter"></a></div><div class="album-cover animated"></div></div><div class="track-info-wpr"><div class="track-info-ctr"><div class="marquee"> <span class="artist-name animated">Artist</span><span> - </span><span class="songtitle animated">Songtitle</span></div></div></div><div class="ppBtn play-btn"></div><div class="servertitle"></div></div><div class="icons-left-wpr"><div class="icons-left icons-history fa"></div></div><div class="icons-right-wpr"><div class="icons-right icons-volume fa"></div><div class="icons-right icons-volumeM fa"></div></div> <input class="volume-slider" type="range" min="0" max="100" step="0.10" value="" autocomplete="off"><div class="history-wpr nodisplay"><div class="history-title">Last Played Songs</div></div></div>');$.fn.icast=function(options){var settings=$.extend({URL:"<?php echo $url_streaming; ?>",version:"2",stream_id:1,mount_point:"<?php echo $ponto; ?>",type:"/;type=mp3",streampath:"<?php echo $ponto; ?>",enable_cors:!0,cors:"/player-box/<?php echo $dados_stm["porta"]; ?>/musica/",artwork:!0,logo:"/img/logo.jpg",servertitle:"My Radio Title",show_listeners:!0,src:"",volume:0.75,autoplay:!1},options);var thisObj;thisObj=this;var audio;var ppBtn=$(".ppBtn",thisObj);var cVolumeSlider=$(".volume-slider",thisObj);var cVolumeIcon=$(".icons-volume",thisObj);var cVolumeIconM=$(".icons-volumeM",thisObj);audio=new Audio();audio.volume=settings.volume;audio.preload="auto";$(".album-cover",thisObj).css({'background-image':'url('+settings.logo+')','background-size':'100% 100%'});$(".blur",thisObj).css({'background':'url('+settings.logo+')','background-size':'100% 100%'});thisObj.each(function(){if(settings.autoplay==!0){audio.autoplay=!0}
if(settings.show_listeners==!1){$(".listeners",thisObj).addClass("nodisplay")}
if(settings.version==1){audio.src=settings.URL+"<?php echo $ponto; ?>";settings.src=audio.src;var dataURL="<?php echo $url_streaming; ?>/7.html";var hisURL="/musica-atual/<?php echo $dados_stm["porta"]; ?>/played.html";getSH(dataURL,hisURL)}
else if(settings.version==2){audio.src=settings.URL+settings.streampath;settings.src=audio.src;if(settings.enable_cors==!0){var dataURL=settings.cors+"?q="+settings.URL+"/7.html";var hisURL=settings.cors+"?q="+settings.URL+"/played.html/"}
else{var dataURL="";var hisURL="/musica-atual/<?php echo $dados_stm["porta"]; ?>/played.html/"}
getSH(dataURL,hisURL)}
else if(settings.version=="icecast"){audio.src=settings.URL+"/"+settings.mount_point;settings.src=audio.src;var dataURL=settings.cors+"?q="+settings.URL+"/status-json.xsl";getIC(dataURL)}});function togglePlying(tog,bool){$(tog).toggleClass("playing",bool)}
function playHandling(){if(audio.paused){audio.src=settings.src;audio.play();var $playing=$('.ppBtn.playing');if($(thisObj).find($playing).length===0){$playing.click()}}
else{audio.pause()}}
$(audio).on("playing",function(){togglePlying(ppBtn,!0);$(ppBtn).addClass("stop-btn");$(ppBtn).removeClass("play-btn")});$(audio).on("pause",function(){togglePlying(ppBtn,!1);$(ppBtn).removeClass("stop-btn");$(ppBtn).addClass("play-btn")});$(ppBtn,thisObj).on("click tap",function(){playHandling()});var volVal=audio.volume*100;$(cVolumeSlider).val(volVal);$(".volValueTxt",thisObj).text(volVal+'%');volumeIcon();function volumeIcon(){if($(cVolumeSlider).val()<55&&$(cVolumeSlider).val()>0){$(cVolumeIcon).removeClass("icons-volume3 icons-volume1");$(cVolumeIcon).addClass("icons-volume2")}
if($(cVolumeSlider).val()==0){$(cVolumeIcon).removeClass("icons-volume2 icons-volume3");$(cVolumeIcon).addClass("icons-volume1")}
else if($(cVolumeSlider).val()>55){$(cVolumeIcon).removeClass("icons-volume1 icons-volume2");$(cVolumeIcon).addClass("icons-volume3")}}
$(cVolumeIconM).on("click tap",function(){$(cVolumeIconM).toggleClass("icons-volumeM2");if($(cVolumeIconM).hasClass("icons-volumeM2")){audio.volume=0}
else{audio.volume=settings.volume}});$(".icons-volume",thisObj).on("click",function(){$(cVolumeSlider).toggleClass("display")});$(cVolumeSlider).mouseup(function(){$(this).removeClass("display")});if(navigator.appName=='Microsoft Internet Explorer'||!!(navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/rv:11/))||(typeof $.browser!=="undefined"&&$.browser.msie==1))
{cVolumeSlider.change('input',function(){audio.volume=parseInt(this.value,10)/100;var volumeVal=audio.volume*100;var volumeVal=Math.round(volumeVal);$(".vol-value",thisObj).text('Volume:'+volumeVal+'%');volumeIcon()},!1)}
else{cVolumeSlider.on('input',function(){var volumeVal=$(cVolumeSlider).val();audio.volume=volumeVal/100;var volumeVal=Math.round(volumeVal);$(".volValueTxt",thisObj).text(volumeVal+'%')
volumeIcon()})}
function formatArtist(artist){artist=artist.toLowerCase();artist=$.trim(artist);if(artist.includes("&")){artist=artist.substr(0,artist.indexOf(' &'))}
else if(artist.includes("feat")){artist=artist.substr(0,artist.indexOf(' feat'))}else if(artist.includes("ft.")){artist=artist.substr(0,artist.indexOf(' ft.'))}
return artist}
function formatTitle(title){title=title.toLowerCase();title=$.trim(title);if(title.includes("&")){title=title.replace('&','and')}
else if(title.includes("(")){title=title.substr(0,title.indexOf(' ('))}else if(title.includes("ft")){title=title.substr(0,title.indexOf(' ft'))}
return title}
function getSH(url,sHistory){if(settings.version==1){function foo(){$.ajax({type:'GET',dataType:'html',url:url,success:function(data){var result=$.parseHTML(data)[1].data;var songtitle=result.split(",")[6];if(songtitle!=getTag()){updateTag(songtitle);var songtitleSplit=songtitle.split('-');var artist=songtitleSplit[0];var title=songtitleSplit[1];updateArtist(artist);updateTitle(title);updateServerInfo(result);if(settings.artwork==!0){getCover(artist,title)};updateHistoryIC(artist,title);FBShare(result);TWShare2(result)}},error:function(){console.log("error getting metadata")}})}
foo();setInterval(foo,12000)}
else if(settings.version==2){function foo(){$.ajax({dataType:'jsonp',url:url,success:function(result){if(result.songtitle!=getTag()){updateTag(result.songtitle);var songtitle=result.songtitle;var songtitleSplit=songtitle.split('-');var artist=songtitleSplit[0];var title=songtitleSplit[1];var servertitle=result.servertitle;updateArtist(artist);updateTitle(title);updateServerInfo(result);updateHistory(sHistory);if(settings.artwork==!0){getCover(artist,title)};FBShare(result);TWShare(result)}},error:function(){console.log("error getting metadata")}})}
foo();setInterval(foo,12000)}}
function getIC(url){if(settings.version=="icecast"){function foo(){$.ajax({dataType:'json',url:settings.cors+"/?q="+settings.URL+"/status-json.xsl",success:function(data){var result=findMPData(data);if(result.title!=getTag()){updateTag(result.title);var songtitle=result.title;var songtitleSplit=songtitle.split('-');var artist=songtitleSplit[0];var title=songtitleSplit[1];updateArtist(artist);updateTitle(title);if(settings.artwork==!0){getCover(artist,title)};updateServerInfoIC(result);updateHistoryIC(artist,title);FBShare(result);TWShare3(result)}},error:function(){console.log("error getting metadata")}})}
foo();setInterval(foo,12000)}}
var icHis=new Array();function findMPData(data){if(data.icestats.source.length===undefined){return data.icestats.source}
else{for(var i=0;i<data.icestats.source.length;i++){var str=data.icestats.source[i].listenurl;if(str.indexOf(settings.mount_point)>=0){return data.icestats.source[i]}}}}
function getTag(){return $(thisObj).attr("data-tag")}
function updateArtist(name){$(".artist-name",thisObj).text(name)}
function updateTitle(name){$(".songtitle",thisObj).text(name)}
function updateTag(data){$(thisObj).attr("data-tag",data)}
function getCover(artist,title){artist=formatArtist(artist);title=formatTitle(title);artist=encodeURI(artist);title=encodeURI(title);var url="https://itunes.apple.com/search?term=="+artist+"-"+title+"&media=music&limit=1";$.ajax({dataType:'jsonp',url:url,success:function(data){if(data.results.length==1){cover=data.results[0].artworkUrl100;cover=cover.replace('100x100','400x400')}
else{var cover=settings.logo}
$(".album-cover",thisObj).css({'background-image':'url('+cover+')','background-size':'100% 100%'});$(".album-cover",thisObj).addClass("bounceInDown");setTimeout(function(){$(".album-cover",thisObj).removeClass("bounceInDown")},5000);$(".blur",thisObj).css({'background':'url('+cover+')','background-size':'100% 100%'})},error:function(){console.log("Error on track title "+encodeURI(title))}})}
function updateServerInfo(result){if(settings.version==1){$(".servertitle",thisObj).text(settings.servertitle);$(".listeners",thisObj).text(result.split(",")[0])}
else if(settings.version==2){$(".servertitle",thisObj).text(result.servertitle);$(".listeners",thisObj).text(result.currentlisteners)}}
function updateServerInfoIC(data){$(".servertitle",thisObj).text(data.server_name);$(".listeners",thisObj).text(data.listeners)}
function updateHistory(url){$(".history ul li",thisObj).remove();if(settings.version==1){}
else if(settings.version==2){$(".row-wpr",thisObj).remove();$.ajax({dataType:'jsonp',url:url,success:function(data){data.length=6;for(var i=1;i<data.length;i++){var rowNum=i;var listVal=rowNum;var songtitle=data[i].title;var songtitleSplit=songtitle.split('-');var artist=songtitleSplit[0];var title=songtitleSplit[1];$(".history-wpr",thisObj).append("<div class='row-wpr'><div class='history-cover' id='row"+rowNum+"'></div><div class='history-track-info'><div class='history-songtitle'>"+title+"</div><div class='history-artist-name'>"+artist+"</div></div><div class='rowNum'>"+listVal+"</div></div>");if(settings.artwork==!0){getImageList(artist,title,rowNum)}
else{$('#row'+i,thisObj).css({"background-image":"url("+settings.logo+")","background-size":"100% 100%"})}}}})}}
function updateHistoryIC(artist,title){addToArray(artist,title);createHisList()}
function addToArray(artist,title){icHis.unshift({ar:artist,tt:title});icHis.length=icHis.length<6?icHis.length:6}
function createHisList(){$(".row-wpr",thisObj).remove();for(var i=1;i<icHis.length;i++){var rowNum=i;var listVal=rowNum;var artist=icHis[i].ar;var title=icHis[i].tt;$(".history-wpr",thisObj).append("<div class='row-wpr'><div class='history-cover' id='row"+rowNum+"'></div><div class='history-track-info'><div class='history-songtitle'>"+title+"</div><div class='history-artist-name'>"+artist+"</div></div><div class='rowNum'>"+listVal+"</div></div>");if(settings.artwork==!0){getImageList(artist,title,rowNum)}
else{$('#row'+i,thisObj).css({"background-image":"url("+settings.logo+")","background-size":"100% 100%"})}}}
function getImageList(artist,title,i){artist=formatArtist(artist);title=formatTitle(title);artist=encodeURI(artist);title=encodeURI(title);var url="https://itunes.apple.com/search?term=="+artist+"-"+title+"&media=music&limit=1";$.ajax({dataType:'jsonp',url:url,success:function(data){if(data.results.length==1){cover=data.results[0].artworkUrl100;cover=cover.replace('100x100','400x400')}
else{var cover=settings.logo}
$('#row'+i,thisObj).css({"background-image":"url("+cover+")","background-size":"100% 100%"})},error:function(){console.log("#getImageList(), Error in loading history image list for "+decodeURI(artist))}})}
$(".icons-history",thisObj).on("click tap",function(){$(".icons-history",thisObj).toggleClass("icons-close");if(!$(".player-ctr",thisObj).hasClass("open")){$(".player-ctr",thisObj).fadeOut(400);$(".history-wpr",thisObj).delay(600).fadeIn(400);$(".player-ctr",thisObj).addClass("open")}
else if($(".player-ctr",thisObj).hasClass("open")){$(".player-ctr",thisObj).removeClass("open");$(".history-wpr",thisObj).fadeOut(400);$(".player-ctr",thisObj).delay(600).fadeIn(400)}});$(".album-cover-wpr",thisObj).hover(function(){$(".social-share-wpr",thisObj).toggleClass("display");$(".social-link-twitter",thisObj).toggleClass("bounceIn");$(".social-link-facebook",thisObj).toggleClass("bounceIn")})
function FBShare(result){var siteURL=window.location.href;var url="https://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(siteURL);$("#aface",thisObj).attr("href",url)}
function TWShare(result){var siteURL=window.location.href;var url="https://twitter.com/home?status=I'm listening to "+result.songtitle+" @ "+siteURL;$("#atwitter",thisObj).attr("href",url)}
function TWShare2(result){var siteURL=window.location.href;var url="https://twitter.com/home?status=I'm listening to "+result.split(",")[6]+" @ "+siteURL;$("#atwitter",thisObj).attr("href",url)}
function TWShare3(result){var siteURL=window.location.href;var url="https://twitter.com/home?status=I'm listening to "+result.title+" @ "+siteURL;$("#atwitter",thisObj).attr("href",url)}
if(/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)){$(cVolumeIcon).addClass("nodisplay");$(cVolumeIconM).addClass("display")}}})(jQuery)
          $("#player").icast({
        URL: "<?php echo $url_streaming; ?>",
      version: "2",
          })
       </script>

</body>
</html>