windhamdavid 4 years ago
parent
commit
cd1c2c7e1a
2 changed files with 33 additions and 25 deletions
  1. 8 3
      js/fm.js
  2. 25 22
      page-music.php

+ 8 - 3
js/fm.js

@@ -588,16 +588,20 @@ $(function(){
 amplitude_config = {
 	"amplitude_songs": [
 		{
-			"url": "http://64.207.154.37:8008/stream",
+			"url": "http://code.davidawindham.com:8008/stream",
 			"live": true
 		}
 	],
 	"amplitude_volume": 90
 }
 
+function get_radio_tower() {
+	return '../../wp-content/themes/dw/img/radio.gif';
+}
+
 function radioTitle() {
  
-    var url = 'http://64.207.154.37:8008/status2.xsl';
+    var url = 'http://code.davidawindham.com:8008/status2.xsl';
     var mountpoint = '/stream';
  
     $.ajax({  type: 'GET',
@@ -610,7 +614,8 @@ function radioTitle() {
 			$('#track').text(json[mountpoint].title);
             $('#listeners').text(json[mountpoint].listeners);
 			$('#peak-listeners').text(json[mountpoint].peak_listeners); 
-			$('#bitrate').text(json[mountpoint].bitrate);  
+			$('#bitrate').text(json[mountpoint].bitrate); 
+			$('#radio').attr('src', get_radio_tower()).fadeIn(100); 
         },
           error: function (e) {    console.log(e.message);  
         }

+ 25 - 22
page-music.php

@@ -10,8 +10,7 @@ get_header(); ?>
 			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
 			<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 				<div id="music" class="entry-content">
-					
-					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( '%s', 'daw' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">Music</a></h2>
+					<h2 class="entry-title">Music</h2>
 					<div class="row">
 						<div class="col-sm-12">							
 							<?php class NowPlaying{
@@ -43,33 +42,37 @@ get_header(); ?>
 							} 
 							$nowPlaying = new NowPlaying('windhamdavid', 'e12ea1d0253898ee9a93edfe42ffdeab');
 							?>
-							<h5 class="cm-type"><em>Now Playing</em></h5>
-							
-							<div class="panel panel-default">
-								<div class="panel-body">
-									<div id="player">
-										<div id="song-information">
-											<div class="row">
-												<div class="col-xs-6">
-													<span id="amplitude-now-playing-listeners">Listeners: <span id="listeners">00</span> - Peak: <span id="peak-listeners">00</span></span><br>
-													<span id="amplitude-now-playing-bitrate">Bitrate: <span id="bitrate">00</span> Kbps 44.100 Khz</span>
+
+							<div class="row">
+								<div class="col-sm-9">
+									<div class="panel panel-default">
+										<div class="panel-body">
+											<div id="player">
+												<div id="song-information">
+													<div class="row">
+														<div class="col-xs-6">
+															<img id="radio" src="" title="radio" width="25px" style="float:left;margin-right:15px;">
+															<span id="amplitude-now-playing-listeners">Listeners: <span id="listeners">00</span> - Peak: <span id="peak-listeners">00</span></span><br>
+															<span id="amplitude-now-playing-bitrate">Bitrate: <span id="bitrate">00</span> Kbps 44.100 Khz</span>
+														</div>
+														<div class="col-xs-6">
+															<span id="amplitude-now-playing-name">Current track: <span id="track">* Off Air *</span></span><br>
+														</div>
+													</div>
 												</div>
-												<div class="col-xs-6">
-													<span id="amplitude-now-playing-name">Current track: <span id="track">* Off Air *</span></span><br>
+												<input class="bar" type="range" id="amplitude-volume-slider" value="90"/>
+											<div id="controls">
+												<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
+													<span id="amplitude-current-time">0:00</span>
 												</div>
+										
 											</div>
 										</div>
-										<input class="bar" type="range" id="amplitude-volume-slider" value="90"/>
-									<div id="controls">
-										<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
-											<span id="amplitude-current-time">0:00</span>
+										<div class="panel-footer">
+											<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
 										</div>
-										
 									</div>
 								</div>
-								<div class="panel-footer">
-									<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
-								</div>
 							</div>
 						</div>
 					</div>