mirror of
https://gitea.invidious.io/iv-org/videojs-vtt-thumbnails.git
synced 2024-08-15 00:43:16 +00:00
Add detach api method to remove plugin from player
This commit is contained in:
parent
4c4f0179c3
commit
53fdf0a0fd
2 changed files with 14 additions and 6 deletions
|
@ -73,15 +73,23 @@ class vttThumbnailsPlugin {
|
|||
}
|
||||
|
||||
src(source){
|
||||
delete this.vttData;
|
||||
delete this.thumbnailHolder;
|
||||
delete this.lastStyle;
|
||||
this.resetPlugin();
|
||||
this.options.src = source;
|
||||
this.initializeThumbnails();
|
||||
}
|
||||
|
||||
detach() {
|
||||
this.resetPlugin();
|
||||
}
|
||||
|
||||
resetPlugin() {
|
||||
this.progressBar.removeEventListener('mouseenter',() => { return this.onBarMouseenter() });
|
||||
this.progressBar.removeEventListener('mouseleave',() => { return this.onBarMouseleave() });
|
||||
this.progressBar.removeEventListener('mousemove',this.onBarMousemove);
|
||||
delete this.progressBar;
|
||||
this.options.src = source;
|
||||
this.initializeThumbnails();
|
||||
delete this.vttData;
|
||||
delete this.thumbnailHolder;
|
||||
delete this.lastStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue