Function: classifyEndFile()
function classifyEndFile(
reason: MpvEndFileReason,
errorText: string | undefined,
uri?: string
): EndFileOutcome;
Defined in: packages/player/src/errors.ts:550
Classify an end-file event into a natural end, a deliberate stop, a
playlist redirect, or a typed failure.
Parameters
| Parameter | Type | Description |
|---|---|---|
reason | MpvEndFileReason | mpv_end_file_reason, as renamed by the native spec (endOfFile rather than eof). |
errorText | string | undefined | mpv_error_string() of mpv_event_end_file.error; populated by native only when reason === 'error'. |
uri? | string | The source that was playing, used to separate a network failure from a local one. |
Returns
Remarks
mpv documents that "incomplete or broken files" may end with either
EOF or ERROR (mpv/client.h, MPV_END_FILE_REASON_ERROR), so a clean
endOfFile is always reported as a natural end — guessing otherwise would
turn ordinary track completions into spurious errors.