1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-15 01:34:23 +02:00

fix: Check for VTTCue (#8370)

This commit is contained in:
Walter Seymour
2023-07-20 11:38:15 -05:00
committed by GitHub
parent 452a918a42
commit da15810355
4 changed files with 28 additions and 5 deletions

View File

@ -391,7 +391,7 @@ class TextTrack extends Track {
addCue(originalCue) {
let cue = originalCue;
if (window.vttjs && !(originalCue instanceof window.vttjs.VTTCue)) {
if (cue.constructor && cue.constructor.name !== 'VTTCue') {
cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
for (const prop in originalCue) {