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

Added "skip to last 10 seconds of video" on preview player.

KrisVos130 9 жил өмнө
parent
commit
473b472a2d

+ 22 - 0
app/client/client.js

@@ -949,6 +949,28 @@ Template.stations.events({
             _sound.stop();
         }
     },
+    "click #forward": function() {
+        if (yt_player !== undefined) {
+            yt_player.seekTo(Session.get("song").duration - 10);
+        }
+        if (_sound !== undefined) {
+            _sound.seekTo((Session.get("song").duration - 10) * 1000);
+        }
+        if (previewEndSongTimeout !== undefined) {
+            Meteor.clearTimeout(previewEndSongTimeout);
+        }
+        Meteor.setTimeout(function() {
+            if (yt_player !== undefined) {
+                yt_player.stopVideo();
+            }
+            if (_sound !== undefined) {
+                _sound.stop();
+            }
+            $("#play").attr("disabled", false);
+            $("#stop").attr("disabled", true);
+            $("#previewPlayer").hide();
+        }, 10000);
+    },
     "click #croom_create": function() {
         Meteor.call("createRoom", $("#croom_display").val(), $("#croom_tag").val(), function (err, res) {
             if (err) {

+ 3 - 2
app/client/templates/stations.html

@@ -140,8 +140,9 @@
                   </div>
                   <div class="modal-body">
                       <div width="960" height="540" id="previewPlayer"></div>
-                      <button id="play" class="btn btn-success"><i class="fa fa-play"></i></button>
-                      <button id="stop" class="btn btn-danger" disabled><i class="fa fa-stop"></i></button>
+                      <button id="play" title="Play video" class="btn btn-success"><i class="fa fa-play"></i></button>
+                      <button id="stop" title="Stop video" class="btn btn-danger" disabled><i class="fa fa-stop"></i></button>
+                      <button id="forward" title="Go to the last 10 seconds of the video" class="btn btn-primary"><i class="fa fa-fast-forward"></i></button>
                       <div id="volume-container-admin">
                           <input type="text" id="volume-slider" class="span2" value="" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="50" data-slider-orientation="horizontal" data-slider-selection="after" data-slider-tooltip="hide">
                       </div>