1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00

fix: Resolves captions sizing issue when minified (#8442)

* fix: Resolves captions sizing issue when minified

* Change test for minification
This commit is contained in:
mister-ben 2023-09-27 09:54:29 +02:00 committed by GitHub
parent 4f9e108fe6
commit 9267c46576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -391,7 +391,8 @@ class TextTrack extends Track {
addCue(originalCue) { addCue(originalCue) {
let cue = 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); cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
for (const prop in originalCue) { for (const prop in originalCue) {