Fixed string literal and position issue of the midroll cue inside the time line. Added a check for the progress element existence.
This commit is contained in:
parent
0cb2f95888
commit
31c8166562
@ -159,11 +159,14 @@ class Ads {
|
||||
this.adsCuePoints.forEach((cuePoint) => {
|
||||
if (cuePoint !== 0 && cuePoint !== -1) {
|
||||
const seekElement = this.player.elements.progress;
|
||||
const cue = utils.createElement('span', {
|
||||
class: this.player.config.classNames.cues,
|
||||
});
|
||||
cue.style.left = cuePoint.toString() + 'px';
|
||||
seekElement.appendChild(cue);
|
||||
if(seekElement) {
|
||||
const cuePercentage = 100 / this.player.duration * cuePoint;
|
||||
const cue = utils.createElement('span', {
|
||||
class: this.player.config.classNames.cues,
|
||||
});
|
||||
cue.style.left = `${cuePercentage.toString()}%`;
|
||||
seekElement.appendChild(cue);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user