Skip to content

Commit

Permalink
Dispose captureDocumentHotkeys
Browse files Browse the repository at this point in the history
Fixes #77
  • Loading branch information
ctd1500 committed Aug 28, 2022
1 parent 6baf206 commit e500b0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion videojs.hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,12 @@
}

if (captureDocumentHotkeys) {
document.addEventListener('keydown', function (event) { keyDown(event) });
var capDocHK = function (event) { keyDown(event) };
document.addEventListener('keydown', capDocHK);

this.dispose = function () {
document.removeEventListener('keydown', capDocHK);
}
} else {
player.on('keydown', keyDown);
}
Expand Down

0 comments on commit e500b0d

Please sign in to comment.