Fixed issue where the preview thumbnail was present while scrubbing

This commit is contained in:
Sam Potts
2019-02-24 12:10:20 +11:00
parent 215fc3677a
commit 4c3bf25b8a
24 changed files with 92 additions and 76 deletions

View File

@ -60,7 +60,7 @@ const defaults = {
// Sprite (for icons)
loadSprite: true,
iconPrefix: 'plyr',
iconUrl: 'https://cdn.plyr.io/3.5.1/plyr.svg',
iconUrl: 'https://cdn.plyr.io/3.5.2/plyr.svg',
// Blank video (used to prevent errors on source change)
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',

View File

@ -220,6 +220,7 @@ class PreviewThumbnails {
// Only act on left mouse button (0), or touch device (event.button is false)
if (event.button === false || event.button === 0) {
this.mouseDown = true;
// Wait until media has a duration
if (this.player.media.duration) {
this.toggleScrubbingContainer(true);
@ -307,7 +308,6 @@ class PreviewThumbnails {
if (this.mouseDown) {
this.setScrubbingContainerSize();
} else {
this.toggleThumbContainer(true);
this.setThumbContainerSizeAndPos();
}
@ -319,7 +319,10 @@ class PreviewThumbnails {
const hasThumb = thumbNum >= 0;
let qualityIndex = 0;
this.toggleThumbContainer(hasThumb);
// Show the thumb container if we're not scrubbing
if (!this.mouseDown) {
this.toggleThumbContainer(hasThumb);
}
// No matching thumb found
if (!hasThumb) {

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v3.5.1
// plyr.js v3.5.2
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr Polyfilled Build
// plyr.js v3.5.1
// plyr.js v3.5.2
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================