Fix player progress bar when changing resolution
authorChocobozzz <me@florianbigard.com>
Fri, 16 Nov 2018 08:16:41 +0000 (09:16 +0100)
committerChocobozzz <me@florianbigard.com>
Fri, 16 Nov 2018 08:16:41 +0000 (09:16 +0100)
client/src/assets/player/images/tick-white.svg [new file with mode: 0644]
client/src/assets/player/images/tick.svg [deleted file]
client/src/assets/player/peertube-videojs-plugin.ts
client/src/sass/player/settings-menu.scss

diff --git a/client/src/assets/player/images/tick-white.svg b/client/src/assets/player/images/tick-white.svg
new file mode 100644 (file)
index 0000000..d329e6b
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <defs></defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
+        <g id="Artboard-4" transform="translate(-356.000000, -115.000000)" stroke="#fff" stroke-width="2">
+            <g id="8" transform="translate(356.000000, 115.000000)">
+                <path d="M21,6 L9,18" id="Path-14"></path>
+                <path d="M9,13 L4,18" id="Path-14" transform="translate(6.500000, 15.500000) scale(-1, 1) translate(-6.500000, -15.500000) "></path>
+            </g>
+        </g>
+    </g>
+</svg>
diff --git a/client/src/assets/player/images/tick.svg b/client/src/assets/player/images/tick.svg
deleted file mode 100644 (file)
index d329e6b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-    <defs></defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
-        <g id="Artboard-4" transform="translate(-356.000000, -115.000000)" stroke="#fff" stroke-width="2">
-            <g id="8" transform="translate(356.000000, 115.000000)">
-                <path d="M21,6 L9,18" id="Path-14"></path>
-                <path d="M9,13 L4,18" id="Path-14" transform="translate(6.500000, 15.500000) scale(-1, 1) translate(-6.500000, -15.500000) "></path>
-            </g>
-        </g>
-    </g>
-</svg>
index 40da5f1f7c3c1c4fa1785b977a6d9ab3a3e03076..4fd5a9be22d5fa04a4e98e814849cb7e0468029c 100644 (file)
@@ -111,6 +111,8 @@ class PeerTubePlugin extends Plugin {
       const muted = getStoredMute()
       if (muted !== undefined) this.player.muted(muted)
 
+      this.player.duration(options.videoDuration)
+
       this.initializePlayer()
       this.runTorrentInfoScheduler()
       this.runViewAdd()
@@ -302,6 +304,9 @@ class PeerTubePlugin extends Plugin {
 
         this.flushVideoFile(previousVideoFile)
 
+        // Update progress bar (just for the UI), do not wait rendering
+        if (options.seek) this.player.currentTime(options.seek)
+
         const renderVideoOptions = { autoplay: false, controls: true }
         renderVideo(torrent.files[ 0 ], this.playerElement, renderVideoOptions, (err, renderer) => {
           this.renderer = renderer
index d065e72fb1178f0225e770cda6b517bbbec98b88..61965c85ee71c0e98f750cf09549ea6493499bf8 100644 (file)
@@ -171,7 +171,7 @@ $setting-transition-easing: ease-out;
               left: 8px;
               content: ' ';
               margin-top: 1px;
-              background-image: url('#{$assets-path}/player/images/tick.svg');
+              background-image: url('#{$assets-path}/player/images/tick-white.svg');
             }
           }
         }
@@ -197,4 +197,4 @@ $setting-transition-easing: ease-out;
       }
     }
   }
-}
\ No newline at end of file
+}