Skip to content

Commit

Permalink
Merge branch 'master' into fix/extend-hls-interstitial-tag-insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen authored Nov 27, 2024
2 parents 0c61c2b + 41ed4ac commit e3161bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 25 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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eyevinn/hls-splice",
"version": "0.5.0",
"version": "0.5.1",
"description": "NPM library to splice HLS VOD",
"repository": "https://github.com/Eyevinn/hls-splice",
"main": "index.js",
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 @@ -1568,7 +1568,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 e3161bd

Please sign in to comment.