From 9267c46576c802cf6f933a800856da60795bb8de Mon Sep 17 00:00:00 2001 From: mister-ben Date: Wed, 27 Sep 2023 09:54:29 +0200 Subject: [PATCH] fix: Resolves captions sizing issue when minified (#8442) * fix: Resolves captions sizing issue when minified * Change test for minification --- src/js/tracks/text-track.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/tracks/text-track.js b/src/js/tracks/text-track.js index 05ddd4db5..5c94a709d 100644 --- a/src/js/tracks/text-track.js +++ b/src/js/tracks/text-track.js @@ -391,7 +391,8 @@ class TextTrack extends Track { addCue(originalCue) { let cue = originalCue; - if (cue.constructor && cue.constructor.name !== 'VTTCue') { + // Testing if the cue is a VTTCue in a way that survives minification + if (!('getCueAsHTML' in cue)) { cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text); for (const prop in originalCue) {