From dceedb674620ab63dfcce8f88966e3bb871533d4 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 22 Jan 2021 13:06:58 -0500 Subject: [PATCH] fix(fs): make sure handlers are unique per player (#7035) Using Video.js's .bind still makes us attach prototype methods as handlers. Then when one is removed, all handlers are removed. Instead, use arrow methods to make these methods unique. Fixes #7013. --- src/js/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index c4d1567dc6..f9da711032 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -351,8 +351,8 @@ class Player extends Component { super(null, options, ready); // Create bound methods for document listeners. - this.boundDocumentFullscreenChange_ = Fn.bind(this, this.documentFullscreenChange_); - this.boundFullWindowOnEscKey_ = Fn.bind(this, this.fullWindowOnEscKey); + this.boundDocumentFullscreenChange_ = (e) => this.documentFullscreenChange_(e); + this.boundFullWindowOnEscKey_ = (e) => this.fullWindowOnEscKey(e); // default isFullscreen_ to false this.isFullscreen_ = false;