Some changes, clean code
This commit is contained in:
		
							
								
								
									
										15
									
								
								js/audio.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								js/audio.js
									
									
									
									
									
								
							@@ -2,6 +2,8 @@ var stream_url = 'http://stream.santic-zombie.ru';
 | 
			
		||||
 | 
			
		||||
var audio = new Audio(stream_url);
 | 
			
		||||
 | 
			
		||||
audio.volume = 0.01;
 | 
			
		||||
 | 
			
		||||
var play = document.getElementById('play');
 | 
			
		||||
play.addEventListener('click', function() {
 | 
			
		||||
  $("#myPlay").text("Now playing:");
 | 
			
		||||
@@ -14,19 +16,6 @@ pause.addEventListener('click', function() {
 | 
			
		||||
  audio.pause();
 | 
			
		||||
  }, false);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
audio.addEventListener("timeupdate", function() {
 | 
			
		||||
  var duration = document.getElementById('duration');
 | 
			
		||||
  var s = parseInt(audio.currentTime % 60);
 | 
			
		||||
  var m = parseInt((audio.currentTime / 60) % 60);
 | 
			
		||||
  var h = parseInt((audio.currentTime / 3600) % 60);
 | 
			
		||||
  if (s < 10) s = '0' + s;
 | 
			
		||||
  if (m < 10) m = '0' + m;
 | 
			
		||||
  if (h < 10) h = '0' + h;
 | 
			
		||||
  duration.innerHTML = h + ':' + m + ':' + s;
 | 
			
		||||
  }, false);
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
$("#volume").mousemove(function(){
 | 
			
		||||
  audio.volume = parseFloat(this.value / 10);
 | 
			
		||||
  });
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,6 @@ function show()
 | 
			
		||||
      MPDartist = array[0];
 | 
			
		||||
      MPDsong = array[1];
 | 
			
		||||
      MPDfile = array[2].replace(/^vk_kun\//,'').replace(/\.mp3/,'');
 | 
			
		||||
      //console.log(MPDartist);
 | 
			
		||||
 | 
			
		||||
      if (MPDartist == '' && MPDCurr != MPDfile) {
 | 
			
		||||
        MPDartist = MPDfile.replace(/\s-.*/,'').replace(/^\s*/,'').replace(/\s*$/,'');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user