mattebox 0.1.0
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/LICENSE +21 -0
- package/README.md +106 -0
- package/dist/cdn/mattebox.dash-drm.min.js +2 -0
- package/dist/cdn/mattebox.dash.min.js +2 -0
- package/dist/cdn/mattebox.dual-drm.min.js +2 -0
- package/dist/cdn/mattebox.dual-ts-drm.min.js +3 -0
- package/dist/cdn/mattebox.dual-ts.min.js +3 -0
- package/dist/cdn/mattebox.dual.min.js +2 -0
- package/dist/cdn/mattebox.hls-drm.min.js +2 -0
- package/dist/cdn/mattebox.hls-ts-drm.min.js +3 -0
- package/dist/cdn/mattebox.hls-ts.min.js +3 -0
- package/dist/cdn/mattebox.hls.min.js +2 -0
- package/dist/cdn/mattebox.kernel.min.js +1 -0
- package/dist/cdn/mattebox.min.js +6 -0
- package/dist/cdn/transmux.worker.js +1 -0
- package/dist/containers/adts.d.ts +33 -0
- package/dist/containers/adts.d.ts.map +1 -0
- package/dist/containers/adts.js +66 -0
- package/dist/containers/adts.js.map +1 -0
- package/dist/containers/captions.d.ts +27 -0
- package/dist/containers/captions.d.ts.map +1 -0
- package/dist/containers/captions.js +36 -0
- package/dist/containers/captions.js.map +1 -0
- package/dist/containers/codec-probe/index.d.ts +35 -0
- package/dist/containers/codec-probe/index.d.ts.map +1 -0
- package/dist/containers/codec-probe/index.js +222 -0
- package/dist/containers/codec-probe/index.js.map +1 -0
- package/dist/containers/fmp4/writer.d.ts +62 -0
- package/dist/containers/fmp4/writer.d.ts.map +1 -0
- package/dist/containers/fmp4/writer.js +201 -0
- package/dist/containers/fmp4/writer.js.map +1 -0
- package/dist/containers/id3.d.ts +25 -0
- package/dist/containers/id3.d.ts.map +1 -0
- package/dist/containers/id3.js +75 -0
- package/dist/containers/id3.js.map +1 -0
- package/dist/containers/mp4-box/index.d.ts +79 -0
- package/dist/containers/mp4-box/index.d.ts.map +1 -0
- package/dist/containers/mp4-box/index.js +231 -0
- package/dist/containers/mp4-box/index.js.map +1 -0
- package/dist/containers/packed-audio/index.d.ts +7 -0
- package/dist/containers/packed-audio/index.d.ts.map +1 -0
- package/dist/containers/packed-audio/index.js +63 -0
- package/dist/containers/packed-audio/index.js.map +1 -0
- package/dist/containers/sei.d.ts +26 -0
- package/dist/containers/sei.d.ts.map +1 -0
- package/dist/containers/sei.js +100 -0
- package/dist/containers/sei.js.map +1 -0
- package/dist/containers/ts-transmux/demux.d.ts +49 -0
- package/dist/containers/ts-transmux/demux.d.ts.map +1 -0
- package/dist/containers/ts-transmux/demux.js +222 -0
- package/dist/containers/ts-transmux/demux.js.map +1 -0
- package/dist/containers/ts-transmux/h264.d.ts +48 -0
- package/dist/containers/ts-transmux/h264.d.ts.map +1 -0
- package/dist/containers/ts-transmux/h264.js +211 -0
- package/dist/containers/ts-transmux/h264.js.map +1 -0
- package/dist/containers/ts-transmux/index.d.ts +17 -0
- package/dist/containers/ts-transmux/index.d.ts.map +1 -0
- package/dist/containers/ts-transmux/index.js +34 -0
- package/dist/containers/ts-transmux/index.js.map +1 -0
- package/dist/containers/ts-transmux/runner.d.ts +23 -0
- package/dist/containers/ts-transmux/runner.d.ts.map +1 -0
- package/dist/containers/ts-transmux/runner.js +99 -0
- package/dist/containers/ts-transmux/runner.js.map +1 -0
- package/dist/containers/ts-transmux/transmux.d.ts +24 -0
- package/dist/containers/ts-transmux/transmux.d.ts.map +1 -0
- package/dist/containers/ts-transmux/transmux.js +212 -0
- package/dist/containers/ts-transmux/transmux.js.map +1 -0
- package/dist/containers/ts-transmux/transmux.worker.d.ts +2 -0
- package/dist/containers/ts-transmux/transmux.worker.d.ts.map +1 -0
- package/dist/containers/ts-transmux/transmux.worker.js +19 -0
- package/dist/containers/ts-transmux/transmux.worker.js.map +1 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/asyncToGenerator.js +27 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/defineProperty.js +12 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/objectSpread2.js +25 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/objectWithoutProperties.js +13 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/objectWithoutPropertiesLoose.js +12 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/es2015/_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/typeof.js +11 -0
- package/dist/es2015/containers/adts.js +77 -0
- package/dist/es2015/containers/captions.js +36 -0
- package/dist/es2015/containers/codec-probe/index.js +220 -0
- package/dist/es2015/containers/fmp4/writer.js +165 -0
- package/dist/es2015/containers/id3.js +72 -0
- package/dist/es2015/containers/mp4-box/index.js +209 -0
- package/dist/es2015/containers/packed-audio/index.js +67 -0
- package/dist/es2015/containers/sei.js +79 -0
- package/dist/es2015/containers/ts-transmux/demux.js +211 -0
- package/dist/es2015/containers/ts-transmux/h264.js +204 -0
- package/dist/es2015/containers/ts-transmux/index.js +37 -0
- package/dist/es2015/containers/ts-transmux/runner.js +95 -0
- package/dist/es2015/containers/ts-transmux/transmux.js +210 -0
- package/dist/es2015/containers/ts-transmux/transmux.worker.js +26 -0
- package/dist/es2015/index.js +356 -0
- package/dist/es2015/kernel/append-queue.js +148 -0
- package/dist/es2015/kernel/bus.js +134 -0
- package/dist/es2015/kernel/context.js +92 -0
- package/dist/es2015/kernel/effects.js +62 -0
- package/dist/es2015/kernel/evictor.js +67 -0
- package/dist/es2015/kernel/lifecycle.js +122 -0
- package/dist/es2015/kernel/loader.js +108 -0
- package/dist/es2015/kernel/mime.js +20 -0
- package/dist/es2015/kernel/mse.js +426 -0
- package/dist/es2015/kernel/reducer.js +1051 -0
- package/dist/es2015/kernel/rendition-select.js +263 -0
- package/dist/es2015/kernel/scheduler.js +82 -0
- package/dist/es2015/kernel/sinks/metadata-sink.js +7 -0
- package/dist/es2015/kernel/sinks/mse-sink.js +31 -0
- package/dist/es2015/kernel/sinks/text-track-sink.js +167 -0
- package/dist/es2015/kernel/timeline.js +127 -0
- package/dist/es2015/kernel/trace.js +134 -0
- package/dist/es2015/kernel/track-registry.js +47 -0
- package/dist/es2015/kernel/transport.js +242 -0
- package/dist/es2015/kernel/watchdog.js +38 -0
- package/dist/es2015/presets/dash/index.js +9 -0
- package/dist/es2015/presets/dash-drm/index.js +13 -0
- package/dist/es2015/presets/define.js +45 -0
- package/dist/es2015/presets/dual/index.js +14 -0
- package/dist/es2015/presets/dual-drm/index.js +14 -0
- package/dist/es2015/presets/dual-ts/index.js +14 -0
- package/dist/es2015/presets/dual-ts-drm/index.js +15 -0
- package/dist/es2015/presets/full/index.js +28 -0
- package/dist/es2015/presets/hls/index.js +9 -0
- package/dist/es2015/presets/hls-drm/index.js +13 -0
- package/dist/es2015/presets/hls-ts/index.js +13 -0
- package/dist/es2015/presets/hls-ts-drm/index.js +14 -0
- package/dist/es2015/presets/kernel/index.js +10 -0
- package/dist/es2015/presets/storage.js +24 -0
- package/dist/es2015/presets/tiers.js +93 -0
- package/dist/es2015/protocols/dash-cmaf/index.js +161 -0
- package/dist/es2015/protocols/dash-cmaf/parse.js +491 -0
- package/dist/es2015/protocols/dash-live/index.js +192 -0
- package/dist/es2015/protocols/hls-cmaf/index.js +168 -0
- package/dist/es2015/protocols/hls-cmaf/lexer.js +72 -0
- package/dist/es2015/protocols/hls-cmaf/parse.js +457 -0
- package/dist/es2015/protocols/hls-live/index.js +296 -0
- package/dist/es2015/protocols/live-shared.js +29 -0
- package/dist/es2015/stages/abr/index.js +126 -0
- package/dist/es2015/stages/abr-cap-size/index.js +22 -0
- package/dist/es2015/stages/abr-persist/index.js +52 -0
- package/dist/es2015/stages/aes-128/index.js +76 -0
- package/dist/es2015/stages/alt-audio/index.js +80 -0
- package/dist/es2015/stages/cmaf-timing/index.js +55 -0
- package/dist/es2015/stages/cmcd/index.js +70 -0
- package/dist/es2015/stages/codec-probe/index.js +65 -0
- package/dist/es2015/stages/codec-switch/index.js +48 -0
- package/dist/es2015/stages/content-steering/index.js +179 -0
- package/dist/es2015/stages/drm-shared.js +18 -0
- package/dist/es2015/stages/eme-cenc/index.js +46 -0
- package/dist/es2015/stages/eme-core/index.js +237 -0
- package/dist/es2015/stages/eme-fairplay/index.js +52 -0
- package/dist/es2015/stages/meta-id3/index.js +37 -0
- package/dist/es2015/stages/mp4-box/index.js +27 -0
- package/dist/es2015/stages/nal-scan/index.js +121 -0
- package/dist/es2015/stages/pdt/index.js +34 -0
- package/dist/es2015/stages/recovery/index.js +283 -0
- package/dist/es2015/stages/text-cea608/decode.js +201 -0
- package/dist/es2015/stages/text-cea608/index.js +71 -0
- package/dist/es2015/stages/text-webvtt/index.js +82 -0
- package/dist/es2015/stages/text-webvtt/parse.js +60 -0
- package/dist/es2015/stages/text-webvtt-segmented/index.js +57 -0
- package/dist/es2015/stages/thumbnails/index.js +73 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +423 -0
- package/dist/index.js.map +1 -0
- package/dist/kernel/append-queue.d.ts +47 -0
- package/dist/kernel/append-queue.d.ts.map +1 -0
- package/dist/kernel/append-queue.js +180 -0
- package/dist/kernel/append-queue.js.map +1 -0
- package/dist/kernel/bus.d.ts +50 -0
- package/dist/kernel/bus.d.ts.map +1 -0
- package/dist/kernel/bus.js +147 -0
- package/dist/kernel/bus.js.map +1 -0
- package/dist/kernel/context.d.ts +45 -0
- package/dist/kernel/context.d.ts.map +1 -0
- package/dist/kernel/context.js +116 -0
- package/dist/kernel/context.js.map +1 -0
- package/dist/kernel/effects.d.ts +33 -0
- package/dist/kernel/effects.d.ts.map +1 -0
- package/dist/kernel/effects.js +65 -0
- package/dist/kernel/effects.js.map +1 -0
- package/dist/kernel/evictor.d.ts +46 -0
- package/dist/kernel/evictor.d.ts.map +1 -0
- package/dist/kernel/evictor.js +92 -0
- package/dist/kernel/evictor.js.map +1 -0
- package/dist/kernel/lifecycle.d.ts +41 -0
- package/dist/kernel/lifecycle.d.ts.map +1 -0
- package/dist/kernel/lifecycle.js +129 -0
- package/dist/kernel/lifecycle.js.map +1 -0
- package/dist/kernel/loader.d.ts +28 -0
- package/dist/kernel/loader.d.ts.map +1 -0
- package/dist/kernel/loader.js +126 -0
- package/dist/kernel/loader.js.map +1 -0
- package/dist/kernel/mime.d.ts +13 -0
- package/dist/kernel/mime.d.ts.map +1 -0
- package/dist/kernel/mime.js +18 -0
- package/dist/kernel/mime.js.map +1 -0
- package/dist/kernel/mse.d.ts +62 -0
- package/dist/kernel/mse.d.ts.map +1 -0
- package/dist/kernel/mse.js +490 -0
- package/dist/kernel/mse.js.map +1 -0
- package/dist/kernel/reducer.d.ts +39 -0
- package/dist/kernel/reducer.d.ts.map +1 -0
- package/dist/kernel/reducer.js +1316 -0
- package/dist/kernel/reducer.js.map +1 -0
- package/dist/kernel/rendition-select.d.ts +102 -0
- package/dist/kernel/rendition-select.d.ts.map +1 -0
- package/dist/kernel/rendition-select.js +295 -0
- package/dist/kernel/rendition-select.js.map +1 -0
- package/dist/kernel/scheduler.d.ts +57 -0
- package/dist/kernel/scheduler.d.ts.map +1 -0
- package/dist/kernel/scheduler.js +98 -0
- package/dist/kernel/scheduler.js.map +1 -0
- package/dist/kernel/sinks/metadata-sink.d.ts +7 -0
- package/dist/kernel/sinks/metadata-sink.d.ts.map +1 -0
- package/dist/kernel/sinks/metadata-sink.js +5 -0
- package/dist/kernel/sinks/metadata-sink.js.map +1 -0
- package/dist/kernel/sinks/mse-sink.d.ts +17 -0
- package/dist/kernel/sinks/mse-sink.d.ts.map +1 -0
- package/dist/kernel/sinks/mse-sink.js +20 -0
- package/dist/kernel/sinks/mse-sink.js.map +1 -0
- package/dist/kernel/sinks/text-track-sink.d.ts +45 -0
- package/dist/kernel/sinks/text-track-sink.d.ts.map +1 -0
- package/dist/kernel/sinks/text-track-sink.js +184 -0
- package/dist/kernel/sinks/text-track-sink.js.map +1 -0
- package/dist/kernel/timeline.d.ts +57 -0
- package/dist/kernel/timeline.d.ts.map +1 -0
- package/dist/kernel/timeline.js +203 -0
- package/dist/kernel/timeline.js.map +1 -0
- package/dist/kernel/trace.d.ts +42 -0
- package/dist/kernel/trace.d.ts.map +1 -0
- package/dist/kernel/trace.js +165 -0
- package/dist/kernel/trace.js.map +1 -0
- package/dist/kernel/track-registry.d.ts +22 -0
- package/dist/kernel/track-registry.d.ts.map +1 -0
- package/dist/kernel/track-registry.js +42 -0
- package/dist/kernel/track-registry.js.map +1 -0
- package/dist/kernel/transport.d.ts +90 -0
- package/dist/kernel/transport.d.ts.map +1 -0
- package/dist/kernel/transport.js +256 -0
- package/dist/kernel/transport.js.map +1 -0
- package/dist/kernel/watchdog.d.ts +35 -0
- package/dist/kernel/watchdog.d.ts.map +1 -0
- package/dist/kernel/watchdog.js +43 -0
- package/dist/kernel/watchdog.js.map +1 -0
- package/dist/presets/dash/index.d.ts +4 -0
- package/dist/presets/dash/index.d.ts.map +1 -0
- package/dist/presets/dash/index.js +8 -0
- package/dist/presets/dash/index.js.map +1 -0
- package/dist/presets/dash-drm/index.d.ts +4 -0
- package/dist/presets/dash-drm/index.d.ts.map +1 -0
- package/dist/presets/dash-drm/index.js +8 -0
- package/dist/presets/dash-drm/index.js.map +1 -0
- package/dist/presets/define.d.ts +36 -0
- package/dist/presets/define.d.ts.map +1 -0
- package/dist/presets/define.js +39 -0
- package/dist/presets/define.js.map +1 -0
- package/dist/presets/dual/index.d.ts +4 -0
- package/dist/presets/dual/index.d.ts.map +1 -0
- package/dist/presets/dual/index.js +9 -0
- package/dist/presets/dual/index.js.map +1 -0
- package/dist/presets/dual-drm/index.d.ts +4 -0
- package/dist/presets/dual-drm/index.d.ts.map +1 -0
- package/dist/presets/dual-drm/index.js +13 -0
- package/dist/presets/dual-drm/index.js.map +1 -0
- package/dist/presets/dual-ts/index.d.ts +4 -0
- package/dist/presets/dual-ts/index.d.ts.map +1 -0
- package/dist/presets/dual-ts/index.js +8 -0
- package/dist/presets/dual-ts/index.js.map +1 -0
- package/dist/presets/dual-ts-drm/index.d.ts +4 -0
- package/dist/presets/dual-ts-drm/index.d.ts.map +1 -0
- package/dist/presets/dual-ts-drm/index.js +14 -0
- package/dist/presets/dual-ts-drm/index.js.map +1 -0
- package/dist/presets/full/index.d.ts +4 -0
- package/dist/presets/full/index.d.ts.map +1 -0
- package/dist/presets/full/index.js +27 -0
- package/dist/presets/full/index.js.map +1 -0
- package/dist/presets/hls/index.d.ts +4 -0
- package/dist/presets/hls/index.d.ts.map +1 -0
- package/dist/presets/hls/index.js +8 -0
- package/dist/presets/hls/index.js.map +1 -0
- package/dist/presets/hls-drm/index.d.ts +4 -0
- package/dist/presets/hls-drm/index.d.ts.map +1 -0
- package/dist/presets/hls-drm/index.js +8 -0
- package/dist/presets/hls-drm/index.js.map +1 -0
- package/dist/presets/hls-ts/index.d.ts +4 -0
- package/dist/presets/hls-ts/index.d.ts.map +1 -0
- package/dist/presets/hls-ts/index.js +8 -0
- package/dist/presets/hls-ts/index.js.map +1 -0
- package/dist/presets/hls-ts-drm/index.d.ts +4 -0
- package/dist/presets/hls-ts-drm/index.d.ts.map +1 -0
- package/dist/presets/hls-ts-drm/index.js +13 -0
- package/dist/presets/hls-ts-drm/index.js.map +1 -0
- package/dist/presets/kernel/index.d.ts +4 -0
- package/dist/presets/kernel/index.d.ts.map +1 -0
- package/dist/presets/kernel/index.js +9 -0
- package/dist/presets/kernel/index.js.map +1 -0
- package/dist/presets/storage.d.ts +9 -0
- package/dist/presets/storage.d.ts.map +1 -0
- package/dist/presets/storage.js +24 -0
- package/dist/presets/storage.js.map +1 -0
- package/dist/presets/tiers.d.ts +22 -0
- package/dist/presets/tiers.d.ts.map +1 -0
- package/dist/presets/tiers.js +78 -0
- package/dist/presets/tiers.js.map +1 -0
- package/dist/protocols/dash-cmaf/index.d.ts +20 -0
- package/dist/protocols/dash-cmaf/index.d.ts.map +1 -0
- package/dist/protocols/dash-cmaf/index.js +176 -0
- package/dist/protocols/dash-cmaf/index.js.map +1 -0
- package/dist/protocols/dash-cmaf/parse.d.ts +24 -0
- package/dist/protocols/dash-cmaf/parse.d.ts.map +1 -0
- package/dist/protocols/dash-cmaf/parse.js +586 -0
- package/dist/protocols/dash-cmaf/parse.js.map +1 -0
- package/dist/protocols/dash-live/index.d.ts +4 -0
- package/dist/protocols/dash-live/index.d.ts.map +1 -0
- package/dist/protocols/dash-live/index.js +188 -0
- package/dist/protocols/dash-live/index.js.map +1 -0
- package/dist/protocols/hls-cmaf/index.d.ts +17 -0
- package/dist/protocols/hls-cmaf/index.d.ts.map +1 -0
- package/dist/protocols/hls-cmaf/index.js +189 -0
- package/dist/protocols/hls-cmaf/index.js.map +1 -0
- package/dist/protocols/hls-cmaf/lexer.d.ts +25 -0
- package/dist/protocols/hls-cmaf/lexer.d.ts.map +1 -0
- package/dist/protocols/hls-cmaf/lexer.js +81 -0
- package/dist/protocols/hls-cmaf/lexer.js.map +1 -0
- package/dist/protocols/hls-cmaf/parse.d.ts +57 -0
- package/dist/protocols/hls-cmaf/parse.d.ts.map +1 -0
- package/dist/protocols/hls-cmaf/parse.js +572 -0
- package/dist/protocols/hls-cmaf/parse.js.map +1 -0
- package/dist/protocols/hls-live/index.d.ts +4 -0
- package/dist/protocols/hls-live/index.d.ts.map +1 -0
- package/dist/protocols/hls-live/index.js +309 -0
- package/dist/protocols/hls-live/index.js.map +1 -0
- package/dist/protocols/live-shared.d.ts +21 -0
- package/dist/protocols/live-shared.d.ts.map +1 -0
- package/dist/protocols/live-shared.js +32 -0
- package/dist/protocols/live-shared.js.map +1 -0
- package/dist/stages/abr/index.d.ts +16 -0
- package/dist/stages/abr/index.d.ts.map +1 -0
- package/dist/stages/abr/index.js +176 -0
- package/dist/stages/abr/index.js.map +1 -0
- package/dist/stages/abr-cap-size/index.d.ts +8 -0
- package/dist/stages/abr-cap-size/index.d.ts.map +1 -0
- package/dist/stages/abr-cap-size/index.js +21 -0
- package/dist/stages/abr-cap-size/index.js.map +1 -0
- package/dist/stages/abr-persist/index.d.ts +8 -0
- package/dist/stages/abr-persist/index.d.ts.map +1 -0
- package/dist/stages/abr-persist/index.js +44 -0
- package/dist/stages/abr-persist/index.js.map +1 -0
- package/dist/stages/aes-128/index.d.ts +15 -0
- package/dist/stages/aes-128/index.d.ts.map +1 -0
- package/dist/stages/aes-128/index.js +78 -0
- package/dist/stages/aes-128/index.js.map +1 -0
- package/dist/stages/alt-audio/index.d.ts +4 -0
- package/dist/stages/alt-audio/index.d.ts.map +1 -0
- package/dist/stages/alt-audio/index.js +90 -0
- package/dist/stages/alt-audio/index.js.map +1 -0
- package/dist/stages/cmaf-timing/index.d.ts +3 -0
- package/dist/stages/cmaf-timing/index.d.ts.map +1 -0
- package/dist/stages/cmaf-timing/index.js +56 -0
- package/dist/stages/cmaf-timing/index.js.map +1 -0
- package/dist/stages/cmcd/index.d.ts +22 -0
- package/dist/stages/cmcd/index.d.ts.map +1 -0
- package/dist/stages/cmcd/index.js +92 -0
- package/dist/stages/cmcd/index.js.map +1 -0
- package/dist/stages/codec-probe/index.d.ts +9 -0
- package/dist/stages/codec-probe/index.d.ts.map +1 -0
- package/dist/stages/codec-probe/index.js +68 -0
- package/dist/stages/codec-probe/index.js.map +1 -0
- package/dist/stages/codec-switch/index.d.ts +6 -0
- package/dist/stages/codec-switch/index.d.ts.map +1 -0
- package/dist/stages/codec-switch/index.js +59 -0
- package/dist/stages/codec-switch/index.js.map +1 -0
- package/dist/stages/content-steering/index.d.ts +4 -0
- package/dist/stages/content-steering/index.d.ts.map +1 -0
- package/dist/stages/content-steering/index.js +174 -0
- package/dist/stages/content-steering/index.js.map +1 -0
- package/dist/stages/drm-shared.d.ts +46 -0
- package/dist/stages/drm-shared.d.ts.map +1 -0
- package/dist/stages/drm-shared.js +28 -0
- package/dist/stages/drm-shared.js.map +1 -0
- package/dist/stages/eme-cenc/index.d.ts +12 -0
- package/dist/stages/eme-cenc/index.d.ts.map +1 -0
- package/dist/stages/eme-cenc/index.js +53 -0
- package/dist/stages/eme-cenc/index.js.map +1 -0
- package/dist/stages/eme-core/index.d.ts +29 -0
- package/dist/stages/eme-core/index.d.ts.map +1 -0
- package/dist/stages/eme-core/index.js +244 -0
- package/dist/stages/eme-core/index.js.map +1 -0
- package/dist/stages/eme-fairplay/index.d.ts +20 -0
- package/dist/stages/eme-fairplay/index.d.ts.map +1 -0
- package/dist/stages/eme-fairplay/index.js +59 -0
- package/dist/stages/eme-fairplay/index.js.map +1 -0
- package/dist/stages/meta-id3/index.d.ts +14 -0
- package/dist/stages/meta-id3/index.d.ts.map +1 -0
- package/dist/stages/meta-id3/index.js +30 -0
- package/dist/stages/meta-id3/index.js.map +1 -0
- package/dist/stages/mp4-box/index.d.ts +3 -0
- package/dist/stages/mp4-box/index.d.ts.map +1 -0
- package/dist/stages/mp4-box/index.js +19 -0
- package/dist/stages/mp4-box/index.js.map +1 -0
- package/dist/stages/nal-scan/index.d.ts +3 -0
- package/dist/stages/nal-scan/index.d.ts.map +1 -0
- package/dist/stages/nal-scan/index.js +123 -0
- package/dist/stages/nal-scan/index.js.map +1 -0
- package/dist/stages/pdt/index.d.ts +14 -0
- package/dist/stages/pdt/index.d.ts.map +1 -0
- package/dist/stages/pdt/index.js +34 -0
- package/dist/stages/pdt/index.js.map +1 -0
- package/dist/stages/recovery/index.d.ts +16 -0
- package/dist/stages/recovery/index.d.ts.map +1 -0
- package/dist/stages/recovery/index.js +270 -0
- package/dist/stages/recovery/index.js.map +1 -0
- package/dist/stages/text-cea608/decode.d.ts +44 -0
- package/dist/stages/text-cea608/decode.d.ts.map +1 -0
- package/dist/stages/text-cea608/decode.js +225 -0
- package/dist/stages/text-cea608/decode.js.map +1 -0
- package/dist/stages/text-cea608/index.d.ts +3 -0
- package/dist/stages/text-cea608/index.d.ts.map +1 -0
- package/dist/stages/text-cea608/index.js +84 -0
- package/dist/stages/text-cea608/index.js.map +1 -0
- package/dist/stages/text-webvtt/index.d.ts +3 -0
- package/dist/stages/text-webvtt/index.d.ts.map +1 -0
- package/dist/stages/text-webvtt/index.js +82 -0
- package/dist/stages/text-webvtt/index.js.map +1 -0
- package/dist/stages/text-webvtt/parse.d.ts +19 -0
- package/dist/stages/text-webvtt/parse.d.ts.map +1 -0
- package/dist/stages/text-webvtt/parse.js +62 -0
- package/dist/stages/text-webvtt/parse.js.map +1 -0
- package/dist/stages/text-webvtt-segmented/index.d.ts +5 -0
- package/dist/stages/text-webvtt-segmented/index.d.ts.map +1 -0
- package/dist/stages/text-webvtt-segmented/index.js +63 -0
- package/dist/stages/text-webvtt-segmented/index.js.map +1 -0
- package/dist/stages/thumbnails/index.d.ts +34 -0
- package/dist/stages/thumbnails/index.d.ts.map +1 -0
- package/dist/stages/thumbnails/index.js +58 -0
- package/dist/stages/thumbnails/index.js.map +1 -0
- package/dist/types/error.d.ts +33 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +7 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/facade.d.ts +104 -0
- package/dist/types/facade.d.ts.map +1 -0
- package/dist/types/facade.js +2 -0
- package/dist/types/facade.js.map +1 -0
- package/dist/types/ir.d.ts +238 -0
- package/dist/types/ir.d.ts.map +1 -0
- package/dist/types/ir.js +7 -0
- package/dist/types/ir.js.map +1 -0
- package/dist/types/kernel.d.ts +217 -0
- package/dist/types/kernel.d.ts.map +1 -0
- package/dist/types/kernel.js +2 -0
- package/dist/types/kernel.js.map +1 -0
- package/dist/types/messages.d.ts +288 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +2 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/quality.d.ts +108 -0
- package/dist/types/quality.d.ts.map +1 -0
- package/dist/types/quality.js +2 -0
- package/dist/types/quality.js.map +1 -0
- package/dist/types/sink.d.ts +27 -0
- package/dist/types/sink.d.ts.map +1 -0
- package/dist/types/sink.js +2 -0
- package/dist/types/sink.js.map +1 -0
- package/dist/types/stage.d.ts +139 -0
- package/dist/types/stage.d.ts.map +1 -0
- package/dist/types/stage.js +2 -0
- package/dist/types/stage.js.map +1 -0
- package/package.json +132 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The message taxonomy. Commands are rejectable intent from the consumer or
|
|
3
|
+
* a stage. Facts are the world reporting what already happened; the reducer
|
|
4
|
+
* may never reject one. Effects are inert descriptors executed outside the
|
|
5
|
+
* reducer.
|
|
6
|
+
*
|
|
7
|
+
* Commands and facts are distinguished by disjoint `type` literal unions, not
|
|
8
|
+
* by a brand field. A brand would force casts or constructors at every
|
|
9
|
+
* creation site, and the diagnostic trace must replay from plain JSON.
|
|
10
|
+
*/
|
|
11
|
+
import type { MatteboxError } from './error.js';
|
|
12
|
+
import type { ByteRange, ContentType, Presentation, Segment, TimeRangesSnapshot, TrackId } from './ir.js';
|
|
13
|
+
import type { ApplyStrategy, Constraint } from './quality.js';
|
|
14
|
+
/** Everything a sink or transform needs to know about the bytes it was handed. */
|
|
15
|
+
export interface SegmentMeta {
|
|
16
|
+
readonly trackId: TrackId;
|
|
17
|
+
readonly renditionId: string;
|
|
18
|
+
readonly contentType: ContentType;
|
|
19
|
+
readonly seq: number;
|
|
20
|
+
/** Start in presentation time, in seconds. */
|
|
21
|
+
readonly start: number;
|
|
22
|
+
readonly duration: number;
|
|
23
|
+
/** True for an init segment; `seq` is then meaningless. */
|
|
24
|
+
readonly isInit: boolean;
|
|
25
|
+
readonly discontinuity?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Data that survives structured clone: no functions, no promises, no DOM
|
|
29
|
+
* references. Effects and cue payloads are constrained to this so the
|
|
30
|
+
* reducer stays testable and the ring buffer stays dumpable.
|
|
31
|
+
*/
|
|
32
|
+
export type Serializable = string | number | boolean | null | undefined | ArrayBuffer | Uint8Array | readonly Serializable[] | {
|
|
33
|
+
readonly [key: string]: Serializable;
|
|
34
|
+
};
|
|
35
|
+
/** One parsed cue as plain data. Sinks turn these into VTTCue or metadata cues. */
|
|
36
|
+
export interface CueDescriptor {
|
|
37
|
+
readonly id?: string;
|
|
38
|
+
/** Start in presentation time, in seconds. */
|
|
39
|
+
readonly start: number;
|
|
40
|
+
readonly end: number;
|
|
41
|
+
readonly text?: string;
|
|
42
|
+
/** WebVTT cue settings, verbatim ("line:90% align:center"). The sink applies known keys. */
|
|
43
|
+
readonly settings?: string;
|
|
44
|
+
readonly payload?: Serializable;
|
|
45
|
+
}
|
|
46
|
+
/** Rejectable intent, entering through `dispatch`. */
|
|
47
|
+
export type Command = {
|
|
48
|
+
readonly type: 'ATTACH';
|
|
49
|
+
readonly element: HTMLMediaElement;
|
|
50
|
+
} | {
|
|
51
|
+
readonly type: 'DETACH';
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: 'LOAD';
|
|
54
|
+
readonly url: string;
|
|
55
|
+
readonly mimeType?: string;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: 'UNLOAD';
|
|
58
|
+
} | {
|
|
59
|
+
readonly type: 'SEEK';
|
|
60
|
+
readonly to: number;
|
|
61
|
+
} | {
|
|
62
|
+
readonly type: 'SEEK_TO_LIVE_EDGE';
|
|
63
|
+
} | {
|
|
64
|
+
readonly type: 'SELECT_TRACK';
|
|
65
|
+
readonly trackId: TrackId;
|
|
66
|
+
} | {
|
|
67
|
+
readonly type: 'DESELECT_TRACK';
|
|
68
|
+
readonly contentType: ContentType;
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: 'PIN_RENDITION';
|
|
71
|
+
readonly renditionId: string;
|
|
72
|
+
readonly apply: ApplyStrategy;
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: 'RELEASE_PIN';
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: 'CONSTRAIN';
|
|
77
|
+
readonly source: string;
|
|
78
|
+
readonly constraint: Constraint;
|
|
79
|
+
} | {
|
|
80
|
+
readonly type: 'RELEASE_CONSTRAINT';
|
|
81
|
+
readonly source: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly type: 'SET_BUFFER_GOAL';
|
|
84
|
+
readonly seconds: number;
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: 'ABORT_INFLIGHT';
|
|
87
|
+
readonly trackId?: TrackId;
|
|
88
|
+
};
|
|
89
|
+
/** The world reporting what already happened, entering through `absorb`. Never rejectable. */
|
|
90
|
+
export type Fact = {
|
|
91
|
+
readonly type: 'ELEMENT_ATTACHED';
|
|
92
|
+
readonly element: HTMLMediaElement;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: 'MEDIASOURCE_OPEN';
|
|
95
|
+
} | {
|
|
96
|
+
readonly type: 'MEDIASOURCE_CLOSED';
|
|
97
|
+
} | {
|
|
98
|
+
readonly type: 'MANIFEST_LOADED';
|
|
99
|
+
readonly presentation: Presentation;
|
|
100
|
+
} | {
|
|
101
|
+
readonly type: 'MANIFEST_FAILED';
|
|
102
|
+
readonly error: MatteboxError;
|
|
103
|
+
} | {
|
|
104
|
+
readonly type: 'PLAYLIST_REFRESHED';
|
|
105
|
+
readonly trackId: TrackId;
|
|
106
|
+
readonly renditionId?: string;
|
|
107
|
+
readonly mediaSequence: number;
|
|
108
|
+
readonly segments: readonly Segment[];
|
|
109
|
+
} | {
|
|
110
|
+
readonly type: 'SEGMENT_LOADED';
|
|
111
|
+
readonly trackId: TrackId;
|
|
112
|
+
readonly seq: number;
|
|
113
|
+
/**
|
|
114
|
+
* The fetch effect's token. The reducer matches the request by it, so
|
|
115
|
+
* a late response for an aborted request never masquerades as the
|
|
116
|
+
* refetch that replaced it (same track, same sequence, other
|
|
117
|
+
* rendition: the bytes would decode against the wrong init segment).
|
|
118
|
+
*/
|
|
119
|
+
readonly token?: string;
|
|
120
|
+
readonly bytes: ArrayBuffer;
|
|
121
|
+
readonly rtt: number;
|
|
122
|
+
readonly size: number;
|
|
123
|
+
/** Wall clock at receipt, epoch seconds. Live edge arithmetic input; the reducer never reads a clock. */
|
|
124
|
+
readonly wallClock?: number;
|
|
125
|
+
} | {
|
|
126
|
+
readonly type: 'SEGMENT_FAILED';
|
|
127
|
+
readonly trackId: TrackId;
|
|
128
|
+
readonly seq: number;
|
|
129
|
+
readonly status?: number;
|
|
130
|
+
/** The rendition the failed request belonged to, when the transport knew it. */
|
|
131
|
+
readonly renditionId?: string;
|
|
132
|
+
readonly error: MatteboxError;
|
|
133
|
+
} | {
|
|
134
|
+
readonly type: 'SOURCEBUFFER_CREATED';
|
|
135
|
+
readonly sbId: string;
|
|
136
|
+
readonly codecs: string;
|
|
137
|
+
} | {
|
|
138
|
+
readonly type: 'SOURCEBUFFER_UPDATEEND';
|
|
139
|
+
readonly sbId: string;
|
|
140
|
+
/**
|
|
141
|
+
* Snapshot of the buffer's real ranges at updateend. Browsers coalesce
|
|
142
|
+
* and round appended ranges, so state tracks what the buffer reports,
|
|
143
|
+
* not what was appended. Optional: a detach race may have no buffer
|
|
144
|
+
* left to read.
|
|
145
|
+
*/
|
|
146
|
+
readonly ranges?: TimeRangesSnapshot;
|
|
147
|
+
} | {
|
|
148
|
+
readonly type: 'SOURCEBUFFER_ERROR';
|
|
149
|
+
readonly sbId: string;
|
|
150
|
+
readonly error: MatteboxError;
|
|
151
|
+
} | {
|
|
152
|
+
readonly type: 'QUOTA_EXCEEDED';
|
|
153
|
+
readonly sbId: string;
|
|
154
|
+
} | {
|
|
155
|
+
readonly type: 'TIME_UPDATE';
|
|
156
|
+
readonly currentTime: number;
|
|
157
|
+
readonly buffered: TimeRangesSnapshot;
|
|
158
|
+
/** Wall clock at the event, epoch seconds. Slides live windows between refreshes. */
|
|
159
|
+
readonly wallClock?: number;
|
|
160
|
+
} | {
|
|
161
|
+
readonly type: 'SEEKING';
|
|
162
|
+
readonly to: number;
|
|
163
|
+
} | {
|
|
164
|
+
readonly type: 'SEEKED';
|
|
165
|
+
readonly at: number;
|
|
166
|
+
} | {
|
|
167
|
+
readonly type: 'STALLED';
|
|
168
|
+
readonly at: number;
|
|
169
|
+
} | {
|
|
170
|
+
readonly type: 'ENCRYPTED';
|
|
171
|
+
readonly initDataType: string;
|
|
172
|
+
readonly initData: ArrayBuffer;
|
|
173
|
+
} | {
|
|
174
|
+
readonly type: 'THROUGHPUT_SAMPLE';
|
|
175
|
+
readonly bps: number;
|
|
176
|
+
readonly trackId: TrackId;
|
|
177
|
+
} | {
|
|
178
|
+
readonly type: 'ENDED';
|
|
179
|
+
readonly at: number;
|
|
180
|
+
} | {
|
|
181
|
+
/** A scheduled timer fired. The kernel ignores it; slices match on their own token. */
|
|
182
|
+
readonly type: 'TICK';
|
|
183
|
+
readonly token: string;
|
|
184
|
+
/** Wall clock at firing, epoch seconds, stamped by the schedule runner. */
|
|
185
|
+
readonly wallClock?: number;
|
|
186
|
+
} | {
|
|
187
|
+
/**
|
|
188
|
+
* A live stage recomputed the availability window. `end` bounds what
|
|
189
|
+
* the scheduler may fetch; `edge` is where seekToLiveEdge lands,
|
|
190
|
+
* behind `end` by the hold-back.
|
|
191
|
+
*/
|
|
192
|
+
readonly type: 'LIVE_WINDOW_CHANGED';
|
|
193
|
+
readonly start: number;
|
|
194
|
+
readonly end: number;
|
|
195
|
+
readonly edge: number;
|
|
196
|
+
};
|
|
197
|
+
export type Message = Command | Fact;
|
|
198
|
+
/**
|
|
199
|
+
* Inert descriptors executed by the effect runner. Plain serializable data:
|
|
200
|
+
* no closures, no promises, no DOM references. Every asynchronous effect
|
|
201
|
+
* carries a `token` so its result can be correlated and `abort` can target
|
|
202
|
+
* it. An effect's outcome always re-enters as a fact, never as a command.
|
|
203
|
+
*/
|
|
204
|
+
export type Effect = {
|
|
205
|
+
readonly kind: 'fetch';
|
|
206
|
+
readonly token: string;
|
|
207
|
+
readonly url: string;
|
|
208
|
+
readonly range?: ByteRange;
|
|
209
|
+
readonly timeout?: number;
|
|
210
|
+
} | {
|
|
211
|
+
readonly kind: 'abort';
|
|
212
|
+
readonly token: string;
|
|
213
|
+
} | {
|
|
214
|
+
readonly kind: 'createSourceBuffer';
|
|
215
|
+
readonly sbId: string;
|
|
216
|
+
readonly codecs: string;
|
|
217
|
+
} | {
|
|
218
|
+
readonly kind: 'append';
|
|
219
|
+
readonly sbId: string;
|
|
220
|
+
readonly data: ArrayBuffer;
|
|
221
|
+
/**
|
|
222
|
+
* The segment's presentation start, forwarded to a media transform so
|
|
223
|
+
* a transmux step can align its baseMediaDecodeTime to the playlist
|
|
224
|
+
* timeline. Absent on CMAF appends, which run no transform.
|
|
225
|
+
*/
|
|
226
|
+
readonly start?: number;
|
|
227
|
+
/** The segment's rendition and sequence, so a transform can find its playlist entry (a key, say). */
|
|
228
|
+
readonly renditionId?: string;
|
|
229
|
+
readonly seq?: number;
|
|
230
|
+
} | {
|
|
231
|
+
readonly kind: 'remove';
|
|
232
|
+
readonly sbId: string;
|
|
233
|
+
readonly start: number;
|
|
234
|
+
readonly end: number;
|
|
235
|
+
} | {
|
|
236
|
+
readonly kind: 'changeType';
|
|
237
|
+
readonly sbId: string;
|
|
238
|
+
readonly codecs: string;
|
|
239
|
+
} | {
|
|
240
|
+
readonly kind: 'setTimestampOffset';
|
|
241
|
+
readonly sbId: string;
|
|
242
|
+
readonly offset: number;
|
|
243
|
+
} | {
|
|
244
|
+
readonly kind: 'endOfStream';
|
|
245
|
+
readonly reason?: 'network' | 'decode';
|
|
246
|
+
} | {
|
|
247
|
+
readonly kind: 'setDuration';
|
|
248
|
+
readonly seconds: number;
|
|
249
|
+
}
|
|
250
|
+
/** Publishes the live window as the element's seekable range (MSE setLiveSeekableRange). */
|
|
251
|
+
| {
|
|
252
|
+
readonly kind: 'setLiveSeekableRange';
|
|
253
|
+
readonly start: number;
|
|
254
|
+
readonly end: number;
|
|
255
|
+
} | {
|
|
256
|
+
readonly kind: 'seekElement';
|
|
257
|
+
readonly to: number;
|
|
258
|
+
} | {
|
|
259
|
+
readonly kind: 'emitCues';
|
|
260
|
+
readonly trackId: TrackId;
|
|
261
|
+
readonly cues: readonly CueDescriptor[];
|
|
262
|
+
} | {
|
|
263
|
+
/**
|
|
264
|
+
* Routes one segment's bytes through the transform pipeline into the
|
|
265
|
+
* registered sink for a cue content type. The media path appends to a
|
|
266
|
+
* SourceBuffer instead; this is its peer for text and metadata.
|
|
267
|
+
*/
|
|
268
|
+
readonly kind: 'deliver';
|
|
269
|
+
readonly trackId: TrackId;
|
|
270
|
+
readonly contentType: ContentType;
|
|
271
|
+
readonly data: ArrayBuffer;
|
|
272
|
+
readonly meta: SegmentMeta;
|
|
273
|
+
} | {
|
|
274
|
+
readonly kind: 'clearCues';
|
|
275
|
+
readonly trackId: TrackId;
|
|
276
|
+
readonly start: number;
|
|
277
|
+
readonly end: number;
|
|
278
|
+
} | {
|
|
279
|
+
readonly kind: 'schedule';
|
|
280
|
+
readonly token: string;
|
|
281
|
+
readonly delayMs: number;
|
|
282
|
+
readonly then: Message;
|
|
283
|
+
} | {
|
|
284
|
+
readonly kind: 'emit';
|
|
285
|
+
readonly event: string;
|
|
286
|
+
readonly payload: Serializable;
|
|
287
|
+
};
|
|
288
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/types/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,OAAO,EACP,kBAAkB,EAClB,OAAO,EACR,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IA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E,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,CAAC;CACzC,GACD;IACE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/types/messages.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quality selection: constraints, not a level index. A pin is a constraint
|
|
3
|
+
* whose allowed set has one member, so forcing a quality and disabling ABR
|
|
4
|
+
* are the same operation.
|
|
5
|
+
*/
|
|
6
|
+
import type { Rendition, RenditionId } from './ir.js';
|
|
7
|
+
/**
|
|
8
|
+
* A predicate over renditions. The effective allowed set is the intersection
|
|
9
|
+
* of every registered constraint; releasing one source never disturbs the
|
|
10
|
+
* others.
|
|
11
|
+
*/
|
|
12
|
+
export interface Constraint {
|
|
13
|
+
readonly maxHeight?: number;
|
|
14
|
+
readonly maxWidth?: number;
|
|
15
|
+
readonly maxBitrate?: number;
|
|
16
|
+
readonly minBitrate?: number;
|
|
17
|
+
readonly maxFrameRate?: number;
|
|
18
|
+
/** Codec allowlist, RFC 6381 strings. */
|
|
19
|
+
readonly codecs?: readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* Renditions excluded by id. The serializable exclusion the recovery and
|
|
22
|
+
* steering stages need; `filter` cannot travel in loop-back commands.
|
|
23
|
+
*/
|
|
24
|
+
readonly excludeIds?: readonly RenditionId[];
|
|
25
|
+
readonly hdr?: boolean;
|
|
26
|
+
/** Escape hatch. A constraint carrying a filter is not serializable; prefer the declarative fields. */
|
|
27
|
+
readonly filter?: (r: Rendition) => boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What the abr chooser sees. Every field derives from kernel state, so a
|
|
31
|
+
* chooser that is a pure function of its arguments keeps replay exact.
|
|
32
|
+
*/
|
|
33
|
+
export interface AbrTelemetry {
|
|
34
|
+
/** Slow throughput EWMA, bits per second. */
|
|
35
|
+
readonly throughputEwma: number;
|
|
36
|
+
/** Fast throughput EWMA; the minimum of the two is the conservative estimate. */
|
|
37
|
+
readonly throughputFastEwma?: number;
|
|
38
|
+
/** Seconds of continuous buffer ahead of the playhead for this track. */
|
|
39
|
+
readonly bufferAhead?: number;
|
|
40
|
+
/** The rendition currently being appended. */
|
|
41
|
+
readonly current?: RenditionId | null;
|
|
42
|
+
readonly currentTime: number;
|
|
43
|
+
/** The switch policy in force: the kernel default, or codec-switch's refinement. */
|
|
44
|
+
readonly canSwitchTo?: SwitchPolicy;
|
|
45
|
+
}
|
|
46
|
+
/** The optional voice. Registered by the abr stage; consulted, never trusted blindly. */
|
|
47
|
+
export interface AbrChooser {
|
|
48
|
+
choose(allowed: readonly Rendition[], telemetry: AbrTelemetry): RenditionId;
|
|
49
|
+
}
|
|
50
|
+
/** Whether a switch from one rendition to another is free, needs a changeType, or forces a reload. */
|
|
51
|
+
export type SwitchVerdict = 'seamless' | 'changeType' | 'reload';
|
|
52
|
+
/**
|
|
53
|
+
* The entanglement #2 query: codec-switch registers a real one, abr
|
|
54
|
+
* consumes whatever is in force. A pure function of its two arguments.
|
|
55
|
+
*/
|
|
56
|
+
export type SwitchPolicy = (current: Rendition | null, target: Rendition) => SwitchVerdict;
|
|
57
|
+
/**
|
|
58
|
+
* When a selection change takes effect.
|
|
59
|
+
*
|
|
60
|
+
* - 'next': at the next segment fetch. Free; latency equals buffer depth.
|
|
61
|
+
* - 'soon': abort in-flight, remove from the next safe point, refetch. Usually invisible. The default.
|
|
62
|
+
* - 'now': flush from currentTime and refetch. Visible stall of about one segment.
|
|
63
|
+
*/
|
|
64
|
+
export type ApplyStrategy = 'next' | 'soon' | 'now';
|
|
65
|
+
/** Why arbitration picked the selected rendition. */
|
|
66
|
+
export type ArbitrationReason = 'pin' | 'abr' | 'unchanged' | 'lowest-permitted';
|
|
67
|
+
/**
|
|
68
|
+
* The outcome of one arbitration pass. Arbitration never resolves to zero
|
|
69
|
+
* playable renditions: when the intersection is empty, constraints are
|
|
70
|
+
* dropped in reverse registration order until it is not, and the dropped
|
|
71
|
+
* sources are reported here.
|
|
72
|
+
*/
|
|
73
|
+
export interface ArbitrationResult {
|
|
74
|
+
readonly allowed: readonly RenditionId[];
|
|
75
|
+
readonly droppedConstraints: readonly string[];
|
|
76
|
+
readonly selected: RenditionId | null;
|
|
77
|
+
readonly reason: ArbitrationReason;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The public quality surface. No sentinels; all plain getters.
|
|
81
|
+
*
|
|
82
|
+
* `active` and `playing` are distinct on purpose. After a 'next' switch the
|
|
83
|
+
* engine appends the new rendition while the viewer still watches buffered
|
|
84
|
+
* media from the old one. A quality menu must tick `playing`, not `active`.
|
|
85
|
+
*/
|
|
86
|
+
export interface QualityApi {
|
|
87
|
+
/** Everything the manifest declared. */
|
|
88
|
+
readonly renditions: readonly Rendition[];
|
|
89
|
+
/** After constraint intersection. */
|
|
90
|
+
readonly allowed: readonly Rendition[];
|
|
91
|
+
/** The rendition currently being appended. */
|
|
92
|
+
readonly active: Rendition | null;
|
|
93
|
+
/** The rendition decoding at currentTime right now. */
|
|
94
|
+
readonly playing: Rendition | null;
|
|
95
|
+
readonly pinned: RenditionId | null;
|
|
96
|
+
readonly constraints: ReadonlyMap<string, Constraint>;
|
|
97
|
+
/** Registers or replaces the constraint for `source`. */
|
|
98
|
+
constrain(source: string, constraint: Constraint): void;
|
|
99
|
+
/** Removes the constraint for `source`. */
|
|
100
|
+
release(source: string): void;
|
|
101
|
+
/** Pins one rendition. Defaults to `{ apply: 'soon' }`. */
|
|
102
|
+
pin(renditionId: RenditionId, options?: {
|
|
103
|
+
readonly apply?: ApplyStrategy;
|
|
104
|
+
}): void;
|
|
105
|
+
/** Clears the pin; ABR resumes if loaded. */
|
|
106
|
+
auto(): void;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=quality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quality.d.ts","sourceRoot":"","sources":["../../src/types/quality.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,yCAAyC;IACz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ink contract. The scheduler is written against generic tracks and
|
|
3
|
+
* does not know that SourceBuffers are the only possible destination; text
|
|
4
|
+
* and metadata are pipelines beside audio and video, not post-processing.
|
|
5
|
+
* This interface exists before any scheduler work on purpose: retrofitting
|
|
6
|
+
* it is a rewrite.
|
|
7
|
+
*/
|
|
8
|
+
import type { ContentType, TimeRangesSnapshot, TrackId } from './ir.js';
|
|
9
|
+
import type { Effect, SegmentMeta } from './messages.js';
|
|
10
|
+
export type { SegmentMeta } from './messages.js';
|
|
11
|
+
/**
|
|
12
|
+
* A destination for scheduled media. Sinks return effects rather than acting
|
|
13
|
+
* directly so the append path stays inside the effect runner.
|
|
14
|
+
*
|
|
15
|
+
* The `ContentType` parameter ties a sink to the content type it was
|
|
16
|
+
* registered for, so a text sink cannot be registered under 'video'.
|
|
17
|
+
*/
|
|
18
|
+
export interface Sink<C extends ContentType = ContentType> {
|
|
19
|
+
readonly contentType: C;
|
|
20
|
+
/** Accepts one segment's bytes and returns the effects that deliver them. */
|
|
21
|
+
accept(trackId: TrackId, data: ArrayBuffer, meta: SegmentMeta): readonly Effect[];
|
|
22
|
+
/** What this sink currently holds for the track, in presentation time. */
|
|
23
|
+
ranges(trackId: TrackId): TimeRangesSnapshot;
|
|
24
|
+
/** Returns the effects that discard the given window. */
|
|
25
|
+
clear(trackId: TrackId, start: number, end: number): readonly Effect[];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=sink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sink.d.ts","sourceRoot":"","sources":["../../src/types/sink.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIzD,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IACvD,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;IACxB,6EAA6E;IAC7E,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,MAAM,EAAE,CAAC;IAClF,0EAA0E;IAC1E,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAAC;IAC7C,yDAAyD;IACzD,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sink.js","sourceRoot":"","sources":["../../src/types/sink.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stage contract: the public plugin API. Four hook types express every
|
|
3
|
+
* stage in the catalogue: sinks, parsers, transforms, and namespaces.
|
|
4
|
+
*
|
|
5
|
+
* Stages are inert. A stage module exports a factory; nothing registers at
|
|
6
|
+
* import time. Any top-level side effect makes `sideEffects: false` a lie.
|
|
7
|
+
*/
|
|
8
|
+
import type { ContentType } from './ir.js';
|
|
9
|
+
import type { KernelState, SliceReducer } from './kernel.js';
|
|
10
|
+
import type { Command, CueDescriptor } from './messages.js';
|
|
11
|
+
import type { AbrChooser, SwitchPolicy } from './quality.js';
|
|
12
|
+
import type { SegmentMeta, Sink } from './sink.js';
|
|
13
|
+
/** Returned by `install` to undo everything the stage did. Called in reverse install order on detach. */
|
|
14
|
+
export type Teardown = () => void;
|
|
15
|
+
/** Reads a full SourceBuffer type, `video/mp4; codecs="..."`, from init segment bytes; null when it cannot. */
|
|
16
|
+
export type TypeProbe = (bytes: Uint8Array) => string | null;
|
|
17
|
+
/** The mutable outgoing-request view request hooks receive; url, headers, and timeout are writable. */
|
|
18
|
+
export interface TransportRequestDraftView {
|
|
19
|
+
url: string;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
timeoutMs: number | null;
|
|
22
|
+
readonly token: string;
|
|
23
|
+
readonly attempt: number;
|
|
24
|
+
}
|
|
25
|
+
export type Unsubscribe = () => void;
|
|
26
|
+
export type Listener = (payload: unknown) => void;
|
|
27
|
+
/** A `{ contentType, mimeType }` pair a stage can handle. */
|
|
28
|
+
export interface CapabilityDescriptor {
|
|
29
|
+
readonly contentType: ContentType;
|
|
30
|
+
readonly mimeType: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What a stage offers: a named capability such as 'live', a manifest MIME
|
|
34
|
+
* type such as 'application/dash+xml' (any string containing '/'), or a
|
|
35
|
+
* content handler pair. A manifest type makes `engine.accepts` answer true
|
|
36
|
+
* and lets a `load` with that `mimeType` reach the stage's parser.
|
|
37
|
+
*/
|
|
38
|
+
export type Capability = string | CapabilityDescriptor;
|
|
39
|
+
/** What a registered sink factory receives when the kernel instantiates it. */
|
|
40
|
+
export interface SinkInit {
|
|
41
|
+
readonly element: HTMLMediaElement;
|
|
42
|
+
}
|
|
43
|
+
export type SinkFactory<C extends ContentType = ContentType> = (init: SinkInit) => Sink<C>;
|
|
44
|
+
/** Parses one segment's bytes into cues. Registered per mimeType. */
|
|
45
|
+
export type ParserFn = (data: Uint8Array, meta: SegmentMeta) => readonly CueDescriptor[];
|
|
46
|
+
/**
|
|
47
|
+
* One step of the segment byte pipeline. Transforms form an explicitly
|
|
48
|
+
* ordered pipeline, not opportunistic listeners: decrypt then demux then
|
|
49
|
+
* caption-extract has real ordering constraints. Lower `order` runs first.
|
|
50
|
+
*/
|
|
51
|
+
export interface TransformStep {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly order: number;
|
|
54
|
+
transform(data: Uint8Array, meta: SegmentMeta): Uint8Array | Promise<Uint8Array>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* What a stage receives at install time. Everything a stage does to the
|
|
58
|
+
* engine goes through this context; stages never import each other.
|
|
59
|
+
*/
|
|
60
|
+
export interface StageContext {
|
|
61
|
+
/** The attached media element. */
|
|
62
|
+
readonly element: HTMLMediaElement;
|
|
63
|
+
/**
|
|
64
|
+
* Registers the destination for a content type. The factory's sink must
|
|
65
|
+
* declare the same content type, which is what makes registration
|
|
66
|
+
* type-safe per content type. NoInfer pins the type parameter to the
|
|
67
|
+
* `contentType` argument, so a mismatched factory fails instead of
|
|
68
|
+
* widening the inference to a union.
|
|
69
|
+
*/
|
|
70
|
+
registerSink<C extends ContentType>(contentType: C, factory: SinkFactory<NoInfer<C>>): void;
|
|
71
|
+
registerParser(mimeType: string, parse: ParserFn): void;
|
|
72
|
+
registerTransform(step: TransformStep): void;
|
|
73
|
+
/**
|
|
74
|
+
* Exposes a public API surface as `engine.<name>`. Typing on the facade
|
|
75
|
+
* comes from merging the `MatteboxNamespaces` interface declared in the
|
|
76
|
+
* package entry; this call itself is untyped because the stage layer sits
|
|
77
|
+
* below the facade in the module graph.
|
|
78
|
+
*/
|
|
79
|
+
registerNamespace(name: string, api: object): void;
|
|
80
|
+
/** A read-only snapshot of kernel state, for namespace getters. Reducers receive state as an argument; this is for the impure side. */
|
|
81
|
+
getState(): Readonly<KernelState>;
|
|
82
|
+
/**
|
|
83
|
+
* Observes and may rewrite outgoing requests (the draft's url, headers,
|
|
84
|
+
* and timeout are mutable). Steering and cmcd live here. Unregistered
|
|
85
|
+
* with the stage.
|
|
86
|
+
*/
|
|
87
|
+
addRequestHook(hook: (req: TransportRequestDraftView) => void): Unsubscribe;
|
|
88
|
+
/**
|
|
89
|
+
* A one-off network request through the transport's request hooks and
|
|
90
|
+
* fetchImpl, for license and steering fetches. Awaits the Response.
|
|
91
|
+
*/
|
|
92
|
+
request(url: string, init: {
|
|
93
|
+
method?: string;
|
|
94
|
+
headers?: Record<string, string>;
|
|
95
|
+
body?: ArrayBuffer | Uint8Array | string;
|
|
96
|
+
}): Promise<Response>;
|
|
97
|
+
/**
|
|
98
|
+
* Registers the abr opinion consulted at arbitration step 5. One chooser
|
|
99
|
+
* per composition; a second registration is a composition error. The
|
|
100
|
+
* chooser must be a pure function of its arguments or replay breaks.
|
|
101
|
+
*/
|
|
102
|
+
registerChooser(chooser: AbrChooser): void;
|
|
103
|
+
/**
|
|
104
|
+
* Registers the switch policy consulted before a rendition change (the
|
|
105
|
+
* entanglement #2 query). One per composition; codec-switch provides it.
|
|
106
|
+
*/
|
|
107
|
+
registerSwitchPolicy(policy: SwitchPolicy): void;
|
|
108
|
+
/**
|
|
109
|
+
* Registers the reader of SourceBuffer types from init bytes, consulted
|
|
110
|
+
* when a rendition declares no codecs (a bare media playlist): buffer
|
|
111
|
+
* creation waits for the first segment and takes its type from what the
|
|
112
|
+
* probe reads. One per composition; codec-probe provides it.
|
|
113
|
+
*/
|
|
114
|
+
registerTypeProbe(probe: TypeProbe): void;
|
|
115
|
+
/** Contributes a named state slice. The reducer receives only that slice plus a read-only kernel view. */
|
|
116
|
+
reduce<S>(slice: string, reducer: SliceReducer<S>): void;
|
|
117
|
+
dispatch(cmd: Command): void;
|
|
118
|
+
/** Broadcasts an engine event, symmetric to `on`. The impure edge of a stage (eme-core) reports through it. */
|
|
119
|
+
emit(event: string, payload: unknown): void;
|
|
120
|
+
on(event: string, fn: Listener): Unsubscribe;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* One entry in a stage's `requires`. A plain string is a hard dependency. An
|
|
124
|
+
* array is a set of alternatives: the composition satisfies it if any one of
|
|
125
|
+
* them is present. text-cea608 requires its SEI source as
|
|
126
|
+
* `['ts-transmux', 'nal-scan']`, either of which supplies the caption bytes.
|
|
127
|
+
*/
|
|
128
|
+
export type Requirement = string | readonly string[];
|
|
129
|
+
/**
|
|
130
|
+
* A stage. `requires` names other stages or layer-2 modules resolved by the
|
|
131
|
+
* loader; cross-stage needs are expressed here, never as imports.
|
|
132
|
+
*/
|
|
133
|
+
export interface Stage {
|
|
134
|
+
readonly name: string;
|
|
135
|
+
readonly provides?: readonly Capability[];
|
|
136
|
+
readonly requires?: readonly Requirement[];
|
|
137
|
+
install(ctx: StageContext): void | Teardown;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/types/stage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEnD,yGAAyG;AACzG,MAAM,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC;AAElC,+GAA+G;AAC/G,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,GAAG,IAAI,CAAC;AAE7D,uGAAuG;AACvG,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAElD,6DAA6D;AAC7D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EA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