Skip to content

Commit

Permalink
fix(player): resolve relative hls rendition uri
Browse files Browse the repository at this point in the history
ref #964
  • Loading branch information
mihar-22 committed Oct 19, 2023
1 parent b8000f5 commit c59c8fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vidstack/src/utils/hls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ export function resolveStreamTypeFromHLSManifest(
.then((res) => res.text())
.then((manifest) => {
const renditionURI = resolveHLSRenditionURI(manifest);
if (renditionURI) return resolveStreamTypeFromHLSManifest(renditionURI, requestInit);
if (renditionURI) {
return resolveStreamTypeFromHLSManifest(
/^https?:/.test(renditionURI) ? renditionURI : new URL(renditionURI, manifestSrc).href,
requestInit,
);
}

const streamType = /EXT-X-PLAYLIST-TYPE:\s*VOD/.test(manifest) ? 'on-demand' : 'live';

Expand Down

0 comments on commit c59c8fd

Please sign in to comment.