Skip to content

Commit

Permalink
test: fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Feb 17, 2023
1 parent 79c7c60 commit 8a38179
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions index.js
Expand Up @@ -172,12 +172,12 @@ class HLSSpliceVod {
const adPlaylist = ad.playlist[findNearestBw(bw, Object.keys(ad.playlist))];
let pos = 0;
let i = 0;
closestCmafMapUri = this._getCmafMapUri(this.playlists[bw], this.masterManifestUri, 1);
closestCmafMapUri = this._getCmafMapUri(this.playlists[bw], this.masterManifestUri, this.baseUrl);

while (pos < offset && i < this.playlists[bw].items.PlaylistItem.length) {
const plItem = this.playlists[bw].items.PlaylistItem[i];
if (plItem.attributes.attributes["map-uri"]) {
closestCmafMapUri = this._getCmafMapUri(this.playlists[bw], this.masterManifestUri, 1, i);
closestCmafMapUri = this._getCmafMapUri(this.playlists[bw], this.masterManifestUri, this.baseUrl, i);
}
pos += plItem.get("duration") * 1000;
i++;
Expand Down Expand Up @@ -233,12 +233,12 @@ class HLSSpliceVod {
const adPlaylist = ad.playlistAudio[nearestGroup][nearestLang];
let pos = 0;
let idx = 0;
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, 1);
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, this.baseUrl);

while (pos < offset && idx < playlist.items.PlaylistItem.length) {
const plItem = playlist.items.PlaylistItem[idx];
if (plItem.attributes.attributes["map-uri"]) {
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, 1, i);
closestCmafMapUri = this._getCmafMapUri(playlist, this.masterManifestUri, this.baseUrl, i);
}
pos += plItem.get("duration") * 1000;
idx++;
Expand Down
3 changes: 1 addition & 2 deletions spec/hls_splice_spec.js
Expand Up @@ -1751,7 +1751,7 @@ test-audio=256000-6.m4s`;
});
});

fit("handles one pre-roll and one post-roll", (done) => {
it("handles one pre-roll and one post-roll", (done) => {
const mockVod = new HLSSpliceVod("http://mock.com/mock.m3u8");
mockVod
.load(mockCmafMasterManifest, mockCmafMediaManifest, mockCmafAudioManifest)
Expand All @@ -1775,7 +1775,6 @@ test-audio=256000-6.m4s`;
})
.then(() => {
const m3u8 = mockVod.getMediaManifest(4497000);
console.log(m3u8)
const lines = m3u8.split("\n");
expect(lines[lines.length - 3]).toEqual("#EXT-X-CUE-IN");
expect(lines[lines.length - 2]).toEqual("#EXT-X-ENDLIST");
Expand Down

0 comments on commit 8a38179

Please sign in to comment.