From fd1c657964af2396d568792ae6d23afa9a2ad4c3 Mon Sep 17 00:00:00 2001 From: Chris Boustead Date: Wed, 15 Nov 2017 17:10:50 -0500 Subject: [PATCH] Progress bar removal bug --- package.json | 2 +- src/plugin.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 97d21b2..d293b84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "videojs-vtt-thumbnails", - "version": "0.0.5", + "version": "0.0.7", "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 a7dbddb..910be12 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -85,9 +85,9 @@ class vttThumbnailsPlugin { resetPlugin() { this.thumbnailHolder && this.thumbnailHolder.parentNode.removeChild(this.thumbnailHolder); - this.progressBar.removeEventListener('mouseenter', this.registeredEvents.progressBarMouseEnter); - this.progressBar.removeEventListener('mouseleave', this.registeredEvents.progressBarMouseLeave); - this.progressBar.removeEventListener('mousemove', this.registeredEvents.progressBarMouseMove); + this.progressBar && this.progressBar.removeEventListener('mouseenter', this.registeredEvents.progressBarMouseEnter); + this.progressBar && this.progressBar.removeEventListener('mouseleave', this.registeredEvents.progressBarMouseLeave); + this.progressBar && this.progressBar.removeEventListener('mousemove', this.registeredEvents.progressBarMouseMove); delete this.registeredEvents.progressBarMouseEnter; delete this.registeredEvents.progressBarMouseLeave; delete this.registeredEvents.progressBarMouseMove;