var dftAlbumArt='https://cdnrf.securenetsystems.net/file_radio/stations_large/JCH/v5/album-art-default.png'; var xmlpath='https://radio.securenetsystems.net/player_status_update/JCH.xml'; var livepath='https://radio.securenetsystems.net/cirruscontent/JCH'; var d = new Date(); var localServerTSoffset = d.getTime()+d.getTimezoneOffset()*60000 - Date.parse("15 Oct 2024 12:34:02"); //var stationSlogan="Home of the Jackson County Blue Devils"; //load params var scripts = document.getElementsByTagName('script'); var index = scripts.length - 1; var myScript = scripts[index]; var queryString = myScript.src.replace(/^[^\?]+\??/,''); //console.log(queryString); var params = ssilive_parseQuery( queryString ); var rc=params['b']; var b_id=rc.replace('.',''); document.write('
On now
Listen live
'); //load jquery if is not included if(window.addEventListener){ window.addEventListener('load', ssiLiveButton_loadJq(b_id)) }else{ window.attachEvent('onload', ssiLiveButton_loadJq(b_id)) } function ssiLiveButton_loadJq(b_id){ //load jquery if is not present if (typeof(jQuery) == 'undefined') { var script = document.createElement('script'); script.type = "text/javascript"; script.onload = function(){ssiLiveButton_makeWidget(b_id);setTimeout("ssi_pulsateButton()",1000); } script.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(script); }else{ ssiLiveButton_makeWidget(b_id); setTimeout("ssi_pulsateButton()",1000); } var cssfile = document.createElement('link'); cssfile.rel = "stylesheet"; cssfile.type = "text/css"; cssfile.href = "//radio.securenetsystems.net/cirrusencore/livebutton/livebutton.css"; document.getElementsByTagName('head')[0].appendChild(cssfile); }; function ssi_pulsateButton(){ //jQuery('.ssiLiveButton_playButtonClone').animate({opacity:0.3},{ duration: 800, queue: false, complete:function(){ssi_pulsateButtonBack() }}); //jQuery('.ssiLiveButton_playButtonClone').animate({borderLeftWidth:64,borderTopWidth:32,borderBottomWidth:32,bottom:'0px',right:'0px',opacity:0},{ duration: 1500, queue: false, complete:function(){ssi_pulsateButtonBack() }}); //jQuery('.ssiLiveButton_playButtonClone2').animate({borderLeftWidth:58,borderTopWidth:29,borderBottomWidth:29,bottom:'3px',right:'3px',opacity:1},{ duration: 1500, queue: false, complete:function(){ }}); } function ssi_pulsateButtonBack(){ //jQuery('.ssiLiveButton_playButtonClone').animate({opacity:0},{ duration: 200, queue: false, complete:function(){setTimeout("ssi_pulsateButton()",1000); }}); jQuery('.ssiLiveButton_playButtonClone').animate({borderLeftWidth:40,borderTopWidth:20,borderBottomWidth:20,bottom:'12px',right:'15px',opacity:0},{ duration: 200, queue: false, complete:function(){jQuery('.ssiLiveButton_playButtonClone').css('opacity',1);setTimeout("ssi_pulsateButton()",1500); }}); jQuery('.ssiLiveButton_playButtonClone2').animate({borderLeftWidth:40,borderTopWidth:20,borderBottomWidth:20,bottom:'12px',right:'15px',opacity:1},{ duration: 200, queue: false, complete:function(){ }}); } //get station settings and podcasts list function ssiLiveButton_makeWidget(b_id){ if (typeof(jQuery) == 'undefined') { setTimeout(function(){ssiLiveButton_makeWidget(b_id);},200); return false; } var xmlpath=jQuery("#b_"+b_id).data('xmlpath'); var localServerTSoffset=jQuery("#b_"+b_id).data('localservertsoffset'); jQuery.ajax({url: xmlpath+"?randStr=" + Math.random(), type: "GET", dataType: "xml", success: function(xml){ var nextsongReqTime=5000; if(jQuery(xml).find("programType").text() && jQuery(xml).find("title").text()){ if(jQuery(xml).find("title").text()==jQuery("#b_"+b_id).find('.ssiLiveButton_Title').text() && jQuery(xml).find("programStartTS").text()==jQuery("#b_"+b_id).find('.ssiLiveButton_text').data('programstartts')){ nextsongReqTime=2000; }else{ //console.log('set current play'); jQuery("#b_"+b_id).find('.ssiLiveButton_Title').html('
'+jQuery(xml).find("title").text()+'
'); scrolltxt(jQuery("#btxt_"+b_id),'title'+b_id); jQuery("#b_"+b_id).find('.ssiLiveButton_Artist').html('
'+jQuery(xml).find("artist").text()+'
'); scrolltxt(jQuery("#btxt2_"+b_id),'artist'+b_id); jQuery("#b_"+b_id).find('.ssiLiveButton_Album').html('
'+jQuery(xml).find("album").text()+'
'); scrolltxt(jQuery("#btxt3_"+b_id),'album'+b_id); var nprogramCover=jQuery(xml).find("cover").text(); if(nprogramCover==''){ nprogramCover=jQuery("#b_"+b_id).data('dftalbumart'); } nprogramCover=nprogramCover.replace('http:','https:'); jQuery("#b_"+b_id).css('background-image',"url('"+nprogramCover+"')"); var programDuration=jQuery(xml).find("duration").text(); var programStartTS=jQuery(xml).find("programStartTS").text(); jQuery("#b_"+b_id).find('.ssiLiveButton_text').data('programstartts',programStartTS) var d = new Date(); var current_play= parseInt(((d.getTime()+d.getTimezoneOffset()*60000) - localServerTSoffset - Date.parse(programStartTS))/1000); var nextsongReqTime=(parseInt(programDuration)-current_play)*1000-10000; if(nextsongReqTime<2000){ nextsongReqTime=2000; } } //console.log(':refresh:'+nextsongReqTime); setTimeout("ssiLiveButton_makeWidget('"+b_id+"')",nextsongReqTime); }else{ jQuery("#b_"+b_id).find('.ssiLiveButton_Title').html('
'+jQuery("#b_"+b_id).data('stationslogan')+'
'); scrolltxt(jQuery("#btxt_"+b_id),'title'+b_id); jQuery("#b_"+b_id).find('.ssiLiveButton_Artist').html('
'+jQuery(xml).find("artist").text()+'
'); scrolltxt(jQuery("#btxt2_"+b_id),'artist'+b_id); jQuery("#b_"+b_id).find('.ssiLiveButton_Album').html('
'+jQuery(xml).find("album").text()+'
'); scrolltxt(jQuery("#btxt3_"+b_id),'album'+b_id); var nprogramCover=''; if(nprogramCover==''){ nprogramCover=jQuery("#b_"+b_id).data('dftalbumart');; } nprogramCover=nprogramCover.replace('http:','https:'); jQuery("#b_"+b_id).css('background-image',"url('"+nprogramCover+"')"); //console.log(programType+':refresh:5000'); setTimeout("ssiLiveButton_makeWidget('"+b_id+"')",5000); } }, error: function() { } }); } function ssilive_parseQuery ( query ) { var Params = new Object (); if ( ! query ) return Params; // return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) continue; var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } var ssi_scroll_text=new Array(); function scrolltxt(el,s) { clearInterval(ssi_scroll_text[s]); if( (el.find('span').width()) > el.parent().width() ) { setTimeout(function(){ssi_scroll_text[s] = setInterval(function() { scrollText(el,s); }, 28); },3000) }; var scrollText = function() { var width = el.find('span').width(), left = el.position().left - 1; left = -left > width ? el.width() : left; el.css({left: left}); }; };