Skip to content

Commit

Permalink
fix: optional uri paramenter was required for ext-x-media
Browse files Browse the repository at this point in the history
  • Loading branch information
VolcanoCookies authored and birme committed Sep 25, 2023
1 parent 463066a commit 3c8a63c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/manifests/utils/hlsManifestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ export default function (): HLSManifestTools {
// [Audio/Subtitles/IFrame]
m3u.items.MediaItem = m3u.items.MediaItem.map((mediaItem) => {
const currentUri = mediaItem.get('uri');
// #EXT-X-MEDIA URI,is only required with type SUBTITLES, optional for AUDIO and VIDEO
if (mediaItem.get('type') !== 'SUBTITLES' && currentUri == undefined) {
return mediaItem;
}

mediaItem.set(
'uri',
proxyPathBuilder(currentUri, originalUrlQuery, 'proxy-media.m3u8')
Expand Down
2 changes: 1 addition & 1 deletion src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type TargetIndex = number | '*';

/* eslint-disable */
export type M3UItem = {
get: (key: 'uri') => string | any;
get: (key: 'uri' | 'type') => string | any;
set: (key: 'uri', value: string) => void;
};

Expand Down

0 comments on commit 3c8a63c

Please sign in to comment.