{"record":{"id":"cb0554ebcfcb259f","repo":"remotion-dev/remotion","slug":"ext-x-playlist-type-directive-must-have-a-value","errorCode":null,"errorMessage":"#EXT-X-PLAYLIST-TYPE. directive must have a value","messagePattern":"#EXT-X-PLAYLIST-TYPE\\. directive must have a value","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/containers/m3u/parse-directive.ts","lineNumber":70,"sourceCode":"\t\tif (!value) {\n\t\t\tthrow new Error('EXTINF has no value');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-extinf',\n\t\t\tvalue: parseFloat(value),\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-ENDLIST') {\n\t\treturn {\n\t\t\ttype: 'm3u-endlist',\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-PLAYLIST-TYPE') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-PLAYLIST-TYPE. directive must have a value');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-playlist-type',\n\t\t\tplaylistType: value,\n\t\t};\n\t}\n\n\tif (directive === '#EXT-X-MEDIA-SEQUENCE') {\n\t\tif (!value) {\n\t\t\tthrow new Error('#EXT-X-MEDIA-SEQUENCE directive must have a value');\n\t\t}\n\n\t\treturn {\n\t\t\ttype: 'm3u-media-sequence',\n\t\t\tvalue: Number(value),\n\t\t};\n\t}","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/containers/m3u/parse-directive.ts#L52-L88","documentation":"Thrown by parseM3uDirective() at parse-directive.ts:70 when a line matches #EXT-X-PLAYLIST-TYPE but has no value. This optional directive indicates whether the playlist is EVENT or VOD. (Note: the error message contains a stray period — '#EXT-X-PLAYLIST-TYPE. directive...' — which is a typo in the source.) The parser requires a value to store as playlistType.","triggerScenarios":"A playlist line '#EXT-X-PLAYLIST-TYPE' with no colon, or '#EXT-X-PLAYLIST-TYPE:' with an empty value.","commonSituations":"Hand-edited playlist where the type value was accidentally deleted; encoder or packager bug producing an incomplete directive; malformed playlist from a CDN.","solutions":["Ensure the directive specifies EVENT or VOD: #EXT-X-PLAYLIST-TYPE:VOD","Remove the directive entirely if the playlist type is not important (it is optional per spec)","Regenerate the playlist with a compliant packager"],"exampleFix":"// before\n#EXT-X-PLAYLIST-TYPE:\n\n// after\n#EXT-X-PLAYLIST-TYPE:VOD","handlingStrategy":"validation","validationCode":"// Pre-fetch and check EXT-X-PLAYLIST-TYPE has a value\nconst text = await (await fetch(url)).text();\nfor (const line of text.split('\\n')) {\n  const trimmed = line.trim();\n  if (trimmed.startsWith('#EXT-X-PLAYLIST-TYPE')) {\n    const colonIdx = trimmed.indexOf(':');\n    if (colonIdx === -1 || !trimmed.slice(colonIdx + 1).trim()) {\n      throw new Error('#EXT-X-PLAYLIST-TYPE is missing its value');\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await parseMedia({src: url});\n} catch (e) {\n  if (e instanceof Error && e.message.includes('EXT-X-PLAYLIST-TYPE')) {\n    // fix the value or remove the optional directive\n  }\n  throw e;\n}","preventionTips":["Remove the optional #EXT-X-PLAYLIST-TYPE directive if you do not need it","Otherwise ensure it specifies EVENT or VOD"],"tags":["hls","m3u8","directive","ext-x-playlist-type","malformed"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}