diff --git a/package.json b/package.json index 7df5012..df08f61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "videojs-vtt-thumbnails", - "version": "0.0.10", + "version": "0.0.11", "description": "Display thumnails on progress bar hover, driven by external VTT files.", "main": "dist/videojs-vtt-thumbnails.cjs.js", "module": "dist/videojs-vtt-thumbnails.es.js", diff --git a/src/plugin.js b/src/plugin.js index 4fa8a30..64a9cd4 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -167,7 +167,9 @@ class vttThumbnailsPlugin { thumbHolder.setAttribute('class', 'vjs-vtt-thumbnail-display') this.progressBar.appendChild(thumbHolder) this.thumbnailHolder = thumbHolder - mouseDisplay.classList.add('vjs-hidden') + if(mouseDisplay) { + mouseDisplay.classList.add('vjs-hidden') + } this.registeredEvents.progressBarMouseEnter = () => { return this.onBarMouseenter() }; this.registeredEvents.progressBarMouseLeave = () => { return this.onBarMouseleave() }; this.progressBar.addEventListener('mouseenter', this.registeredEvents.progressBarMouseEnter)