1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-10 11:10:19 +02:00

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.
This commit is contained in:
Gary Katsevman 2021-01-22 13:06:58 -05:00 committed by GitHub
parent db46578ac6
commit dceedb6746
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;