Skip to content

Commit

Permalink
fix(fs): make sure handlers are unique per player (#7035)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gkatsev authored Jan 22, 2021
1 parent db46578 commit dceedb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dceedb6

Please sign in to comment.