diff options
author | Sam Potts <sam@potts.es> | 2019-01-26 16:31:47 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-01-26 16:31:47 +1100 |
commit | c44351507f0a06578a1fee10185117e7df64ece9 (patch) | |
tree | 9b7afe1e0378ce80e3efaadfe5fc7041926d68db /src/js/plugins/previewThumbnails.js | |
parent | c577eb01cea0cb2c742a8cbd10909f63b869cd4e (diff) | |
download | plyr-c44351507f0a06578a1fee10185117e7df64ece9.tar.lz plyr-c44351507f0a06578a1fee10185117e7df64ece9.tar.xz plyr-c44351507f0a06578a1fee10185117e7df64ece9.zip |
Plugin tweaks for ads and previews
Diffstat (limited to 'src/js/plugins/previewThumbnails.js')
-rw-r--r-- | src/js/plugins/previewThumbnails.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/js/plugins/previewThumbnails.js b/src/js/plugins/previewThumbnails.js index 053875c7..57b9265f 100644 --- a/src/js/plugins/previewThumbnails.js +++ b/src/js/plugins/previewThumbnails.js @@ -301,11 +301,20 @@ class PreviewThumbnails { } // Find the desired thumbnail index + // TODO: Handle a video longer than the thumbs where thumbNum is null const thumbNum = this.thumbnails[0].frames.findIndex( frame => this.seekTime >= frame.startTime && this.seekTime <= frame.endTime, ); + const hasThumb = thumbNum >= 0; let qualityIndex = 0; + this.toggleThumbContainer(hasThumb); + + // No matching thumb found + if (!hasThumb) { + return; + } + // Check to see if we've already downloaded higher quality versions of this image this.thumbnails.forEach((thumbnail, index) => { if (this.loadedImages.includes(thumbnail.frames[thumbNum].text)) { |