From ba67920025f29d9a8d7d65016c122d8b359cbe34 Mon Sep 17 00:00:00 2001 From: Jinhyeok Lee Date: Mon, 18 Apr 2022 10:43:44 +0900 Subject: [PATCH] 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. --- src/js/plyr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/plyr.js b/src/js/plyr.js index cad45d66..600eeba3 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -958,7 +958,7 @@ class Plyr { */ set currentTrack(input) { captions.set.call(this, input, false); - captions.setup(); + captions.setup.call(this); } /**