Skip to content

Commit 71641aa

Browse files
fix: Resolves captions sizing issue when minified (v7) (#9012)
Co-authored-by: mister-ben <[email protected]>
1 parent 1a8ab55 commit 71641aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/tracks/text-track.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ class TextTrack extends Track {
395395
addCue(originalCue) {
396396
let cue = originalCue;
397397

398-
if (cue.constructor && cue.constructor.name !== 'VTTCue') {
398+
// Testing if the cue is a VTTCue in a way that survives minification
399+
if (!('getCueAsHTML' in cue)) {
399400
cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
400401

401402
for (const prop in originalCue) {

0 commit comments

Comments
 (0)