Minimal, Low-Latency HLS player written in TypeScript.
- TypeScript 98.9%
- HTML 1.1%
| src | detect failed buffer appends | |
| .gitignore | initial commit | |
| .woodpecker.yml | migrate to codeberg | |
| index.html | initial commit | |
| LICENSE | initial commit | |
| package-lock.json | mitigate endTS spikes | |
| package.json | detect failed buffer appends | |
| README.md | detect failed buffer appends | |
| tsconfig.json | initial commit | |
| vite.config.ts | initial commit | |
Basic_LL-HLS.js is a minimal, Low-Latency HLS player written in TypeScript.
The server must support HLS version 9. Earlier versions are not supported.
Usage
import Hls from "./hls.js";
//const Hls = require("./hls.cjs")
const hls = new Hls(hlsConfig);
hls.onError = (error) => {
console.log(error);
};
const $video = document.querySelector(".js-video");
const url = "https://localhost:8888/test/index.m3u8";
hls.init($video, url)
const hlsConfig = {
maxDelaySec: 2,
maxFailedBufferAppends: 3,
maxRecoveryAttempts: 3,
recoverySleepSec: 3
};
Features
Supported tags
#EXTM3U#EXT-X-VERSION=<n>#EXT-X-STREAM-INF:<attribute-list>#EXT-X-MEDIA-SEQUENCE=<n>#EXT-X-MAP:<attribute-list>#EXT-X-SERVER-CONTROL:<attribute-list>#EXT-X-PART-INF:#EXT-X-PART:<attribute-list>#EXT-X-PRELOAD-HINT:<attribute-list>#EXT-X-SKIP:SKIPPED-SEGMENTS=<n><URI>
Features that will not be supported.
- Adaptive streaming
- Encrypted media extensions
- Ability to seek in buffer
- Built-in Analytics
Specification
https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis
License
This project is licensed under MPLv2.