From 8a38179aac4099cc6aa5755a91d512fe7454d172 Mon Sep 17 00:00:00 2001 From: Nicholas Frederiksen Date: Fri, 17 Feb 2023 13:46:48 +0100 Subject: [PATCH] test: fix logs --- index.js | 10 +++++----- spec/hls_splice_spec.js | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 6e6b58c..9298d37 100644 --- a/index.js +++ b/index.js @@ -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++; @@ -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++; diff --git a/spec/hls_splice_spec.js b/spec/hls_splice_spec.js index fba848d..e2fdfb4 100644 --- a/spec/hls_splice_spec.js +++ b/spec/hls_splice_spec.js @@ -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) @@ -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");