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,12 +159,15 @@ class Ads {
|
|||||||
this.adsCuePoints.forEach((cuePoint) => {
|
this.adsCuePoints.forEach((cuePoint) => {
|
||||||
if (cuePoint !== 0 && cuePoint !== -1) {
|
if (cuePoint !== 0 && cuePoint !== -1) {
|
||||||
const seekElement = this.player.elements.progress;
|
const seekElement = this.player.elements.progress;
|
||||||
|
if(seekElement) {
|
||||||
|
const cuePercentage = 100 / this.player.duration * cuePoint;
|
||||||
const cue = utils.createElement('span', {
|
const cue = utils.createElement('span', {
|
||||||
class: this.player.config.classNames.cues,
|
class: this.player.config.classNames.cues,
|
||||||
});
|
});
|
||||||
cue.style.left = cuePoint.toString() + 'px';
|
cue.style.left = `${cuePercentage.toString()}%`;
|
||||||
seekElement.appendChild(cue);
|
seekElement.appendChild(cue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add listeners to the required events.
|
// Add listeners to the required events.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user