Fix 'this' while switching subtitle tracks (#2441)

When you switch a subtitle track you'll get

`TypeError: Cannot read properties of undefined (reading 'ui')` in `captions.js`'s `captions.setup`,

Because `captions.setup` is being called without proper `this` binding.
This commit is contained in:
Jinhyeok Lee 2022-04-18 10:43:44 +09:00 committed by GitHub
parent b7953ff0fc
commit ba67920025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -958,7 +958,7 @@ class Plyr {
*/ */
set currentTrack(input) { set currentTrack(input) {
captions.set.call(this, input, false); captions.set.call(this, input, false);
captions.setup(); captions.setup.call(this);
} }
/** /**