Skip to content

Commit

Permalink
test: one more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Nov 27, 2024
1 parent 45fc6a3 commit ab23aeb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions spec/hls_splice_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2069,4 +2069,29 @@ test-audio=256000-6.m4s`;
done();
});
});

it("can insert interstitial with an asset uri and a resume offset and CUE attribute", (done) => {
const mockVod = new HLSSpliceVod("http://mock.com/mock.m3u8");
mockVod
.load(mockCmafMasterManifest, mockCmafMediaManifest, mockCmafAudioManifest)
.then(() => {
return mockVod.insertInterstitialAt(18000, "001", "http://mock.com/asseturi", false, {
resumeOffset: 10500,
cue: "POST,ONCE"
});
})
.then(() => {
const m3u8 = mockVod.getMediaManifest(4497000);
let lines = m3u8.split("\n");
expect(lines[129]).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",CUE="POST,ONCE",X-RESUME-OFFSET=10.5'
);
const m3u8Audio = mockVod.getAudioManifest("stereo", "sv");
lines = m3u8Audio.split("\n");
expect(lines[195]).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",CUE="POST,ONCE",X-RESUME-OFFSET=10.5'
);
done();
});
});
});

0 comments on commit ab23aeb

Please sign in to comment.