Skip to content

Commit

Permalink
fix: Resolves captions sizing issue when minified (#8442)
Browse files Browse the repository at this point in the history
* fix: Resolves captions sizing issue when minified

* Change test for minification
  • Loading branch information
mister-ben authored Sep 27, 2023
1 parent 4f9e108 commit 9267c46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/tracks/text-track.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9267c46

Please sign in to comment.