Skip to content

Commit

Permalink
Merge branch 'fix/extend-hls-interstitial-tag-insertion' of https://g…
Browse files Browse the repository at this point in the history
…ithub.com/Eyevinn/hls-splice into fix/extend-hls-interstitial-tag-insertion
  • Loading branch information
Nfrederiksen committed Nov 27, 2024
2 parents 4a08df0 + d2b11a6 commit 6a1f709
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
26 changes: 5 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ class HLSSpliceVod {
}

_insertInterstitialAtExtraMedia(offset, id, uri, isAssetList, extraAttrs, startDate, playlists, opts) {

let HAS_CUE_ATTR = false;
if (opts && opts.cue) {
const cueValue = _parseValidCueValues(opts.cue);
Expand All @@ -489,6 +490,7 @@ class HLSSpliceVod {
HAS_CUE_ATTR = true;
}
}

const groups = Object.keys(playlists);
for (let i = 0; i < groups.length; i++) {
const group = groups[i];
Expand Down Expand Up @@ -655,27 +657,9 @@ class HLSSpliceVod {
}
}

this._insertInterstitialAtExtraMedia(
offset,
id,
uri,
isAssetList,
extraAttrs,
startDate,
this.playlistsAudio,
opts
);

this._insertInterstitialAtExtraMedia(
offset,
id,
uri,
isAssetList,
extraAttrs,
startDate,
this.playlistsSubtitle,
opts
);
this._insertInterstitialAtExtraMedia(offset, id, uri, isAssetList, extraAttrs, startDate, this.playlistsAudio, opts);

this._insertInterstitialAtExtraMedia(offset, id, uri, isAssetList, extraAttrs, startDate, this.playlistsSubtitle, opts);

resolve();
});
Expand Down
1 change: 0 additions & 1 deletion spec/hls_splice_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,6 @@ describe("HLSSpliceVod with Demuxed Audio Tracks,", () => {
.then(() => {
const m3u8 = mockVod.getMediaManifest(4497000);
let lines = m3u8.split("\n");

expect(lines[12]).toEqual(
'#EXT-X-DATERANGE:ID="001",CLASS="com.apple.hls.interstitial",START-DATE="1970-01-01T00:00:18.001Z",X-ASSET-URI="http://mock.com/asseturi",X-SNAP="OUT"'
);
Expand Down

0 comments on commit 6a1f709

Please sign in to comment.