Browse Source

Merge branch 'master' into seek-time-error

DIYgod 6 years ago
parent
commit
0a4e648655
6 changed files with 18 additions and 2 deletions
  1. 4 0
      README.md
  2. 4 0
      docs/README.md
  3. 4 0
      docs/support.md
  4. 1 1
      src/js/controller.js
  5. 3 0
      src/js/player.js
  6. 2 1
      src/js/thumbnails.js

+ 4 - 0
README.md

@@ -52,6 +52,10 @@ Using DPlayer on your project? [Let me know!](https://github.com/DIYgod/DPlayer/
     <img width="600px" src="https://i.imgur.com/d4XabAe.png">
 </a>
 
+<a href="https://www.9ccms.net" target="_blank">
+    <img width="330px" src="https://i.imgur.com/YBV6kfb.png">
+</a>
+
 ### Sponsors
 
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">

+ 4 - 0
docs/README.md

@@ -12,6 +12,10 @@ search: english
     <img width="600px" src="https://i.imgur.com/d4XabAe.png">
 </a>
 
+<a href="https://www.9ccms.net" target="_blank">
+    <img width="330px" src="https://i.imgur.com/YBV6kfb.png">
+</a>
+
 ## Sponsors
 
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">

+ 4 - 0
docs/support.md

@@ -36,6 +36,10 @@ Recurring pledges come with exclusive perks, e.g. having your name or your compa
     <img width="600px" src="https://i.imgur.com/d4XabAe.png">
 </a>
 
+<a href="https://www.9ccms.net" target="_blank">
+    <img width="330px" src="https://i.imgur.com/YBV6kfb.png">
+</a>
+
 ### Sponsors
 
 <a href="https://www.dogecloud.com/?ref=dplayer" target="_blank">

+ 1 - 1
src/js/controller.js

@@ -91,7 +91,7 @@ class Controller {
             });
 
             this.player.on('loadedmetadata', () => {
-                this.thumbnails.resize(160, this.player.video.videoHeight / this.player.video.videoWidth * 160);
+                this.thumbnails.resize(160, this.player.video.videoHeight / this.player.video.videoWidth * 160, this.player.template.barWrap.offsetWidth);
             });
         }
     }

+ 3 - 0
src/js/player.js

@@ -564,6 +564,9 @@ class DPlayer {
         if (this.danmaku) {
             this.danmaku.resize();
         }
+        if (this.controller.thumbnails) {
+            this.controller.thumbnails.resize(160, this.video.videoHeight / this.video.videoWidth * 160, this.template.barWrap.offsetWidth);
+        }
         this.events.trigger('resize');
     }
 

+ 2 - 1
src/js/thumbnails.js

@@ -6,10 +6,11 @@ class Thumbnails {
         this.events = options.events;
     }
 
-    resize (width, height) {
+    resize (width, height, barWrapWidth) {
         this.container.style.width = `${width}px`;
         this.container.style.height = `${height}px`;
         this.container.style.top = `${-height + 2}px`;
+        this.barWidth = barWrapWidth;
     }
 
     show () {