add previewThumbnails source setter #1369
This commit is contained in:
parent
8b9521d5a5
commit
61a24eab76
@ -328,6 +328,15 @@ class PreviewThumbnails {
|
|||||||
this.player.elements.wrapper.appendChild(this.elements.scrubbing.container);
|
this.player.elements.wrapper.appendChild(this.elements.scrubbing.container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
destroy() {
|
||||||
|
if (this.elements.thumb.container) {
|
||||||
|
this.elements.thumb.container.remove();
|
||||||
|
}
|
||||||
|
if (this.elements.scrubbing.container) {
|
||||||
|
this.elements.scrubbing.container.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
showImageAtCurrentTime() {
|
showImageAtCurrentTime() {
|
||||||
if (this.mouseDown) {
|
if (this.mouseDown) {
|
||||||
this.setScrubbingContainerSize();
|
this.setScrubbingContainerSize();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import { providers } from './config/types';
|
import { providers } from './config/types';
|
||||||
import html5 from './html5';
|
import html5 from './html5';
|
||||||
import media from './media';
|
import media from './media';
|
||||||
|
import PreviewThumbnails from './plugins/preview-thumbnails';
|
||||||
import support from './support';
|
import support from './support';
|
||||||
import ui from './ui';
|
import ui from './ui';
|
||||||
import { createElement, insertElement, removeElement } from './utils/elements';
|
import { createElement, insertElement, removeElement } from './utils/elements';
|
||||||
@ -130,9 +131,20 @@ const source = {
|
|||||||
this.media.load();
|
this.media.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload thumbnails
|
// Update previewThumbnails config & reload plugin
|
||||||
if (this.previewThumbnails) {
|
if (!is.empty(input.previewThumbnails)) {
|
||||||
this.previewThumbnails.load();
|
Object.assign(this.config.previewThumbnails, input.previewThumbnails);
|
||||||
|
|
||||||
|
// cleanup previewThumbnails plugin if it was loaded
|
||||||
|
if (this.previewThumbnails && this.previewThumbnails.loaded) {
|
||||||
|
this.previewThumbnails.destroy();
|
||||||
|
this.previewThumbnails = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create new instance if it is still enabled
|
||||||
|
if (this.config.previewThumbnails.enabled) {
|
||||||
|
this.previewThumbnails = new PreviewThumbnails(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the fullscreen support
|
// Update the fullscreen support
|
||||||
|
Loading…
x
Reference in New Issue
Block a user