Skip to content

Commit

Permalink
repeat topic after ad again
Browse files Browse the repository at this point in the history
  • Loading branch information
woolfg committed Sep 25, 2023
1 parent 06921da commit 9f9bcae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chapters/timestamps.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function injectAd(adStartTime, adEndTime, adText, timestamps) {
timestamps = timestamps.map(x => [x[0] + (x[0] > adStartTime ? adEndTime - adStartTime : 0), x[1]])
// insert the ad and push all other timestamps back
timestamps.splice(adStartIndex, 0, [adStartTime, " " + adText])
// copy the topic before the ad to the end to specify the ongoing topic again
timestamps.splice(adStartIndex + 1, 0, [adEndTime, timestamps[adStartIndex - 1][1]])
}
return timestamps
}
Expand Down

0 comments on commit 9f9bcae

Please sign in to comment.