Skip to content

Commit

Permalink
fix: base url + uri
Browse files Browse the repository at this point in the history
  • Loading branch information
Nfrederiksen committed Feb 22, 2023
1 parent 5c1d1b2 commit a2cf5e1
Show file tree
Hide file tree
Showing 4 changed files with 1,262 additions and 881 deletions.
11 changes: 8 additions & 3 deletions index.js
Expand Up @@ -210,7 +210,8 @@ class HLSSpliceVod {
this.playlists[bw].set("targetDuration", this.targetDuration);
}
const groups = Object.keys(this.playlistsAudio);
if (groups.length > 0) {
const adGroups = Object.keys(ad.playlistAudio);
if (groups.length > 0 && adGroups.length > 0) {
if (isPostRoll) {
let duration = 0;
const langs = Object.keys(this.playlistsAudio[groups[0]]);
Expand Down Expand Up @@ -502,7 +503,9 @@ class HLSSpliceVod {
for (let i = 0; i < this.playlists[bandwidth].items.PlaylistItem.length; i++) {
let plItem = this.playlists[bandwidth].items.PlaylistItem[i];
let uri = plItem.get("uri");
plItem.set("uri", this.baseUrl + uri);
if (!uri.includes("http")) {
plItem.set("uri", this.baseUrl + uri);
}
}
}
const targetDuration = this.playlists[bandwidth].get("targetDuration");
Expand Down Expand Up @@ -549,7 +552,9 @@ class HLSSpliceVod {
for (let i = 0; i < this.playlistsAudio[group][lang].items.PlaylistItem.length; i++) {
let plItem = this.playlistsAudio[group][lang].items.PlaylistItem[i];
let uri = plItem.get("uri");
plItem.set("uri", this.baseUrl + uri);
if (!uri.includes("http")) {
plItem.set("uri", this.baseUrl + uri);
}
}
}
const targetDuration = this.playlistsAudio[group][lang].get("targetDuration");
Expand Down

0 comments on commit a2cf5e1

Please sign in to comment.