cms/app-client/app/components/player-component.js
changeset 87 24fef043ea0b
parent 86 15ded106ef1a
child 91 acfeddc7821d
--- a/cms/app-client/app/components/player-component.js	Tue Jan 19 19:06:17 2016 +0100
+++ b/cms/app-client/app/components/player-component.js	Wed Jan 20 00:15:46 2016 +0100
@@ -20,11 +20,11 @@
     this.audio = new Audio("http://stop.com.pk/file/music_folder/700.mp3");
 
     this.button = {
-      play: $('#action_play'),
-      progress: $('.progress')
+      play: this.$('#action_play'),
+      progress: this.$('.progress')
     };
 
-		$(document).on('touchmove', function(e){
+		this.$(document).on('touchmove', function(e){
 			e.preventDefault();
 		});
 
@@ -45,7 +45,6 @@
 		this.audio.addEventListener('timeupdate',function (){
 			var curtime = _this.audio.currentTime,
 				percent = (curtime/_this.audio.duration)*100,
-				rounded = Math.round(percent*1000)/1000,
 				deg = 360/100*percent,
         minutes = Math.floor( curtime / 60),
         seconds =  Math.floor(curtime) % 60;
@@ -66,7 +65,7 @@
     this.audio.currentTime = t;
   },
   updateProgress: function(deg){
-    var $slice = $('.slice');
+    var $slice = this.$('.slice');
 
     if (deg > 180 && !$slice.is('.gt50')) {
       $slice.addClass('gt50');
@@ -110,6 +109,9 @@
       } else {
         this.play();
       }
+    },
+    prevNextSong(change){
+      this.sendAction("action", change);
     }
   }
 });