fluxkit-player 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +88 -9
- package/README.en.md +224 -0
- package/README.md +207 -98
- package/THIRD-PARTY-NOTICES.md +30 -0
- package/dist/fluxkit.js +2052 -479
- package/dist/fluxkit.js.map +1 -1
- package/dist/fluxkit.umd.cjs +75 -3
- package/dist/fluxkit.umd.cjs.map +1 -1
- package/dist/types/config.d.ts +21 -1
- package/dist/types/crypto/hls-aes.d.ts +13 -0
- package/dist/types/demux/flv.d.ts +2 -0
- package/dist/types/demux/hls.d.ts +25 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/pipeline/timeline.d.ts +4 -0
- package/dist/types/player.d.ts +60 -1
- package/dist/types/render/audio.d.ts +13 -0
- package/dist/types/render/backlog.d.ts +27 -0
- package/dist/types/render/mse.d.ts +7 -0
- package/dist/types/render/software.d.ts +34 -1
- package/dist/types/render/subtitles.d.ts +36 -0
- package/dist/types/render/webcodecs.d.ts +4 -0
- package/dist/types/soft/index.d.ts +5 -0
- package/dist/types/soft/openh264.d.ts +21 -0
- package/dist/types/soft/soft-worker.d.ts +2 -0
- package/dist/types/soft/types.d.ts +2 -2
- package/dist/types/soft/worker-protocol.d.ts +52 -0
- package/dist/types/source/abr.d.ts +22 -0
- package/dist/types/source/hls.d.ts +39 -2
- package/dist/types/source/stream.d.ts +2 -1
- package/dist/types/types.d.ts +108 -0
- package/dist/types/ui/controls.d.ts +68 -0
- package/docs/PUBLISHING.md +142 -0
- package/docs/README.md +42 -0
- package/docs/TEST-REPORT.md +370 -0
- package/docs/USAGE.md +513 -0
- package/docs/architecture.md +213 -0
- package/docs/test-logs/build.txt +19 -0
- package/docs/test-logs/coverage.txt +64 -0
- package/docs/test-logs/e2e-firefox.txt +1667 -0
- package/docs/test-logs/e2e.txt +1667 -0
- package/docs/test-logs/environment.json +62 -0
- package/docs/test-logs/typecheck.txt +1 -0
- package/docs/test-logs/unit.txt +81 -0
- package/examples/README.md +53 -0
- package/examples/minimal.html +49 -0
- package/examples/react/FluxPlayer.tsx +48 -0
- package/examples/soft-worker.js +6 -0
- package/examples/vue/FluxPlayer.vue +47 -0
- package/package.json +22 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,87 @@ All notable changes to FluxKit are documented here.
|
|
|
4
4
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.1] — 2026-11-30
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Software decode in a module Worker (`softDecode.worker` + `softDecode.modules`):
|
|
14
|
+
decoding and YUV→RGBA run off the main thread, frames arrive as
|
|
15
|
+
`ImageBitmap` via `OffscreenCanvas`; automatic main-thread fallback.
|
|
16
|
+
- `installSoftWorker()` worker bootstrap and `stats.decodeWorker`.
|
|
17
|
+
- HTTP-FLV VOD duration from `onMetaData` (progress bar works for FLV files).
|
|
18
|
+
- Live reconnect: exponential backoff on mid-stream drops, `reconnecting` /
|
|
19
|
+
`reconnected` events, `autoReconnect` and `live` options, finite
|
|
20
|
+
Content-Length → VOD detection.
|
|
21
|
+
- Controls: Picture-in-Picture, playback rate, loading spinner, error toast,
|
|
22
|
+
clickable LIVE badge (jump to the live edge).
|
|
23
|
+
- Player: `seekToLive()`, `setPlaybackRate()`, `togglePictureInPicture()`,
|
|
24
|
+
`isStopped`, `isLoading`, `playbackRate`; `loading` event.
|
|
25
|
+
- `stop()` followed by `play()` reloads the last URL.
|
|
26
|
+
- Canvas renderers (WebCodecs / WASM) now support HLS VOD seek, playback rate
|
|
27
|
+
(audio rescheduling) and Picture-in-Picture via `canvas.captureStream()`.
|
|
28
|
+
- HLS alternate audio tracks: `audioTracks`, `selectAudioTrack()`,
|
|
29
|
+
`audiochange`; WebVTT subtitles: `subtitleTracks`, `selectSubtitleTrack()`,
|
|
30
|
+
DOM overlay with `X-TIMESTAMP-MAP` support, `subtitlechange`.
|
|
31
|
+
- H.264 Main/High software decoding via the optional OpenH264 WASM backend
|
|
32
|
+
(`@enaium/openh264-kmp`), including Worker decoding; Baseline still uses
|
|
33
|
+
h264bsd.
|
|
34
|
+
- HLS ABR: automatic variant switching by buffer/throughput, manual
|
|
35
|
+
`player.setQuality(bandwidth | 'auto')`, `qualitychange` event and
|
|
36
|
+
`stats.variantBandwidth`; in-place switching at segment boundaries with MSE
|
|
37
|
+
reconfiguration (no reload). Live HLS starts at the live edge.
|
|
38
|
+
- HLS AES-256-GCM: WebCrypto AES-GCM decryption of `IV || ciphertext || tag`
|
|
39
|
+
segments and LL-HLS parts.
|
|
40
|
+
- HLS AES-128: WebCrypto AES-CBC/PKCS#7 decryption for Media Segments and
|
|
41
|
+
LL-HLS Partial Segments, key caching, explicit `IV` and media-sequence IV,
|
|
42
|
+
`KEYFORMAT=identity`.
|
|
43
|
+
- LL-HLS: `EXT-X-PART-INF`, `EXT-X-PART`, blocking playlist reload
|
|
44
|
+
(`_HLS_msn` / `_HLS_part`) and partial-segment playback; completed segments
|
|
45
|
+
whose parts were already played are not fetched twice.
|
|
46
|
+
- HLS `EXT-X-DISCONTINUITY` / `EXT-X-DISCONTINUITY-SEQUENCE`: timestamps are
|
|
47
|
+
rebased at the discontinuity instead of jumping or collapsing; a changed
|
|
48
|
+
`EXT-X-MAP` init segment is loaded mid-playlist.
|
|
49
|
+
- HLS segment and playlist reload retries (3 attempts) for flaky live streams.
|
|
50
|
+
- Live MSE buffer trimming (30 s behind the playhead).
|
|
51
|
+
- Live software decode resyncs at the next usable keyframe when more than 1 s
|
|
52
|
+
behind, and drops stale frames before presentation, so latency stays bounded
|
|
53
|
+
instead of growing without limit.
|
|
54
|
+
- Recording falls back to MP4 mime types on browsers without WebM.
|
|
55
|
+
|
|
56
|
+
### Fixed
|
|
57
|
+
|
|
58
|
+
- HLS live playlist/cue memory pruning for long-running streams.
|
|
59
|
+
- Source generation guards so callbacks from an old load cannot mutate a new stream.
|
|
60
|
+
- Native-fallback failures now surface as player errors instead of unhandled rejections.
|
|
61
|
+
- PiP capture is cleaned up on load/restart; canvas rate/PiP controls are visible.
|
|
62
|
+
- ABR skips variants with a different video codec family; removed HLS keys are cleared.
|
|
63
|
+
- Permanent AES/key/decrypt errors no longer trigger reconnect loops.
|
|
64
|
+
- Canvas VOD `ended` detection is load-scoped and bounded.
|
|
65
|
+
- Subtitles retry/timeout on live playlists and prune old cues.
|
|
66
|
+
- MP3 fMP4 `esds`/mime and WebCodecs audio configuration corrected.
|
|
67
|
+
- MSE track reconfiguration no longer updates state before codec compatibility checks.
|
|
68
|
+
|
|
69
|
+
### Changed
|
|
70
|
+
|
|
71
|
+
- Cross-browser E2E: Chrome (CDP) and Firefox 158 (geckodriver / WebDriver),
|
|
72
|
+
28 scenarios each, including MSE/WebCodecs, WASM software decode, LL-HLS,
|
|
73
|
+
AES-128, controls, reconnect and 1080p benchmarks.
|
|
74
|
+
- Worker software decode uses fixed-point YUV→RGBA lookup tables and reuses the
|
|
75
|
+
`ImageData` buffer (~1.4× faster conversion, no per-frame 8 MB allocation).
|
|
76
|
+
- Standardized tooling: ESLint + Prettier, coverage, CI and release workflows,
|
|
77
|
+
third-party notices, security/contributing docs.
|
|
78
|
+
|
|
79
|
+
### Known limitations
|
|
80
|
+
|
|
81
|
+
- HLS `SAMPLE-AES` and DRM (Widevine / FairPlay / PlayReady) are not implemented.
|
|
82
|
+
- Dolby `ac-3` / `ec-3` audio is not supported.
|
|
83
|
+
- MP4 requires faststart (`moov` before `mdat`) for the MSE path.
|
|
84
|
+
- HLS AES-128 / AES-256-GCM require a WebCrypto secure context.
|
|
85
|
+
- OpenH264 covers 8-bit H.264 Main/High; High 10-bit / 4:2:2 may be rejected.
|
|
86
|
+
- G.711 is decoded at 8 kHz; FLV header sample-rate fields are ignored.
|
|
87
|
+
|
|
7
88
|
## [0.1.0] — 2026-11-26
|
|
8
89
|
|
|
9
90
|
### Added
|
|
@@ -25,17 +106,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
25
106
|
- Robustness: Content-Type sniffing and protocol correction, 4xx fast-fail with
|
|
26
107
|
server error messages, throughput/reconnect retry policy, monotonic timeline.
|
|
27
108
|
- Typed event API, stats (fps/bitrate/buffer/latency/frames), `mediaTracks`.
|
|
28
|
-
-
|
|
109
|
+
- Built-in overlay controls (`controls: true`): play/pause, stop, progress,
|
|
110
|
+
volume, screenshot, WebM recording and fullscreen, with keyboard shortcuts.
|
|
111
|
+
- Public `snapshot()`, `startRecording()`, `stopRecording()`,
|
|
112
|
+
`toggleFullscreen()`, `isRecording`, `muted`.
|
|
113
|
+
- 34 unit tests and 13 Chrome end-to-end scenarios (release 0.1.0).
|
|
114
|
+
- Audio diagnostics: `stats.audioPeak` / `audioState` / `audioVolume` / `audioPath`
|
|
115
|
+
(peak scan is alias-free and held for 3 s), plus a 1 kHz G.711 E2E fixture.
|
|
29
116
|
|
|
30
117
|
### Removed
|
|
31
118
|
|
|
32
119
|
- RTSP / RTMP support and the WebSocket tunnel example. Browsers cannot open raw
|
|
33
120
|
TCP sockets; the supported low-latency HTTP/WS path is HTTP-FLV / WS-FLV.
|
|
34
|
-
|
|
35
|
-
### Known limitations
|
|
36
|
-
|
|
37
|
-
- HLS AES-128 encryption is not implemented.
|
|
38
|
-
- Software H.264 decoding is Baseline-only (h264bsd).
|
|
39
|
-
- G.711 is decoded at 8 kHz; FLV header sample-rate fields are ignored.
|
|
40
|
-
- Dolby `ac-3` / `ec-3` is not supported.
|
|
41
|
-
- MP4 requires faststart (`moov` before `mdat`) for the MSE path.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# FluxKit
|
|
2
|
+
|
|
3
|
+
[中文](./README.md) · [Usage guide](./docs/USAGE.md) · [Architecture](./docs/architecture.md) · [Test report](./docs/TEST-REPORT.md)
|
|
4
|
+
|
|
5
|
+
> **One player for every stream.** Low-latency web playback for HTTP-FLV,
|
|
6
|
+
> WS-FLV, MP4, HTTP-FMP4 and HLS, with H.264/H.265 hardware decoding and a
|
|
7
|
+
> WASM software fallback.
|
|
8
|
+
|
|
9
|
+
`fluxkit-player` is a zero-runtime-dependency TypeScript video library. It
|
|
10
|
+
demuxes the container, normalizes the timeline, muxes fMP4 when needed, then
|
|
11
|
+
hands frames to **MSE** (native hardware decode), **WebCodecs**, or a **WASM
|
|
12
|
+
software decoder** — and only then falls back to a plain `<video>`.
|
|
13
|
+
|
|
14
|
+
- Package: **`fluxkit-player`** · Class / global: `FluxKit`
|
|
15
|
+
- ESM + UMD + full TypeScript types
|
|
16
|
+
- Tested in Chrome 154 and Firefox 158 (28 E2E scenarios each)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
| | |
|
|
23
|
+
| --------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
24
|
+
| **Protocols** | HTTP-FLV, WS-FLV, MP4, HTTP-FMP4, HLS (TS / fMP4) |
|
|
25
|
+
| **Codecs** | H.264, H.265, AAC, MP3 (FLV), G.711 A-law/μ-law (FLV) |
|
|
26
|
+
| **Hardware decode** | MSE native / WebCodecs `prefer-hardware` |
|
|
27
|
+
| **Software fallback** | H.265 via `libde265` WASM, Baseline H.264 via `h264bsd` WASM |
|
|
28
|
+
| **Low latency** | ~200–500 ms fragments, live catch-up, buffer trimming |
|
|
29
|
+
| **Robustness** | MSE → WebCodecs → WASM → native, Content-Type correction, 4xx fast-fail |
|
|
30
|
+
| **HLS** | master playlist, alternate audio, byte ranges, live, discontinuity, LL-HLS, AES-128/256-GCM, ABR, subtitles |
|
|
31
|
+
| **Built-in controls** | play/pause, stop, progress, volume, screenshot, recording, fullscreen |
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install fluxkit-player
|
|
37
|
+
|
|
38
|
+
# optional WASM software decoding
|
|
39
|
+
npm install @yume-chan/libde265 @yume-chan/h264bsd
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { FluxKit } from 'fluxkit-player';
|
|
46
|
+
|
|
47
|
+
const player = new FluxKit('#stage', {
|
|
48
|
+
decoder: 'auto',
|
|
49
|
+
autoplay: true,
|
|
50
|
+
muted: true,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
player.on('stats', (s) => {
|
|
54
|
+
console.log(s.protocol, s.decoder, s.fps, s.kbps, s.latency);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await player.load('https://example.com/live/room1.flv');
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<div id="stage" style="width: 960px; aspect-ratio: 16/9; background: #000"></div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`FluxKit` creates a `<video>` (MSE) and a `<canvas>` (WebCodecs/software) inside
|
|
65
|
+
the container automatically.
|
|
66
|
+
|
|
67
|
+
### Browser (UMD)
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<script src="https://unpkg.com/fluxkit-player/dist/fluxkit.umd.cjs"></script>
|
|
71
|
+
<script>
|
|
72
|
+
const { FluxKit } = window.FluxKit;
|
|
73
|
+
const player = new FluxKit('#stage', { autoplay: true, muted: true });
|
|
74
|
+
player.load('/live/stream.flv');
|
|
75
|
+
</script>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Decoder negotiation
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
MSE → WebCodecs → WASM software → native <video>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Force a path with `decoder: 'mse' | 'webcodecs' | 'software' | 'native'`.
|
|
85
|
+
The active path is reported by the `ready` event and `stats.decoder`.
|
|
86
|
+
|
|
87
|
+
H.265 availability depends on the platform (Windows HEVC extension + GPU,
|
|
88
|
+
macOS, Android). On Linux desktop Chrome it usually falls back to the WASM
|
|
89
|
+
decoder:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
const player = new FluxKit('#stage', {
|
|
93
|
+
softDecode: {
|
|
94
|
+
loaders: {
|
|
95
|
+
hevc: () => import('@yume-chan/libde265'),
|
|
96
|
+
avc: () => import('@yume-chan/h264bsd'),
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Software decode in a Worker (recommended)
|
|
103
|
+
|
|
104
|
+
Software decoding runs on the main thread by default. For 720p/1080p, move it
|
|
105
|
+
to a module worker:
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
// soft-worker.js
|
|
109
|
+
import { installSoftWorker } from 'fluxkit-player';
|
|
110
|
+
installSoftWorker(self);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
const player = new FluxKit('#stage', {
|
|
115
|
+
decoder: 'software',
|
|
116
|
+
softDecode: {
|
|
117
|
+
worker: '/soft-worker.js', // or () => new Worker(...)
|
|
118
|
+
modules: {
|
|
119
|
+
hevc: 'https://cdn.jsdelivr.net/npm/@yume-chan/libde265@1.0.0/libde265.mjs',
|
|
120
|
+
avc: 'https://cdn.jsdelivr.net/npm/@yume-chan/h264bsd@1.1.1/h264bsd.mjs',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Decoding and YUV→RGBA happen in the worker; the main thread only draws the
|
|
127
|
+
transferred `ImageBitmap` frames on a 2D canvas, so screenshots and recording
|
|
128
|
+
keep working. `stats.decodeWorker` reports whether the worker path is active.
|
|
129
|
+
If worker startup fails, the player falls back to the main thread automatically.
|
|
130
|
+
|
|
131
|
+
## Built-in controls
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
const player = new FluxKit('#stage', { controls: true });
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
An overlay bar adds play/pause, stop, a VOD progress bar (LIVE badge for live,
|
|
138
|
+
click to jump to the edge), volume/mute, playback rate, Picture-in-Picture,
|
|
139
|
+
screenshot, WebM recording and fullscreen. It auto-hides while playing, shows a
|
|
140
|
+
spinner while loading and a toast on errors; keyboard: Space/K, arrows, M, F.
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
const image = await player.snapshot(); // Blob
|
|
144
|
+
player.startRecording();
|
|
145
|
+
const video = await player.stopRecording(); // Blob | null
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Live reconnect
|
|
149
|
+
|
|
150
|
+
Live streams reconnect automatically with exponential backoff
|
|
151
|
+
(`retry.maxRetries`, `retry.delay`, `retry.maxDelay`). Disable it with
|
|
152
|
+
`autoReconnect: false`; force VOD semantics (e.g. an FLV file over WS) with
|
|
153
|
+
`live: false`. HTTP-FLV over a response with a finite `Content-Length` and HLS
|
|
154
|
+
playlists with `ENDLIST` are detected as VOD automatically.
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
player.on('reconnecting', ({ attempt, max, delay }) => {
|
|
158
|
+
console.log(`reconnect ${attempt}/${max} in ${delay}ms`);
|
|
159
|
+
});
|
|
160
|
+
player.on('reconnected', () => console.log('live edge restored'));
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## API summary
|
|
164
|
+
|
|
165
|
+
| Method | |
|
|
166
|
+
| -------------------------------------- | ----------------------------------------------- |
|
|
167
|
+
| `load(url, { startTime? })` | Load and resolve when the first track is ready |
|
|
168
|
+
| `play()` / `pause()` | Playback (also for canvas renderers) |
|
|
169
|
+
| `seek(ms)` | Seek; HLS VOD restarts from the nearest segment |
|
|
170
|
+
| `stop()` / `destroy()` | Stop (reusable) / destroy |
|
|
171
|
+
| `setVolume(v)` / `setMuted(b)` | Audio (also Web Audio side channel) |
|
|
172
|
+
| `setDecoderMode(mode)` | Applies on the next `load()` |
|
|
173
|
+
| `seekToLive()` | Jump to the live edge |
|
|
174
|
+
| `setPlaybackRate(rate)` | Playback rate (MSE / native / canvas) |
|
|
175
|
+
| `setQuality(bandwidth \| 'auto')` | Select an HLS variant / resume ABR |
|
|
176
|
+
| `selectAudioTrack(id)` | Switch HLS alternate audio |
|
|
177
|
+
| `selectSubtitleTrack(id \| null)` | Enable/disable HLS WebVTT subtitles |
|
|
178
|
+
| `togglePictureInPicture()` | Picture-in-Picture (MSE / native / canvas) |
|
|
179
|
+
| `snapshot()` | Capture the current frame as a Blob |
|
|
180
|
+
| `startRecording()` / `stopRecording()` | Record WebM (video + audio) |
|
|
181
|
+
| `toggleFullscreen()` | Fullscreen the container |
|
|
182
|
+
| `on/once/off` | Typed events |
|
|
183
|
+
|
|
184
|
+
Options: `decoder`, `protocol`, `autoplay`, `muted`, `loop`, `volume`,
|
|
185
|
+
`controls`, `logLevel`, `allowNativeFallback`, `hardwareAcceleration`,
|
|
186
|
+
`segmentDuration`, `liveBufferTarget`, `catchUp`, `retry`, `autoReconnect`,
|
|
187
|
+
`live`, `timeout`, `headers`, `hls`, `webcodecs`, `softDecode`. HLS ABR:
|
|
188
|
+
`hls.abr`, `hls.abrLowBuffer`, `hls.abrHighBuffer`.
|
|
189
|
+
|
|
190
|
+
Events: `ready`, `loaded`, `loading`, `metadata`, `stats`, `error`, `ended`,
|
|
191
|
+
`seeked`, `play`, `pause`, `reconnecting`, `reconnected`, `qualitychange`, `audiochange`, `subtitlechange`, `log`.
|
|
192
|
+
|
|
193
|
+
Read-only: `currentTime`, `duration`, `paused`, `volume`, `isLive`,
|
|
194
|
+
`isStopped`, `isLoading`, `playbackRate`, `variantBandwidth`, `audioTracks`, `subtitleTracks`, `currentProtocol`, `decoderMode`,
|
|
195
|
+
`stats`, `videoElement`, `canvasElement`, `mediaTracks`.
|
|
196
|
+
|
|
197
|
+
## Live reconnect
|
|
198
|
+
|
|
199
|
+
Live streams (HTTP-FLV / WS-FLV / HLS live) reconnect automatically after a
|
|
200
|
+
mid-stream drop with exponential backoff (`retry.maxRetries`, `retry.delay`,
|
|
201
|
+
`retry.maxDelay`). Disable with `autoReconnect: false`; force VOD semantics with
|
|
202
|
+
`live: false` (e.g. an FLV file over WebSocket). Events: `reconnecting`,
|
|
203
|
+
`reconnected`; after the retry budget the player emits `RECONNECT_FAILED`.
|
|
204
|
+
|
|
205
|
+
A finite HTTP `Content-Length` is treated as VOD, so FLV files do not loop.
|
|
206
|
+
|
|
207
|
+
## Documentation
|
|
208
|
+
|
|
209
|
+
- [Usage guide (中文)](./docs/USAGE.md) — protocols, React/Vue, audio, troubleshooting
|
|
210
|
+
- [Architecture](./docs/architecture.md) — pipeline, fMP4, timeline, decoders
|
|
211
|
+
- [Test report](./docs/TEST-REPORT.md) — 71 unit tests, 28 Chrome + 28 Firefox E2E scenarios
|
|
212
|
+
- [Changelog](./CHANGELOG.md)
|
|
213
|
+
|
|
214
|
+
## Known limitations
|
|
215
|
+
|
|
216
|
+
- HLS AES-128 requires WebCrypto (HTTPS or localhost).
|
|
217
|
+
- MP4 requires faststart for the MSE path (native fallback otherwise).
|
|
218
|
+
- Software H.264 uses h264bsd for Baseline and OpenH264 for Main/High.
|
|
219
|
+
- Dolby `ac-3` / `ec-3` is not supported.
|
|
220
|
+
- G.711 is decoded at 8 kHz.
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT © FluxKit contributors
|