Skip to content

Commit

Permalink
fix: hls-interstitial start-date not placed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Dec 18, 2024
1 parent 341fe8f commit c95b499
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2824,9 +2824,10 @@ class HLSVod {

if (playlistItemWithInterstitialsMetadata(playlistItem)) {
const newDateRange = playlistItem.attributes.attributes["daterange"];
const newStartDate = new Date(newDateRange["START-DATE"]);
const tempTimeOffset = new Date(this.timeOffset);
const newStartDateString = new Date(newStartDate.getTime() + tempTimeOffset.getTime()).toISOString();
const vodsInputTimestamp = new Date(this.timeOffset);
const extraDurationSec = i == 0 && q.duration ? 0 : q.duration;
const startTimeOffsetMs = (position + extraDurationSec) * 1000;
const newStartDateString = new Date(vodsInputTimestamp.getTime() + startTimeOffsetMs).toISOString();
newDateRange["START-DATE"] = newStartDateString;
q["daterange"] = newDateRange;
}
Expand Down

0 comments on commit c95b499

Please sign in to comment.