play-video-streamed
A simple utility library for streaming MP4 video playback in HTML5
elements, supporting custom chunk reading and playback control.
Installation
``
bash
npm i play-video-streamed
`
API
$3
Enable or disable logging.
- enabled
: Whether to enable logging (true
/false
)
Notice: It is NOT recommended to enable logging in production environments.
$3
Exception that is thrown when the browser does not support the MediaSource
API or the video format is not supported.
$3
`
typescript
PlayMp4Video(
video: HTMLVideoElement,
fileReader: (start: number, end: number, abort?: AbortController) => Promise,
bs?: number,
onVideoEnd?: ((end_of_stream_func: () => void) => void) | null
): Promise<() => void>
`
- video
: Target