aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/previewThumbnails.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2019-04-13 12:56:15 +1000
committerSam Potts <sam@potts.es>2019-04-13 12:56:15 +1000
commit243db9eda32d0ceb705b0cb99426995db071b113 (patch)
tree609f28e04608c3815d9ade413f10e5194c2645b2 /src/js/plugins/previewThumbnails.js
parentb675ba1f350207071526453d0e03153225dc4c63 (diff)
downloadplyr-243db9eda32d0ceb705b0cb99426995db071b113.tar.lz
plyr-243db9eda32d0ceb705b0cb99426995db071b113.tar.xz
plyr-243db9eda32d0ceb705b0cb99426995db071b113.zip
Fix issue with empty controls and preview thumbs
Diffstat (limited to 'src/js/plugins/previewThumbnails.js')
-rw-r--r--src/js/plugins/previewThumbnails.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/js/plugins/previewThumbnails.js b/src/js/plugins/previewThumbnails.js
index 813bc47e..3e4b17a3 100644
--- a/src/js/plugins/previewThumbnails.js
+++ b/src/js/plugins/previewThumbnails.js
@@ -149,9 +149,11 @@ class PreviewThumbnails {
// If the URLs don't start with '/', then we need to set their relative path to be the location of the VTT file
// If the URLs do start with '/', then they obviously don't need a prefix, so it will remain blank
// If the thumbnail URLs start with with none of '/', 'http://' or 'https://', then we need to set their relative path to be the location of the VTT file
- if (!thumbnail.frames[0].text.startsWith('/') &&
+ if (
+ !thumbnail.frames[0].text.startsWith('/') &&
!thumbnail.frames[0].text.startsWith('http://') &&
- !thumbnail.frames[0].text.startsWith('https://')) {
+ !thumbnail.frames[0].text.startsWith('https://')
+ ) {
thumbnail.urlPrefix = url.substring(0, url.lastIndexOf('/') + 1);
}
@@ -297,7 +299,9 @@ class PreviewThumbnails {
this.elements.thumb.container.appendChild(timeContainer);
// Inject the whole thumb
- this.player.elements.progress.appendChild(this.elements.thumb.container);
+ if (is.element(this.player.elements.progress)) {
+ this.player.elements.progress.appendChild(this.elements.thumb.container);
+ }
// Create HTML element: plyr__preview-scrubbing-container
this.elements.scrubbing.container = createElement('div', {