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

Merge branch 'master' of https://github.com/Musare/Musare

AkiraLaine 9 жил өмнө
parent
commit
31ffea3073

+ 1 - 1
app/client/app.css

@@ -1115,7 +1115,7 @@ nav form input[type="image"]{
 .about a{
     color: white;
 }
-#play, #pause, #skip, #shuffle {
+#play, #pause, #skip, #shuffle, #sync {
     cursor: pointer;
 }
 .delete-room {

+ 16 - 0
app/client/client.js

@@ -221,6 +221,22 @@ Template.dashboard.onCreated(function() {
 });
 
 Template.room.events({
+    "click #sync": function() {
+        if (Session.get("currentSong") !== undefined) {
+            var room = Rooms.findOne({type: Session.get("type")});
+            if (room !== undefined) {
+                var timeIn = Date.now() - Session.get("currentSong").started - room.timePaused;
+                console.log(timeIn);
+                var skipDuration = Number(Session.get("currentSong").skipDuration) | 0;
+                if (yt_player !== undefined) {
+                    yt_player.seekTo(skipDuration + timeIn / 1000);
+                }
+                else if (_sound !== undefined) {
+                    _sound.seekTo(skipDuration * 1000 + timeIn);
+                }
+            }
+        }
+    },
     "click #side-panel": function(e) { 
         Meteor.setTimeout(function() {
         var elem = document.getElementById('chat');

+ 1 - 0
app/client/templates/room.html

@@ -7,6 +7,7 @@
                     <nav>
                         <div id="room-icons">
                             <a class="back" href="/"><i class="fa fa-chevron-left"></i></a>
+                            <i class="fa fa-refresh fa-1" id="sync"></i>
                             {{#if isAdmin}}
                                 {{#if paused}}
                                     <i class="fa fa-play fa-1" id="play"></i>