2
0
Эх сурвалжийг харах

Fixed issue where some songs would start at the beginning instead of of starting at the skipDuration.

KrisVos130 9 жил өмнө
parent
commit
ba0b98b72b
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  1. 5 0
      app/client/client.js

+ 5 - 0
app/client/client.js

@@ -1228,6 +1228,7 @@ Template.room.onCreated(function () {
                         playerVars: {controls: 0, iv_load_policy: 3, rel: 0, showinfo: 0},
                         events: {
                             'onReady': function(event) {
+                                console.log(currentSong);
                                 if(currentSong.skipDuration === undefined){
                                     currentSong.skipDuration = 0;
                                 }
@@ -1250,6 +1251,10 @@ Template.room.onCreated(function () {
                     });
                 } else {
                     yt_player.loadVideoById(currentSong.id);
+                    if(currentSong.skipDuration === undefined){
+                        currentSong.skipDuration = 0;
+                    }
+                    yt_player.seekTo(Number(currentSong.skipDuration) + getTimeElapsed() / 1000);
                 }
 
                 getSongInfo(currentSong);