1
0
mirror of https://github.com/videojs/video.js.git synced 2025-03-17 21:18:27 +02:00

fix(cues): only copy cue props that don't exist (#4145)

This commit is contained in:
Gary Katsevman 2017-03-02 11:16:12 -05:00 committed by GitHub
parent dacf0ca133
commit 0f57341e38
2 changed files with 14 additions and 2 deletions

View File

@ -343,7 +343,9 @@ class TextTrack extends Track {
cue = new window.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
for (const prop in originalCue) {
cue[prop] = originalCue[prop];
if (!(prop in cue)) {
cue[prop] = originalCue[prop];
}
}
}

View File

@ -19,7 +19,17 @@ const defaultTech = {
currentTime() {}
};
QUnit.module('Text Track');
QUnit.module('Text Track', {
beforeEach() {
this.oldVttjs = window.vttjs;
window.vttjs = {
VTTCue: Object
};
},
afterEach() {
window.vttjs = this.oldVttjs;
}
});
// do baseline track testing
TrackBaseline(TextTrack, {