فهرست منبع

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

KrisVos130 10 سال پیش
والد
کامیت
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);