Skip to content

Commit 8b8357c

Browse files
committed
HFP-2914 Fix index 0 candidate for next interaction always overridden
Fix showing multiple interactions at the same time
1 parent 82ab7bb commit 8b8357c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scripts/interactive-video.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,7 +3426,7 @@ InteractiveVideo.prototype.findNextInteractionToHide = function (time) {
34263426
let candidate;
34273427
for (var i = 0; i < this.visibleInteractions.length; i++) {
34283428
const duration = this.interactions[this.visibleInteractions[i]].getDuration();
3429-
if (!candidate || duration.to < this.interactions[this.visibleInteractions[candidate]].getDuration().to) {
3429+
if (candidate === undefined || duration.to < this.interactions[this.visibleInteractions[candidate]].getDuration().to) {
34303430
candidate = i;
34313431
}
34323432
}
@@ -3484,7 +3484,7 @@ InteractiveVideo.prototype.showInteractions = function (time) {
34843484

34853485
// Are there more interactions for us to show?
34863486
this.nextInteractionToShow = this.findNextInteractionToShow(time, this.nextInteractionToShow);
3487-
interaction = this.nextInteractionToShow !== undefined ? this.interactions[this.nextInteractionToHide] : null;
3487+
interaction = this.nextInteractionToShow !== undefined ? this.interactions[this.nextInteractionToShow] : null;
34883488
}
34893489

34903490
this.accessibility.announceInteractions(newInteractions);

0 commit comments

Comments
 (0)