Skip to content

Commit dbd5b52

Browse files
committed
HFP-2661 Remove submit screen if it is after a new video length
1 parent 49ac0b0 commit dbd5b52

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/scripts/interactive-video.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,16 @@ InteractiveVideo.prototype.addControls = function () {
913913
// Add bookmarks
914914
this.addBookmarks();
915915

916+
// If we change to a shorter video we need to remove the endscreens that are after the new length
917+
if (this.options.assets.endscreens && this.options.assets.endscreens.length >0) {
918+
for (let i = 0; i<this.options.assets.endscreens.length; i++) {
919+
const endscreen = this.options.assets.endscreens[i];
920+
if(endscreen.time > this.getDuration()) {
921+
this.options.assets.endscreens.splice(i,1);
922+
}
923+
}
924+
}
925+
916926
// Add endscreens
917927
this.addEndscreenMarkers();
918928

0 commit comments

Comments
 (0)