Browse Source

Fixed bug that song doesn't skip after timer runs out.

KrisVos130 9 years ago
parent
commit
17bf062732
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/app.js

+ 2 - 1
app/app.js

@@ -964,6 +964,7 @@ if (Meteor.isServer) {
     }
     }
 
 
     function Station(type) {
     function Station(type) {
+        var _this = this;
         var startedAt = Date.now();
         var startedAt = Date.now();
         var playlist = Playlists.find({type: type}).fetch()[0];
         var playlist = Playlists.find({type: type}).fetch()[0];
         var songs = playlist.songs;
         var songs = playlist.songs;
@@ -1026,7 +1027,7 @@ if (Meteor.isServer) {
             startedAt = Date.now();
             startedAt = Date.now();
 
 
             timer = new Timer(function() {
             timer = new Timer(function() {
-                this.skipSong();
+                _this.skipSong();
             }, songs[currentSong].duration * 1000);
             }, songs[currentSong].duration * 1000);
         };
         };