{"record":{"id":"2682a79dafff07d9","repo":"remotion-dev/remotion","slug":"expected-m3u-playlist-with-src-src","errorCode":null,"errorMessage":"Expected m3u-playlist with src ${src}","messagePattern":"Expected m3u-playlist with src (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/get-playlist.ts","lineNumber":50,"sourceCode":"\t\t\t\ttype: 'm3u-playlist',\n\t\t\t\tboxes: structure.boxes,\n\t\t\t\tsrc,\n\t\t\t},\n\t\t];\n\t}\n\n\treturn playlists;\n};\n\nexport const getPlaylist = (\n\tstructure: M3uStructure,\n\tsrc: string,\n): M3uPlaylist => {\n\tconst allPlaylists = getAllPlaylists({structure, src});\n\n\tconst playlists = allPlaylists.find((box) => box.src === src);\n\tif (!playlists) {\n\t\tthrow new Error(`Expected m3u-playlist with src ${src}`);\n\t}\n\n\treturn playlists as M3uPlaylist;\n};\n\nexport const getDurationFromPlaylist = (playlist: M3uPlaylist): number => {\n\tconst duration = playlist.boxes.filter((box) => box.type === 'm3u-extinf');\n\tif (duration.length === 0) {\n\t\tthrow new Error('Expected duration in m3u playlist');\n\t}\n\n\treturn duration.reduce((acc, d) => acc + d.value, 0);\n};\n","sourceCodeStart":32,"sourceCodeEnd":64,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/get-playlist.ts#L32-L64","documentation":"Thrown by getPlaylist() at get-playlist.ts:50 when searching getAllPlaylists() output for a playlist whose src string matches the provided src argument. Each fetched playlist is stored with its URL as src; if none matches, the lookup fails. The comparison is strict string equality after createAdjacentFileSource resolves relative URIs against the master playlist URL.","triggerScenarios":"Called internally during process-m3u-chunk when iterating selected playlist URLs. The src passed to getPlaylist doesn't match any stored M3uPlaylist.src because URL resolution (createAdjacentFileSource) produced a different string, or because the media playlist fetch failed silently and was never added to the structure.","commonSituations":"Relative vs absolute URL mismatches when the master playlist uses relative segment URIs; trailing-slash or query-parameter differences between resolved and stored URLs; a media playlist fetch that failed (404, CORS) and was not added to structure.boxes.","solutions":["Ensure all media playlist URLs in the master playlist resolve to valid, fetchable resources","Check for CORS or 404 errors on sub-playlist fetches that would prevent them from being stored","Verify the src strings are consistent — relative URIs are resolved against the master playlist URL by createAdjacentFileSource"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: 'https://cdn.example.com/master.m3u8'});\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Expected m3u-playlist with src')) {\n    // a sub-playlist fetch failed or URL resolution mismatch occurred\n  }\n  throw e;\n}","preventionTips":["Ensure all sub-playlist URLs in the master manifest are reachable and CORS-accessible","Verify relative URI resolution is correct for your CDN structure"],"tags":["hls","m3u8","url-resolution","playlist-lookup","sub-playlist"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}