mattebox 0.10.0 → 0.12.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/README.md +1 -1
- package/dist/cdn/mattebox.dash-drm.min.js +3 -3
- package/dist/cdn/mattebox.dash.min.js +3 -3
- package/dist/cdn/mattebox.dual-drm.min.js +3 -3
- package/dist/cdn/mattebox.dual-ts-drm.min.js +3 -3
- package/dist/cdn/mattebox.dual-ts.min.js +3 -3
- package/dist/cdn/mattebox.dual.min.js +3 -3
- package/dist/cdn/mattebox.hls-drm.min.js +3 -3
- package/dist/cdn/mattebox.hls-ts-drm.min.js +3 -3
- package/dist/cdn/mattebox.hls-ts.min.js +3 -3
- package/dist/cdn/mattebox.hls.min.js +3 -3
- package/dist/cdn/mattebox.kernel.min.js +1 -1
- package/dist/cdn/mattebox.min.js +6 -2
- package/dist/containers/captions.d.ts +6 -5
- package/dist/containers/captions.d.ts.map +1 -1
- package/dist/containers/captions.js +9 -9
- package/dist/containers/captions.js.map +1 -1
- package/dist/containers/codec-probe/index.d.ts +15 -0
- package/dist/containers/codec-probe/index.d.ts.map +1 -1
- package/dist/containers/codec-probe/index.js +72 -5
- package/dist/containers/codec-probe/index.js.map +1 -1
- package/dist/containers/emsg.d.ts +15 -0
- package/dist/containers/emsg.d.ts.map +1 -0
- package/dist/containers/emsg.js +91 -0
- package/dist/containers/emsg.js.map +1 -0
- package/dist/containers/id3.d.ts +12 -0
- package/dist/containers/id3.d.ts.map +1 -1
- package/dist/containers/id3.js +53 -4
- package/dist/containers/id3.js.map +1 -1
- package/dist/containers/metadata.d.ts +18 -0
- package/dist/containers/metadata.d.ts.map +1 -0
- package/dist/containers/metadata.js +20 -0
- package/dist/containers/metadata.js.map +1 -0
- package/dist/containers/mp4-box/index.d.ts +16 -0
- package/dist/containers/mp4-box/index.d.ts.map +1 -1
- package/dist/containers/mp4-box/index.js +28 -0
- package/dist/containers/mp4-box/index.js.map +1 -1
- package/dist/containers/scte35.d.ts +12 -0
- package/dist/containers/scte35.d.ts.map +1 -0
- package/dist/containers/scte35.js +116 -0
- package/dist/containers/scte35.js.map +1 -0
- package/dist/containers/ts-transmux/demux.d.ts +2 -2
- package/dist/containers/ts-transmux/demux.d.ts.map +1 -1
- package/dist/containers/ts-transmux/demux.js +2 -18
- package/dist/containers/ts-transmux/demux.js.map +1 -1
- package/dist/containers/ts-transmux/index.d.ts.map +1 -1
- package/dist/containers/ts-transmux/index.js +14 -3
- package/dist/containers/ts-transmux/index.js.map +1 -1
- package/dist/containers/ts-transmux/module.d.ts +8 -0
- package/dist/containers/ts-transmux/module.d.ts.map +1 -0
- package/dist/containers/ts-transmux/module.js +8 -0
- package/dist/containers/ts-transmux/module.js.map +1 -0
- package/dist/containers/ts-transmux/runner.d.ts +20 -8
- package/dist/containers/ts-transmux/runner.d.ts.map +1 -1
- package/dist/containers/ts-transmux/runner.js +19 -22
- package/dist/containers/ts-transmux/runner.js.map +1 -1
- package/dist/containers/ts-transmux/serve.d.ts +35 -0
- package/dist/containers/ts-transmux/serve.d.ts.map +1 -0
- package/dist/containers/ts-transmux/serve.js +33 -0
- package/dist/containers/ts-transmux/serve.js.map +1 -0
- package/dist/containers/ts-transmux/sniff.d.ts +11 -0
- package/dist/containers/ts-transmux/sniff.d.ts.map +1 -0
- package/dist/containers/ts-transmux/sniff.js +25 -0
- package/dist/containers/ts-transmux/sniff.js.map +1 -0
- package/dist/containers/ts-transmux/source.d.ts +10 -0
- package/dist/containers/ts-transmux/source.d.ts.map +1 -0
- package/dist/containers/ts-transmux/source.js +5 -0
- package/dist/containers/ts-transmux/source.js.map +1 -0
- package/dist/containers/ts-transmux/transmux.d.ts +19 -1
- package/dist/containers/ts-transmux/transmux.d.ts.map +1 -1
- package/dist/containers/ts-transmux/transmux.js +46 -7
- package/dist/containers/ts-transmux/transmux.js.map +1 -1
- package/dist/containers/ts-transmux/transmux.worker.js +7 -28
- package/dist/containers/ts-transmux/transmux.worker.js.map +1 -1
- package/dist/containers/webvtt.d.ts +2 -0
- package/dist/containers/webvtt.d.ts.map +1 -1
- package/dist/containers/webvtt.js +4 -0
- package/dist/containers/webvtt.js.map +1 -1
- package/dist/containers/wvtt.d.ts +12 -0
- package/dist/containers/wvtt.d.ts.map +1 -0
- package/dist/containers/wvtt.js +46 -0
- package/dist/containers/wvtt.js.map +1 -0
- package/dist/eme/index.d.ts +34 -0
- package/dist/eme/index.d.ts.map +1 -0
- package/dist/eme/index.js +75 -0
- package/dist/eme/index.js.map +1 -0
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/asyncToGenerator.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectSpread2.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectWithoutProperties.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/objectWithoutPropertiesLoose.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/es2015/_virtual/{_@oxc-project_runtime@0.151.0 → _@oxc-project_runtime@0.152.0}/helpers/esm/typeof.js +1 -1
- package/dist/es2015/containers/captions.js +8 -8
- package/dist/es2015/containers/codec-probe/index.js +105 -6
- package/dist/es2015/containers/emsg.js +81 -0
- package/dist/es2015/containers/id3.js +54 -4
- package/dist/es2015/containers/metadata.js +20 -0
- package/dist/es2015/containers/mp4-box/index.js +27 -1
- package/dist/es2015/containers/scte35.js +114 -0
- package/dist/es2015/containers/ts-transmux/demux.js +12 -24
- package/dist/es2015/containers/ts-transmux/h264.js +1 -1
- package/dist/es2015/containers/ts-transmux/index.js +12 -4
- package/dist/es2015/containers/ts-transmux/runner.js +34 -27
- package/dist/es2015/containers/ts-transmux/serve.js +36 -0
- package/dist/es2015/containers/ts-transmux/sniff.js +13 -0
- package/dist/es2015/containers/ts-transmux/source.js +7 -0
- package/dist/es2015/containers/ts-transmux/transmux.js +42 -8
- package/dist/es2015/containers/ts-transmux/transmux.worker.js +7 -26
- package/dist/es2015/containers/webvtt.js +6 -2
- package/dist/es2015/containers/wvtt.js +40 -0
- package/dist/es2015/eme/index.js +79 -0
- package/dist/es2015/index.js +63 -27
- package/dist/es2015/kernel/append-queue.js +1 -1
- package/dist/es2015/kernel/base64.js +14 -3
- package/dist/es2015/kernel/bus.js +11 -8
- package/dist/es2015/kernel/context.js +5 -0
- package/dist/es2015/kernel/lifecycle.js +1 -0
- package/dist/es2015/kernel/loader.js +2 -2
- package/dist/es2015/kernel/mime.js +12 -1
- package/dist/es2015/kernel/mse.js +47 -6
- package/dist/es2015/kernel/prepare.js +2 -2
- package/dist/es2015/kernel/reducer.js +83 -26
- package/dist/es2015/kernel/refresh.js +2 -2
- package/dist/es2015/kernel/rendition-select.js +91 -16
- package/dist/es2015/kernel/scheduler.js +1 -1
- package/dist/es2015/kernel/sinks/caption-tracks.js +82 -0
- package/dist/es2015/kernel/sinks/native-sync.js +46 -0
- package/dist/es2015/kernel/sinks/text-formats.js +64 -0
- package/dist/es2015/kernel/sinks/text-track-sink.js +15 -4
- package/dist/es2015/kernel/timeline.js +12 -8
- package/dist/es2015/kernel/trace.js +1 -1
- package/dist/es2015/kernel/track-registry.js +6 -3
- package/dist/es2015/kernel/transport.js +34 -7
- package/dist/es2015/presets/define.js +2 -2
- package/dist/es2015/presets/full/index.js +22 -2
- package/dist/es2015/protocols/dash-cmaf/index.js +61 -14
- package/dist/es2015/protocols/dash-cmaf/parse.js +421 -121
- package/dist/es2015/protocols/dash-cmaf/periods-runtime.js +134 -0
- package/dist/es2015/protocols/dash-cmaf/periods.js +178 -0
- package/dist/es2015/protocols/dash-live/index.js +1 -1
- package/dist/es2015/protocols/hls-cmaf/index.js +41 -17
- package/dist/es2015/protocols/hls-cmaf/lexer.js +2 -1
- package/dist/es2015/protocols/hls-cmaf/parse.js +161 -39
- package/dist/es2015/protocols/hls-cmaf/unavailable.js +37 -6
- package/dist/es2015/protocols/hls-live/index.js +36 -10
- package/dist/es2015/stages/abr/index.js +18 -7
- package/dist/es2015/stages/abr-persist/index.js +1 -1
- package/dist/es2015/stages/aes-128/index.js +1 -1
- package/dist/es2015/stages/alt-audio/index.js +7 -5
- package/dist/es2015/stages/chapters/index.js +2 -2
- package/dist/es2015/stages/chapters/parse.js +2 -2
- package/dist/es2015/stages/cmcd/index.js +30 -3
- package/dist/es2015/stages/cmsd/index.js +72 -0
- package/dist/es2015/stages/codec-probe/index.js +28 -3
- package/dist/es2015/stages/content-steering/index.js +1 -1
- package/dist/es2015/stages/eme-core/index.js +31 -7
- package/dist/es2015/stages/eme-fairplay/index.js +18 -9
- package/dist/es2015/stages/hdr/index.js +214 -0
- package/dist/es2015/stages/meta-id3/index.js +6 -1
- package/dist/es2015/stages/qoe/index.js +111 -0
- package/dist/es2015/stages/recovery/index.js +1 -1
- package/dist/es2015/stages/rendition-names/index.js +101 -0
- package/dist/es2015/stages/text-cea608/decode.js +57 -6
- package/dist/es2015/stages/text-cea608/index.js +26 -93
- package/dist/es2015/stages/text-cea708/decode.js +379 -0
- package/dist/es2015/stages/text-cea708/index.js +98 -0
- package/dist/es2015/stages/text-ttml/index.js +88 -0
- package/dist/es2015/stages/text-ttml/parse.js +255 -0
- package/dist/es2015/stages/text-webvtt/index.js +30 -65
- package/dist/es2015/stages/thumbnails/index.js +1 -1
- package/dist/es2015/stages/timed-metadata/index.js +331 -0
- package/dist/es2015/stages/trick-play/index.js +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -19
- package/dist/index.js.map +1 -1
- package/dist/kernel/base64.d.ts +7 -2
- package/dist/kernel/base64.d.ts.map +1 -1
- package/dist/kernel/base64.js +14 -2
- package/dist/kernel/base64.js.map +1 -1
- package/dist/kernel/bus.d.ts.map +1 -1
- package/dist/kernel/bus.js +12 -9
- package/dist/kernel/bus.js.map +1 -1
- package/dist/kernel/context.d.ts +3 -1
- package/dist/kernel/context.d.ts.map +1 -1
- package/dist/kernel/context.js +5 -0
- package/dist/kernel/context.js.map +1 -1
- package/dist/kernel/lifecycle.d.ts +3 -1
- package/dist/kernel/lifecycle.d.ts.map +1 -1
- package/dist/kernel/lifecycle.js +1 -0
- package/dist/kernel/lifecycle.js.map +1 -1
- package/dist/kernel/loader.d.ts.map +1 -1
- package/dist/kernel/loader.js +3 -2
- package/dist/kernel/loader.js.map +1 -1
- package/dist/kernel/mime.d.ts +7 -0
- package/dist/kernel/mime.d.ts.map +1 -1
- package/dist/kernel/mime.js +12 -0
- package/dist/kernel/mime.js.map +1 -1
- package/dist/kernel/mse.d.ts.map +1 -1
- package/dist/kernel/mse.js +47 -3
- package/dist/kernel/mse.js.map +1 -1
- package/dist/kernel/reducer.d.ts.map +1 -1
- package/dist/kernel/reducer.js +88 -12
- package/dist/kernel/reducer.js.map +1 -1
- package/dist/kernel/refresh.d.ts.map +1 -1
- package/dist/kernel/refresh.js +1 -0
- package/dist/kernel/refresh.js.map +1 -1
- package/dist/kernel/rendition-select.d.ts +29 -1
- package/dist/kernel/rendition-select.d.ts.map +1 -1
- package/dist/kernel/rendition-select.js +99 -21
- package/dist/kernel/rendition-select.js.map +1 -1
- package/dist/kernel/sinks/caption-tracks.d.ts +11 -0
- package/dist/kernel/sinks/caption-tracks.d.ts.map +1 -0
- package/dist/kernel/sinks/caption-tracks.js +87 -0
- package/dist/kernel/sinks/caption-tracks.js.map +1 -0
- package/dist/kernel/sinks/native-sync.d.ts +24 -0
- package/dist/kernel/sinks/native-sync.d.ts.map +1 -0
- package/dist/kernel/sinks/native-sync.js +42 -0
- package/dist/kernel/sinks/native-sync.js.map +1 -0
- package/dist/kernel/sinks/text-formats.d.ts +25 -0
- package/dist/kernel/sinks/text-formats.d.ts.map +1 -0
- package/dist/kernel/sinks/text-formats.js +69 -0
- package/dist/kernel/sinks/text-formats.js.map +1 -0
- package/dist/kernel/sinks/text-track-sink.d.ts.map +1 -1
- package/dist/kernel/sinks/text-track-sink.js +22 -4
- package/dist/kernel/sinks/text-track-sink.js.map +1 -1
- package/dist/kernel/timeline.d.ts +10 -6
- package/dist/kernel/timeline.d.ts.map +1 -1
- package/dist/kernel/timeline.js +14 -6
- package/dist/kernel/timeline.js.map +1 -1
- package/dist/kernel/track-registry.d.ts +2 -2
- package/dist/kernel/track-registry.d.ts.map +1 -1
- package/dist/kernel/track-registry.js +5 -3
- package/dist/kernel/track-registry.js.map +1 -1
- package/dist/kernel/transport.d.ts +8 -0
- package/dist/kernel/transport.d.ts.map +1 -1
- package/dist/kernel/transport.js +28 -1
- package/dist/kernel/transport.js.map +1 -1
- package/dist/presets/full/index.d.ts.map +1 -1
- package/dist/presets/full/index.js +21 -1
- package/dist/presets/full/index.js.map +1 -1
- package/dist/protocols/adapter-shared.d.ts +8 -0
- package/dist/protocols/adapter-shared.d.ts.map +1 -1
- package/dist/protocols/adapter-shared.js +6 -0
- package/dist/protocols/adapter-shared.js.map +1 -1
- package/dist/protocols/dash-cmaf/index.d.ts +9 -1
- package/dist/protocols/dash-cmaf/index.d.ts.map +1 -1
- package/dist/protocols/dash-cmaf/index.js +78 -14
- package/dist/protocols/dash-cmaf/index.js.map +1 -1
- package/dist/protocols/dash-cmaf/parse.d.ts.map +1 -1
- package/dist/protocols/dash-cmaf/parse.js +430 -94
- package/dist/protocols/dash-cmaf/parse.js.map +1 -1
- package/dist/protocols/dash-cmaf/periods-runtime.d.ts +6 -0
- package/dist/protocols/dash-cmaf/periods-runtime.d.ts.map +1 -0
- package/dist/protocols/dash-cmaf/periods-runtime.js +121 -0
- package/dist/protocols/dash-cmaf/periods-runtime.js.map +1 -0
- package/dist/protocols/dash-cmaf/periods.d.ts +24 -0
- package/dist/protocols/dash-cmaf/periods.d.ts.map +1 -0
- package/dist/protocols/dash-cmaf/periods.js +210 -0
- package/dist/protocols/dash-cmaf/periods.js.map +1 -0
- package/dist/protocols/hls-cmaf/index.d.ts +9 -1
- package/dist/protocols/hls-cmaf/index.d.ts.map +1 -1
- package/dist/protocols/hls-cmaf/index.js +49 -20
- package/dist/protocols/hls-cmaf/index.js.map +1 -1
- package/dist/protocols/hls-cmaf/lexer.d.ts.map +1 -1
- package/dist/protocols/hls-cmaf/lexer.js +1 -0
- package/dist/protocols/hls-cmaf/lexer.js.map +1 -1
- package/dist/protocols/hls-cmaf/parse.d.ts +3 -1
- package/dist/protocols/hls-cmaf/parse.d.ts.map +1 -1
- package/dist/protocols/hls-cmaf/parse.js +208 -24
- package/dist/protocols/hls-cmaf/parse.js.map +1 -1
- package/dist/protocols/hls-cmaf/unavailable.d.ts +9 -1
- package/dist/protocols/hls-cmaf/unavailable.d.ts.map +1 -1
- package/dist/protocols/hls-cmaf/unavailable.js +29 -3
- package/dist/protocols/hls-cmaf/unavailable.js.map +1 -1
- package/dist/protocols/hls-live/index.d.ts +9 -1
- package/dist/protocols/hls-live/index.d.ts.map +1 -1
- package/dist/protocols/hls-live/index.js +36 -7
- package/dist/protocols/hls-live/index.js.map +1 -1
- package/dist/stages/abr/index.d.ts.map +1 -1
- package/dist/stages/abr/index.js +24 -8
- package/dist/stages/abr/index.js.map +1 -1
- package/dist/stages/alt-audio/index.d.ts +3 -1
- package/dist/stages/alt-audio/index.d.ts.map +1 -1
- package/dist/stages/alt-audio/index.js +8 -5
- package/dist/stages/alt-audio/index.js.map +1 -1
- package/dist/stages/cmcd/index.d.ts.map +1 -1
- package/dist/stages/cmcd/index.js +39 -3
- package/dist/stages/cmcd/index.js.map +1 -1
- package/dist/stages/cmsd/index.d.ts +22 -0
- package/dist/stages/cmsd/index.d.ts.map +1 -0
- package/dist/stages/cmsd/index.js +65 -0
- package/dist/stages/cmsd/index.js.map +1 -0
- package/dist/stages/codec-probe/index.d.ts.map +1 -1
- package/dist/stages/codec-probe/index.js +30 -3
- package/dist/stages/codec-probe/index.js.map +1 -1
- package/dist/stages/eme-core/index.d.ts +14 -0
- package/dist/stages/eme-core/index.d.ts.map +1 -1
- package/dist/stages/eme-core/index.js +38 -5
- package/dist/stages/eme-core/index.js.map +1 -1
- package/dist/stages/eme-fairplay/index.d.ts +5 -0
- package/dist/stages/eme-fairplay/index.d.ts.map +1 -1
- package/dist/stages/eme-fairplay/index.js +17 -6
- package/dist/stages/eme-fairplay/index.js.map +1 -1
- package/dist/stages/hdr/index.d.ts +22 -0
- package/dist/stages/hdr/index.d.ts.map +1 -0
- package/dist/stages/hdr/index.js +191 -0
- package/dist/stages/hdr/index.js.map +1 -0
- package/dist/stages/meta-id3/index.d.ts.map +1 -1
- package/dist/stages/meta-id3/index.js +6 -2
- package/dist/stages/meta-id3/index.js.map +1 -1
- package/dist/stages/qoe/index.d.ts +32 -0
- package/dist/stages/qoe/index.d.ts.map +1 -0
- package/dist/stages/qoe/index.js +116 -0
- package/dist/stages/qoe/index.js.map +1 -0
- package/dist/stages/rendition-names/index.d.ts +41 -0
- package/dist/stages/rendition-names/index.d.ts.map +1 -0
- package/dist/stages/rendition-names/index.js +101 -0
- package/dist/stages/rendition-names/index.js.map +1 -0
- package/dist/stages/text-cea608/decode.d.ts +23 -2
- package/dist/stages/text-cea608/decode.d.ts.map +1 -1
- package/dist/stages/text-cea608/decode.js +59 -6
- package/dist/stages/text-cea608/decode.js.map +1 -1
- package/dist/stages/text-cea608/index.d.ts +9 -9
- package/dist/stages/text-cea608/index.d.ts.map +1 -1
- package/dist/stages/text-cea608/index.js +31 -105
- package/dist/stages/text-cea608/index.js.map +1 -1
- package/dist/stages/text-cea708/decode.d.ts +79 -0
- package/dist/stages/text-cea708/decode.d.ts.map +1 -0
- package/dist/stages/text-cea708/decode.js +410 -0
- package/dist/stages/text-cea708/decode.js.map +1 -0
- package/dist/stages/text-cea708/index.d.ts +3 -0
- package/dist/stages/text-cea708/index.d.ts.map +1 -0
- package/dist/stages/text-cea708/index.js +93 -0
- package/dist/stages/text-cea708/index.js.map +1 -0
- package/dist/stages/text-ttml/index.d.ts +3 -0
- package/dist/stages/text-ttml/index.d.ts.map +1 -0
- package/dist/stages/text-ttml/index.js +74 -0
- package/dist/stages/text-ttml/index.js.map +1 -0
- package/dist/stages/text-ttml/parse.d.ts +16 -0
- package/dist/stages/text-ttml/parse.d.ts.map +1 -0
- package/dist/stages/text-ttml/parse.js +277 -0
- package/dist/stages/text-ttml/parse.js.map +1 -0
- package/dist/stages/text-webvtt/index.d.ts +6 -13
- package/dist/stages/text-webvtt/index.d.ts.map +1 -1
- package/dist/stages/text-webvtt/index.js +21 -68
- package/dist/stages/text-webvtt/index.js.map +1 -1
- package/dist/stages/timed-metadata/index.d.ts +15 -0
- package/dist/stages/timed-metadata/index.d.ts.map +1 -0
- package/dist/stages/timed-metadata/index.js +370 -0
- package/dist/stages/timed-metadata/index.js.map +1 -0
- package/dist/types/error.d.ts +1 -1
- package/dist/types/error.d.ts.map +1 -1
- package/dist/types/facade.d.ts +8 -10
- package/dist/types/facade.d.ts.map +1 -1
- package/dist/types/ir.d.ts +90 -0
- package/dist/types/ir.d.ts.map +1 -1
- package/dist/types/kernel.d.ts +8 -0
- package/dist/types/kernel.d.ts.map +1 -1
- package/dist/types/messages.d.ts +10 -1
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/types/metadata.d.ts +59 -0
- package/dist/types/metadata.d.ts.map +1 -0
- package/dist/types/metadata.js +7 -0
- package/dist/types/metadata.js.map +1 -0
- package/dist/types/quality.d.ts +10 -0
- package/dist/types/quality.d.ts.map +1 -1
- package/dist/types/stage.d.ts +17 -0
- package/dist/types/stage.d.ts.map +1 -1
- package/package.json +10 -2
|
@@ -1,9 +1,63 @@
|
|
|
1
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { byteToHex } from "../../kernel/base64.js";
|
|
2
3
|
import { resolveUrl } from "../../kernel/url.js";
|
|
3
4
|
import { manifestError } from "../adapter-shared.js";
|
|
4
5
|
import { dimensions } from "../dimensions.js";
|
|
5
6
|
import { lex } from "./lexer.js";
|
|
6
7
|
//#region src/protocols/hls-cmaf/parse.ts
|
|
8
|
+
/**
|
|
9
|
+
* m3u8 into the IR. Pure: no fetching, no state, no side effects. URLs are
|
|
10
|
+
* resolved here, against the playlist's own URL, and stored absolute;
|
|
11
|
+
* downstream code never does URL arithmetic.
|
|
12
|
+
*
|
|
13
|
+
* The HLS variant problem: EXT-X-STREAM-INF describes a bundle of one
|
|
14
|
+
* video rendition plus an audio group plus a subtitle group. The adapter
|
|
15
|
+
* decomposes variants into a video track with renditions, hoists
|
|
16
|
+
* EXT-X-MEDIA entries into their own tracks, and records the bundle in the
|
|
17
|
+
* coupling table as data. Generic descriptors only; the kernel routes.
|
|
18
|
+
*/
|
|
19
|
+
/** Epoch seconds from an ISO 8601 date, or null. */
|
|
20
|
+
function epochSeconds(value) {
|
|
21
|
+
if (value === void 0) return null;
|
|
22
|
+
const ms = Date.parse(value);
|
|
23
|
+
return Number.isFinite(ms) ? ms / 1e3 : null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The date ranges of a playlist (RFC 8216bis §4.4.5.1), merged by ID: a
|
|
27
|
+
* later tag with the same ID adds attributes and never changes one. Each
|
|
28
|
+
* maps to the presentation timeline through the playlist's first
|
|
29
|
+
* EXT-X-PROGRAM-DATE-TIME, which a playlist with date ranges must carry; a
|
|
30
|
+
* playlist without one yields none.
|
|
31
|
+
*/
|
|
32
|
+
function dateRangesFrom(tags, anchor) {
|
|
33
|
+
if (anchor === void 0) return [];
|
|
34
|
+
const merged = /* @__PURE__ */ new Map();
|
|
35
|
+
for (const attributes of tags) {
|
|
36
|
+
const id = attributes.ID;
|
|
37
|
+
if (id === void 0) continue;
|
|
38
|
+
const known = merged.get(id);
|
|
39
|
+
merged.set(id, known === void 0 ? _objectSpread2({}, attributes) : _objectSpread2(_objectSpread2({}, attributes), known));
|
|
40
|
+
}
|
|
41
|
+
const toPresentation = (epoch) => anchor.presentationTime + (epoch - anchor.wallClock);
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const [id, attributes] of merged) {
|
|
44
|
+
const startDate = epochSeconds(attributes["START-DATE"]);
|
|
45
|
+
if (startDate === null) continue;
|
|
46
|
+
const start = toPresentation(startDate);
|
|
47
|
+
const endDate = epochSeconds(attributes["END-DATE"]);
|
|
48
|
+
const duration = Number(attributes.DURATION);
|
|
49
|
+
const planned = Number(attributes["PLANNED-DURATION"]);
|
|
50
|
+
const end = endDate !== null ? toPresentation(endDate) : Number.isFinite(duration) ? start + duration : void 0;
|
|
51
|
+
out.push(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
52
|
+
id,
|
|
53
|
+
start
|
|
54
|
+
}, end !== void 0 ? { end } : {}), Number.isFinite(planned) ? { plannedEnd: start + planned } : {}), {}, {
|
|
55
|
+
startDate,
|
|
56
|
+
attributes
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
return out.sort((a, b) => a.start - b.start);
|
|
60
|
+
}
|
|
7
61
|
/** n@o or n (continuing after the previous range). RFC 8216 §4.3.2.2. */
|
|
8
62
|
function parseByteRange(value, previousEnd) {
|
|
9
63
|
const [lengthText, offsetText] = value.split("@");
|
|
@@ -43,6 +97,8 @@ function protectionFrom(key, baseUrl) {
|
|
|
43
97
|
}] };
|
|
44
98
|
}
|
|
45
99
|
const AUDIO_CODECS = /^(mp4a|ac-3|ec-3|opus|flac)/i;
|
|
100
|
+
/** Subtitles in fMP4: IMSC (Apple HLS authoring spec 5.10) and WebVTT. */
|
|
101
|
+
const TEXT_CODECS = /^(stpp|wvtt)/i;
|
|
46
102
|
/**
|
|
47
103
|
* A tile grid from LAYOUT="CxR" and a tile RESOLUTION, both from the Roku
|
|
48
104
|
* image-playlist specification (EXT-X-IMAGE-STREAM-INF, EXT-X-TILES).
|
|
@@ -71,21 +127,25 @@ function tileGridFrom(attributes) {
|
|
|
71
127
|
function normalizeAvcCodec(codec) {
|
|
72
128
|
const match = /^(avc1|avc3)\.(\d+)\.(\d+)$/.exec(codec);
|
|
73
129
|
if (match === null) return codec;
|
|
74
|
-
|
|
75
|
-
return `${match[1]}.${hex(Number(match[2]))}00${hex(Number(match[3]))}`;
|
|
130
|
+
return `${match[1]}.${byteToHex(Number(match[2]))}00${byteToHex(Number(match[3]))}`;
|
|
76
131
|
}
|
|
77
132
|
function splitCodecs(value) {
|
|
78
133
|
if (value === void 0) return {
|
|
79
134
|
video: null,
|
|
80
|
-
audio: null
|
|
135
|
+
audio: null,
|
|
136
|
+
text: null
|
|
81
137
|
};
|
|
82
138
|
let video = null;
|
|
83
139
|
let audio = null;
|
|
140
|
+
let text = null;
|
|
84
141
|
for (const codec of value.split(",").map((c) => c.trim())) {
|
|
85
142
|
if (codec === "") continue;
|
|
86
143
|
if (AUDIO_CODECS.test(codec)) {
|
|
87
144
|
var _audio;
|
|
88
145
|
audio = (_audio = audio) !== null && _audio !== void 0 ? _audio : codec;
|
|
146
|
+
} else if (TEXT_CODECS.test(codec)) {
|
|
147
|
+
var _text;
|
|
148
|
+
text = (_text = text) !== null && _text !== void 0 ? _text : codec;
|
|
89
149
|
} else {
|
|
90
150
|
var _video;
|
|
91
151
|
video = (_video = video) !== null && _video !== void 0 ? _video : normalizeAvcCodec(codec);
|
|
@@ -93,7 +153,8 @@ function splitCodecs(value) {
|
|
|
93
153
|
}
|
|
94
154
|
return {
|
|
95
155
|
video,
|
|
96
|
-
audio
|
|
156
|
+
audio,
|
|
157
|
+
text
|
|
97
158
|
};
|
|
98
159
|
}
|
|
99
160
|
/** parse a media playlist body into segments. */
|
|
@@ -117,6 +178,8 @@ function parseMediaPlaylist(text, baseUrl) {
|
|
|
117
178
|
let pendingDuration = null;
|
|
118
179
|
let pendingRange = null;
|
|
119
180
|
let pendingDiscontinuity = false;
|
|
181
|
+
let discontinuitySequence = 0;
|
|
182
|
+
const dateRangeTags = [];
|
|
120
183
|
let previousRangeEnd = null;
|
|
121
184
|
let start = 0;
|
|
122
185
|
let seq = 0;
|
|
@@ -147,6 +210,12 @@ function parseMediaPlaylist(text, baseUrl) {
|
|
|
147
210
|
case "EXT-X-DISCONTINUITY":
|
|
148
211
|
pendingDiscontinuity = true;
|
|
149
212
|
break;
|
|
213
|
+
case "EXT-X-DATERANGE":
|
|
214
|
+
dateRangeTags.push(line.attributes);
|
|
215
|
+
break;
|
|
216
|
+
case "EXT-X-DISCONTINUITY-SEQUENCE":
|
|
217
|
+
discontinuitySequence = Number(line.value) || 0;
|
|
218
|
+
break;
|
|
150
219
|
case "EXT-X-MAP": {
|
|
151
220
|
const uri = line.attributes.URI;
|
|
152
221
|
if (uri !== void 0) {
|
|
@@ -180,12 +249,14 @@ function parseMediaPlaylist(text, baseUrl) {
|
|
|
180
249
|
presentationTime: start
|
|
181
250
|
};
|
|
182
251
|
pendingDate = null;
|
|
183
|
-
|
|
252
|
+
if (pendingDiscontinuity) discontinuitySequence += 1;
|
|
253
|
+
const opensEpoch = segments.length === 0 || pendingDiscontinuity;
|
|
254
|
+
segments.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
184
255
|
seq,
|
|
185
256
|
start,
|
|
186
257
|
duration: pendingDuration,
|
|
187
258
|
url: resolveUrl(line.uri, baseUrl)
|
|
188
|
-
}, pendingRange !== null ? { byteRange: pendingRange } : {}), pendingDiscontinuity ? { discontinuity: true } : {}), pendingKey !== null ? { key: pendingKey } : {}));
|
|
259
|
+
}, pendingRange !== null ? { byteRange: pendingRange } : {}), pendingDiscontinuity ? { discontinuity: true } : {}), opensEpoch ? { discontinuitySequence } : {}), pendingKey !== null ? { key: pendingKey } : {}));
|
|
189
260
|
previousRangeEnd = pendingRange !== null ? pendingRange.end : previousRangeEnd;
|
|
190
261
|
start += pendingDuration;
|
|
191
262
|
seq += 1;
|
|
@@ -194,7 +265,7 @@ function parseMediaPlaylist(text, baseUrl) {
|
|
|
194
265
|
pendingDiscontinuity = false;
|
|
195
266
|
}
|
|
196
267
|
return {
|
|
197
|
-
playlist: _objectSpread2(_objectSpread2({
|
|
268
|
+
playlist: _objectSpread2(_objectSpread2(_objectSpread2({
|
|
198
269
|
segments,
|
|
199
270
|
init,
|
|
200
271
|
targetDuration,
|
|
@@ -202,7 +273,7 @@ function parseMediaPlaylist(text, baseUrl) {
|
|
|
202
273
|
endlist,
|
|
203
274
|
playlistType,
|
|
204
275
|
protection
|
|
205
|
-
}, dateAnchor !== void 0 ? { dateAnchor } : {}), tiles !== null ? { tiles } : {}),
|
|
276
|
+
}, dateAnchor !== void 0 ? { dateAnchor } : {}), tiles !== null ? { tiles } : {}), dateRangeTags.length > 0 ? { dateRanges: dateRangesFrom(dateRangeTags, dateAnchor) } : {}),
|
|
206
277
|
error: null
|
|
207
278
|
};
|
|
208
279
|
}
|
|
@@ -211,28 +282,51 @@ function mediaContentType(type) {
|
|
|
211
282
|
if (type === "SUBTITLES") return "text";
|
|
212
283
|
return null;
|
|
213
284
|
}
|
|
285
|
+
/** The attributes as one string, in name order, leaving out the names `skip` matches. */
|
|
286
|
+
function attributeKey(attributes, skip) {
|
|
287
|
+
return Object.keys(attributes).filter((name) => (skip === null || skip === void 0 ? void 0 : skip.test(name)) !== true).sort().map((name) => `${name}=${attributes[name]}`).join(",");
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* RFC 8216bis §4.4.6.1.1: groups of one TYPE carry the same members, and
|
|
291
|
+
* corresponding members differ only in these attributes. A member that
|
|
292
|
+
* matches on everything else is the same rendition in another encoding.
|
|
293
|
+
*/
|
|
294
|
+
const PER_GROUP = /^(URI|GROUP-ID|CHANNELS|BIT-DEPTH|SAMPLE-RATE|STABLE-RENDITION-ID)$/;
|
|
295
|
+
/**
|
|
296
|
+
* RFC 8216bis §4.4.6.1: CHANNELS="6", or "16/JOC" for object-based audio.
|
|
297
|
+
* The first parameter counts the channels; the second names the object
|
|
298
|
+
* coding, where "-" means none.
|
|
299
|
+
*/
|
|
300
|
+
function channelsOf(entry) {
|
|
301
|
+
var _entry$attributes$CHA;
|
|
302
|
+
const [count, objects] = ((_entry$attributes$CHA = entry.attributes.CHANNELS) !== null && _entry$attributes$CHA !== void 0 ? _entry$attributes$CHA : "").split("/");
|
|
303
|
+
const channels = Number(count);
|
|
304
|
+
return _objectSpread2(_objectSpread2({}, channels > 0 ? { channels } : {}), objects !== void 0 && objects !== "" && objects !== "-" ? { audioObjects: objects } : {});
|
|
305
|
+
}
|
|
214
306
|
/** The CHARACTERISTICS tags of a rendition, as written, in order. */
|
|
215
307
|
function characteristicsOf(entry) {
|
|
216
|
-
var _entry$attributes$
|
|
217
|
-
return ((_entry$attributes$
|
|
308
|
+
var _entry$attributes$CHA2;
|
|
309
|
+
return ((_entry$attributes$CHA2 = entry.attributes.CHARACTERISTICS) !== null && _entry$attributes$CHA2 !== void 0 ? _entry$attributes$CHA2 : "").split(",").map((tag) => tag.trim()).filter((tag) => tag !== "");
|
|
218
310
|
}
|
|
219
311
|
/**
|
|
220
312
|
* RFC 8216bis §4.4.6.1: a CLOSED-CAPTIONS rendition names an in-band
|
|
221
|
-
* CEA-608 channel (INSTREAM-ID CC1 to
|
|
222
|
-
*
|
|
223
|
-
*
|
|
313
|
+
* caption channel inside the video: a CEA-608 channel (INSTREAM-ID CC1 to
|
|
314
|
+
* CC4) or a CEA-708 service (SERVICE1 to SERVICE63). It becomes a text
|
|
315
|
+
* track with no segments; a caption stage reads the cues from the video.
|
|
224
316
|
*/
|
|
225
317
|
function captionTrack(entry) {
|
|
318
|
+
var _entry$attributes$INS;
|
|
226
319
|
if (entry.type !== "CLOSED-CAPTIONS") return null;
|
|
227
|
-
const instreamId = entry.attributes["INSTREAM-ID"];
|
|
228
|
-
|
|
320
|
+
const instreamId = (_entry$attributes$INS = entry.attributes["INSTREAM-ID"]) !== null && _entry$attributes$INS !== void 0 ? _entry$attributes$INS : "";
|
|
321
|
+
const mimeType = /^CC[1-4]$/.test(instreamId) ? "application/cea-608" : /^SERVICE([1-9]|[1-5]\d|6[0-3])$/.test(instreamId) ? "application/cea-708" : null;
|
|
322
|
+
if (mimeType === null) return null;
|
|
229
323
|
const characteristics = characteristicsOf(entry);
|
|
230
|
-
return _objectSpread2(_objectSpread2(_objectSpread2({
|
|
324
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
231
325
|
id: `${entry.groupId}:${entry.name}`,
|
|
232
326
|
contentType: "text",
|
|
233
|
-
mimeType
|
|
234
|
-
|
|
235
|
-
}, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), {}, { role: "caption" }, characteristics.length > 0 ? { characteristics } : {}), {}, {
|
|
327
|
+
mimeType,
|
|
328
|
+
name: entry.name
|
|
329
|
+
}, entry.attributes.AUTOSELECT === "YES" ? { autoselect: true } : {}), {}, { protection: null }, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), {}, { role: "caption" }, characteristics.length > 0 ? { characteristics } : {}), {}, {
|
|
236
330
|
instreamId,
|
|
237
331
|
renditions: []
|
|
238
332
|
});
|
|
@@ -348,13 +442,13 @@ function parse(text, baseUrl) {
|
|
|
348
442
|
const audioOnly = media.playlist.segments.every((s) => /\.(aac|mp3|ac3|ec3|m4a)(\?|$)/i.test(s.url));
|
|
349
443
|
const contentType = audioOnly ? "audio" : "video";
|
|
350
444
|
const mimeType = audioOnly ? "audio/mp4" : "video/mp4";
|
|
351
|
-
const rendition = _objectSpread2({
|
|
445
|
+
const rendition = _objectSpread2(_objectSpread2({
|
|
352
446
|
id: "r-0",
|
|
353
447
|
bitrate: 0,
|
|
354
448
|
codecs: null,
|
|
355
449
|
mimeType,
|
|
356
450
|
segments: media.playlist.segments
|
|
357
|
-
}, media.playlist.init !== null ? { init: media.playlist.init } : {});
|
|
451
|
+
}, media.playlist.init !== null ? { init: media.playlist.init } : {}), media.playlist.dateRanges !== void 0 ? { dateRanges: media.playlist.dateRanges } : {});
|
|
358
452
|
return {
|
|
359
453
|
presentation: _objectSpread2(_objectSpread2(_objectSpread2({
|
|
360
454
|
id: baseUrl,
|
|
@@ -425,6 +519,7 @@ function parse(text, baseUrl) {
|
|
|
425
519
|
const renditions = [];
|
|
426
520
|
const audioOnlyVariants = [];
|
|
427
521
|
const couplings = [];
|
|
522
|
+
const declared = /* @__PURE__ */ new Map();
|
|
428
523
|
for (const variant of variants) {
|
|
429
524
|
var _dimensions;
|
|
430
525
|
const bandwidth = Number(variant.attributes.BANDWIDTH) || 0;
|
|
@@ -437,17 +532,26 @@ function parse(text, baseUrl) {
|
|
|
437
532
|
const hasAudioGroup = variant.attributes.AUDIO !== void 0;
|
|
438
533
|
const codecs = video !== null && !hasAudioGroup && audio !== null ? `${video}, ${audio}` : video;
|
|
439
534
|
const frameRate = Number(variant.attributes["FRAME-RATE"]);
|
|
535
|
+
const range = variant.attributes["VIDEO-RANGE"];
|
|
536
|
+
const videoRange = range === "SDR" || range === "PQ" || range === "HLG" ? range : video !== null && /^dv(h1|he|a1|av)/.test(video) ? "PQ" : void 0;
|
|
440
537
|
const pathway = variant.attributes["PATHWAY-ID"];
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
538
|
+
let id = pathway !== void 0 ? `v-${bandwidth}-${pathway}` : `v-${bandwidth}`;
|
|
539
|
+
const taken = declared.get(id);
|
|
540
|
+
if (taken !== void 0) {
|
|
541
|
+
if (attributeKey(taken) === attributeKey(variant.attributes)) continue;
|
|
542
|
+
id = `${id}-${renditions.length}`;
|
|
543
|
+
}
|
|
544
|
+
declared.set(id, variant.attributes);
|
|
545
|
+
const average = Number(variant.attributes["AVERAGE-BANDWIDTH"]);
|
|
546
|
+
const supplemental = variant.attributes["SUPPLEMENTAL-CODECS"];
|
|
547
|
+
renditions.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
444
548
|
id,
|
|
445
549
|
bitrate: bandwidth,
|
|
446
550
|
codecs,
|
|
447
551
|
mimeType: "video/mp4",
|
|
448
552
|
segments: [],
|
|
449
553
|
playlistUrl: variant.uri
|
|
450
|
-
}, pathway !== void 0 ? { pathway } : {}), width !== void 0 ? { width } : {}), height !== void 0 ? { height } : {}), Number.isFinite(frameRate) ? { frameRate } : {}));
|
|
554
|
+
}, average > 0 ? { averageBitrate: average } : {}), supplemental !== void 0 ? { supplementalCodecs: supplemental } : {}), pathway !== void 0 ? { pathway } : {}), width !== void 0 ? { width } : {}), height !== void 0 ? { height } : {}), Number.isFinite(frameRate) ? { frameRate } : {}), videoRange !== void 0 ? { videoRange } : {}));
|
|
451
555
|
const requires = {};
|
|
452
556
|
if (variant.attributes.AUDIO !== void 0) requires.audio = variant.attributes.AUDIO;
|
|
453
557
|
if (variant.attributes.SUBTITLES !== void 0) requires.text = variant.attributes.SUBTITLES;
|
|
@@ -488,8 +592,9 @@ function parse(text, baseUrl) {
|
|
|
488
592
|
renditions: audioRenditions
|
|
489
593
|
});
|
|
490
594
|
}
|
|
595
|
+
const soundtracks = /* @__PURE__ */ new Map();
|
|
491
596
|
for (const entry of mediaEntries) {
|
|
492
|
-
var _variants$find;
|
|
597
|
+
var _variants$find, _variants$find2;
|
|
493
598
|
const caption = captionTrack(entry);
|
|
494
599
|
if (caption !== null) {
|
|
495
600
|
tracks.push(caption);
|
|
@@ -498,21 +603,35 @@ function parse(text, baseUrl) {
|
|
|
498
603
|
const contentType = mediaContentType(entry.type);
|
|
499
604
|
if (contentType === null || entry.uri === null) continue;
|
|
500
605
|
const { audio } = splitCodecs((_variants$find = variants.find((v) => v.attributes.AUDIO === entry.groupId)) === null || _variants$find === void 0 ? void 0 : _variants$find.attributes.CODECS);
|
|
501
|
-
const
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
id: `${entry.groupId}:${entry.name}`,
|
|
505
|
-
contentType,
|
|
506
|
-
mimeType,
|
|
507
|
-
protection: sessionProtection
|
|
508
|
-
}, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), entry.attributes.DEFAULT === "YES" ? { role: "main" } : { role: "alternate" }), characteristics.length > 0 ? { characteristics } : {}), contentType === "text" && entry.attributes.FORCED === "YES" ? { forced: true } : {}), {}, { renditions: [{
|
|
606
|
+
const { text } = splitCodecs((_variants$find2 = variants.find((v) => v.attributes.SUBTITLES === entry.groupId)) === null || _variants$find2 === void 0 ? void 0 : _variants$find2.attributes.CODECS);
|
|
607
|
+
const mimeType = contentType === "audio" ? "audio/mp4" : text !== null ? "application/mp4" : "text/vtt";
|
|
608
|
+
const rendition = _objectSpread2({
|
|
509
609
|
id: `${entry.groupId}:${entry.name}`,
|
|
510
610
|
bitrate: 0,
|
|
511
|
-
codecs: contentType === "audio" ? audio :
|
|
611
|
+
codecs: contentType === "audio" ? audio : text,
|
|
512
612
|
mimeType,
|
|
513
613
|
segments: [],
|
|
514
614
|
playlistUrl: entry.uri
|
|
515
|
-
}
|
|
615
|
+
}, channelsOf(entry));
|
|
616
|
+
const key = attributeKey(entry.attributes, PER_GROUP);
|
|
617
|
+
const twin = contentType === "audio" ? soundtracks.get(key) : void 0;
|
|
618
|
+
if (twin !== void 0 && !twin.groups.has(entry.groupId)) {
|
|
619
|
+
twin.groups.add(entry.groupId);
|
|
620
|
+
twin.renditions.push(rendition);
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
const renditions = [rendition];
|
|
624
|
+
if (contentType === "audio") soundtracks.set(key, {
|
|
625
|
+
groups: /* @__PURE__ */ new Set([entry.groupId]),
|
|
626
|
+
renditions
|
|
627
|
+
});
|
|
628
|
+
const characteristics = characteristicsOf(entry);
|
|
629
|
+
tracks.push(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
630
|
+
id: `${entry.groupId}:${entry.name}`,
|
|
631
|
+
contentType,
|
|
632
|
+
mimeType,
|
|
633
|
+
name: entry.name
|
|
634
|
+
}, entry.attributes.AUTOSELECT === "YES" ? { autoselect: true } : {}), {}, { protection: sessionProtection }, entry.attributes.LANGUAGE !== void 0 ? { lang: entry.attributes.LANGUAGE } : {}), entry.attributes.DEFAULT === "YES" ? { role: "main" } : { role: "alternate" }), characteristics.length > 0 ? { characteristics } : {}), contentType === "text" && entry.attributes.FORCED === "YES" ? { forced: true } : {}), {}, { renditions }));
|
|
516
635
|
}
|
|
517
636
|
const trick = trickTrack(iframeStreams, baseUrl, sessionProtection);
|
|
518
637
|
if (trick !== null) tracks.push(trick);
|
|
@@ -582,7 +701,7 @@ function refreshFor(presentation, renditionId, playlist) {
|
|
|
582
701
|
if (knownLast !== void 0 && incomingLast !== void 0 && !playlist.endlist && incomingLast.seq < knownLast.seq) return null;
|
|
583
702
|
const shift = timelineShift(!playlist.endlist && knownLast === void 0 && sibling.length > 0 ? sibling : previous, playlist.segments);
|
|
584
703
|
const segments = shift === 0 ? playlist.segments : playlist.segments.map((s) => _objectSpread2(_objectSpread2({}, s), {}, { start: s.start + shift }));
|
|
585
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
704
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
586
705
|
type: "PLAYLIST_REFRESHED",
|
|
587
706
|
trackId: renditionId,
|
|
588
707
|
renditionId,
|
|
@@ -594,7 +713,10 @@ function refreshFor(presentation, renditionId, playlist) {
|
|
|
594
713
|
}, playlist.endlist ? {} : { updatePeriod: playlist.targetDuration || 4 }), playlist.dateAnchor !== void 0 ? { dateAnchor: {
|
|
595
714
|
wallClock: playlist.dateAnchor.wallClock,
|
|
596
715
|
presentationTime: playlist.dateAnchor.presentationTime + shift
|
|
597
|
-
} } : {});
|
|
716
|
+
} } : {}), playlist.dateRanges !== void 0 ? { dateRanges: shift === 0 ? playlist.dateRanges : playlist.dateRanges.map((range) => shiftRange(range, shift)) } : {});
|
|
717
|
+
}
|
|
718
|
+
function shiftRange(range, shift) {
|
|
719
|
+
return _objectSpread2(_objectSpread2(_objectSpread2({}, range), {}, { start: range.start + shift }, range.end !== void 0 ? { end: range.end + shift } : {}), range.plannedEnd !== void 0 ? { plannedEnd: range.plannedEnd + shift } : {});
|
|
598
720
|
}
|
|
599
721
|
//#endregion
|
|
600
722
|
export { normalizeAvcCodec, parse, parseMediaPlaylist, refreshFor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { isTrick } from "../../kernel/presentation.js";
|
|
3
3
|
import { withDeadGroups } from "../../kernel/rendition-select.js";
|
|
4
4
|
//#region src/protocols/hls-cmaf/unavailable.ts
|
|
@@ -14,6 +14,24 @@ const LOAD_FAILED = "hls:unavailable";
|
|
|
14
14
|
/** Renditions whose playlist kept failing to reload (hls-live). */
|
|
15
15
|
const RELOAD_FAILED = "hls-live:unavailable";
|
|
16
16
|
/**
|
|
17
|
+
* What `source` excludes for the failed renditions in `ids`, together with
|
|
18
|
+
* the other source: `excluded` is everything out, `own` the part `source`
|
|
19
|
+
* writes. A source writes its own failures, and a variant a dead audio group
|
|
20
|
+
* drags along that the other source does not exclude already. Writing the
|
|
21
|
+
* other source's renditions too would keep them out after that source
|
|
22
|
+
* readmits them.
|
|
23
|
+
*/
|
|
24
|
+
function exclusion(presentation, kernel, source, ids) {
|
|
25
|
+
var _kernel$quality$const, _kernel$quality$const2;
|
|
26
|
+
const other = source === "hls:unavailable" ? RELOAD_FAILED : LOAD_FAILED;
|
|
27
|
+
const otherIds = new Set((_kernel$quality$const = (_kernel$quality$const2 = kernel.quality.constraints.get(other)) === null || _kernel$quality$const2 === void 0 ? void 0 : _kernel$quality$const2.excludeIds) !== null && _kernel$quality$const !== void 0 ? _kernel$quality$const : []);
|
|
28
|
+
const excluded = withDeadGroups(presentation, /* @__PURE__ */ new Set([...ids, ...otherIds]));
|
|
29
|
+
return {
|
|
30
|
+
excluded,
|
|
31
|
+
own: [...excluded].filter((id) => ids.includes(id) || !otherIds.has(id))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
17
35
|
* The messages that stop relying on the renditions in `ids`, the whole list
|
|
18
36
|
* `source` excludes. A failed audio group takes the variants that require
|
|
19
37
|
* it, so arbitration moves to a variant on a working group and alt-audio
|
|
@@ -22,11 +40,9 @@ const RELOAD_FAILED = "hls-live:unavailable";
|
|
|
22
40
|
* has none and no variant names an audio group to move to.
|
|
23
41
|
*/
|
|
24
42
|
function unavailableMessages(kernel, source, ids, error) {
|
|
25
|
-
var _kernel$quality$const, _kernel$quality$const2;
|
|
26
43
|
const presentation = kernel.presentation;
|
|
27
44
|
if (presentation === null) return [];
|
|
28
|
-
const
|
|
29
|
-
const excluded = withDeadGroups(presentation, /* @__PURE__ */ new Set([...ids, ...(_kernel$quality$const = (_kernel$quality$const2 = kernel.quality.constraints.get(other)) === null || _kernel$quality$const2 === void 0 ? void 0 : _kernel$quality$const2.excludeIds) !== null && _kernel$quality$const !== void 0 ? _kernel$quality$const : []]));
|
|
45
|
+
const { excluded, own } = exclusion(presentation, kernel, source, ids);
|
|
30
46
|
const grouped = presentation.couplings.some((c) => c.requires.audio !== void 0);
|
|
31
47
|
const activeAudio = kernel.tracks.active.get("audio");
|
|
32
48
|
if (presentation.periods.some((period) => period.tracks.some((track) => track.renditions.length > 0 && track.renditions.every((r) => excluded.has(r.id)) && (track.contentType === "video" && !isTrick(track) || track.id === activeAudio && !grouped)))) return [{
|
|
@@ -36,8 +52,23 @@ function unavailableMessages(kernel, source, ids, error) {
|
|
|
36
52
|
return [{
|
|
37
53
|
type: "CONSTRAIN",
|
|
38
54
|
source,
|
|
39
|
-
constraint: { excludeIds: [...
|
|
55
|
+
constraint: { excludeIds: [...own] }
|
|
40
56
|
}];
|
|
41
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* The CONSTRAIN for what `source` still excludes once some of its failures
|
|
60
|
+
* are readmitted: `ids` is the shorter list. Fewer exclusions never stop
|
|
61
|
+
* playback, so there is no failure to report.
|
|
62
|
+
*/
|
|
63
|
+
function readmitMessage(kernel, source, ids) {
|
|
64
|
+
const presentation = kernel.presentation;
|
|
65
|
+
if (presentation === null) return null;
|
|
66
|
+
const { own } = exclusion(presentation, kernel, source, ids);
|
|
67
|
+
return {
|
|
68
|
+
type: "CONSTRAIN",
|
|
69
|
+
source,
|
|
70
|
+
constraint: { excludeIds: [...own] }
|
|
71
|
+
};
|
|
72
|
+
}
|
|
42
73
|
//#endregion
|
|
43
|
-
export { LOAD_FAILED, RELOAD_FAILED, unavailableMessages };
|
|
74
|
+
export { LOAD_FAILED, RELOAD_FAILED, readmitMessage, unavailableMessages };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { scheduled, tickAfter } from "../../kernel/effects.js";
|
|
3
3
|
import { findRendition } from "../../kernel/presentation.js";
|
|
4
4
|
import { activeRenditions } from "../../kernel/rendition-select.js";
|
|
5
5
|
import { parseMediaPlaylist, refreshFor } from "../hls-cmaf/parse.js";
|
|
6
|
-
import { RELOAD_FAILED, unavailableMessages } from "../hls-cmaf/unavailable.js";
|
|
6
|
+
import { RELOAD_FAILED, readmitMessage, unavailableMessages } from "../hls-cmaf/unavailable.js";
|
|
7
7
|
import { registerLiveNamespace } from "../live-shared.js";
|
|
8
8
|
//#region src/protocols/hls-live/index.ts
|
|
9
9
|
/**
|
|
@@ -25,6 +25,8 @@ import { registerLiveNamespace } from "../live-shared.js";
|
|
|
25
25
|
*/
|
|
26
26
|
const REFRESH_TOKEN = "hls:live:refresh";
|
|
27
27
|
const TICK_TOKEN = "hls-live:reload";
|
|
28
|
+
/** An abandoned playlist's retry, by one of its renditions: `hls-live:retry:<renditionId>`. */
|
|
29
|
+
const RETRY_TOKEN = "hls-live:retry:";
|
|
28
30
|
const INITIAL = {
|
|
29
31
|
manifestUrl: null,
|
|
30
32
|
target: null,
|
|
@@ -194,7 +196,7 @@ function renditionIdsAt(presentation, url) {
|
|
|
194
196
|
* variant on another group), and the next tick reloads whatever the window
|
|
195
197
|
* rendition is then. The load fails only when nothing is left to move to.
|
|
196
198
|
*/
|
|
197
|
-
function reloadFailed(state, kernel, renditionId, error) {
|
|
199
|
+
function reloadFailed(state, kernel, renditionId, error, retryMs) {
|
|
198
200
|
var _state$failures$rendi, _findRendition2;
|
|
199
201
|
const count = ((_state$failures$rendi = state.failures[renditionId]) !== null && _state$failures$rendi !== void 0 ? _state$failures$rendi : 0) + 1;
|
|
200
202
|
const failures = _objectSpread2(_objectSpread2({}, state.failures), {}, { [renditionId]: count });
|
|
@@ -234,10 +236,31 @@ function reloadFailed(state, kernel, renditionId, error) {
|
|
|
234
236
|
});
|
|
235
237
|
const effects = messages.map(feed);
|
|
236
238
|
const failed = messages.some((m) => m.type === "MANIFEST_FAILED");
|
|
239
|
+
if (!failed && Number.isFinite(retryMs)) effects.push(tickAfter(`${RETRY_TOKEN}${renditionId}`, retryMs));
|
|
237
240
|
if (isTarget && !failed && !state.tickPending) return [_objectSpread2(_objectSpread2({}, next), {}, { tickPending: true }), [...effects, tick(2)]];
|
|
238
241
|
return [next, effects];
|
|
239
242
|
}
|
|
240
|
-
|
|
243
|
+
/**
|
|
244
|
+
* The retry of an abandoned playlist: every rendition that reads it returns
|
|
245
|
+
* to arbitration with a clean failure count, and the reload loop picks it up
|
|
246
|
+
* when it is the window rendition or a companion again.
|
|
247
|
+
*/
|
|
248
|
+
function retry(state, kernel, renditionId) {
|
|
249
|
+
var _findRendition3;
|
|
250
|
+
const presentation = kernel.presentation;
|
|
251
|
+
if (presentation === null || !state.abandoned.includes(renditionId)) return [state, []];
|
|
252
|
+
const url = (_findRendition3 = findRendition(presentation, renditionId)) === null || _findRendition3 === void 0 ? void 0 : _findRendition3.rendition.playlistUrl;
|
|
253
|
+
const sharing = url === void 0 ? [renditionId] : renditionIdsAt(presentation, url);
|
|
254
|
+
const abandoned = state.abandoned.filter((id) => !sharing.includes(id));
|
|
255
|
+
const failures = _objectSpread2({}, state.failures);
|
|
256
|
+
for (const id of sharing) delete failures[id];
|
|
257
|
+
const message = readmitMessage(kernel, RELOAD_FAILED, abandoned);
|
|
258
|
+
return [_objectSpread2(_objectSpread2({}, state), {}, {
|
|
259
|
+
abandoned,
|
|
260
|
+
failures
|
|
261
|
+
}), message === null ? [] : [feed(message)]];
|
|
262
|
+
}
|
|
263
|
+
const createReduceHlsLive = (retryMs) => (slice, msg, kernel) => {
|
|
241
264
|
const state = slice !== null && slice !== void 0 ? slice : INITIAL;
|
|
242
265
|
if (msg.type === "LOAD") return [_objectSpread2(_objectSpread2({}, INITIAL), {}, { manifestUrl: msg.url }), []];
|
|
243
266
|
if (msg.type === "UNLOAD" || msg.type === "DETACH") return [INITIAL, []];
|
|
@@ -313,6 +336,7 @@ const reduceHlsLive = (slice, msg, kernel) => {
|
|
|
313
336
|
awaitingTarget
|
|
314
337
|
}), effects];
|
|
315
338
|
}
|
|
339
|
+
if (msg.type === "TICK" && msg.token.startsWith(RETRY_TOKEN)) return retry(state, kernel, msg.token.slice(15));
|
|
316
340
|
if (msg.type === "TICK" && msg.token === TICK_TOKEN) {
|
|
317
341
|
var _kernel$presentation2;
|
|
318
342
|
if (state.suspended || state.target === null || ((_kernel$presentation2 = kernel.presentation) === null || _kernel$presentation2 === void 0 ? void 0 : _kernel$presentation2.isLive) !== true) return [_objectSpread2(_objectSpread2({}, state), {}, {
|
|
@@ -355,10 +379,10 @@ const reduceHlsLive = (slice, msg, kernel) => {
|
|
|
355
379
|
if (msg.type === "SEGMENT_FAILED") {
|
|
356
380
|
const renditionId = renditionOfToken(msg.trackId);
|
|
357
381
|
if (renditionId === null) return [state, []];
|
|
358
|
-
return reloadFailed(state, kernel, renditionId, msg.error);
|
|
382
|
+
return reloadFailed(state, kernel, renditionId, msg.error, retryMs);
|
|
359
383
|
}
|
|
360
384
|
if (msg.type === "SEGMENT_LOADED") {
|
|
361
|
-
var
|
|
385
|
+
var _findRendition4, _lastSegment$seq;
|
|
362
386
|
const renditionId = renditionOfToken(msg.trackId);
|
|
363
387
|
if (renditionId === null || kernel.presentation === null) return [state, []];
|
|
364
388
|
const isTarget = state.target !== null && renditionId === state.target.renditionId;
|
|
@@ -366,10 +390,10 @@ const reduceHlsLive = (slice, msg, kernel) => {
|
|
|
366
390
|
if (url === null) return [state, []];
|
|
367
391
|
const text = new TextDecoder().decode(msg.bytes);
|
|
368
392
|
const media = parseMediaPlaylist(text, url);
|
|
369
|
-
if (media.playlist === null) return reloadFailed(state, kernel, renditionId, media.error);
|
|
393
|
+
if (media.playlist === null) return reloadFailed(state, kernel, renditionId, media.error, retryMs);
|
|
370
394
|
const failures = _objectSpread2({}, state.failures);
|
|
371
395
|
delete failures[renditionId];
|
|
372
|
-
const sharing = ((
|
|
396
|
+
const sharing = ((_findRendition4 = findRendition(kernel.presentation, renditionId)) === null || _findRendition4 === void 0 ? void 0 : _findRendition4.rendition.playlistUrl) === void 0 ? [renditionId] : renditionIdsAt(kernel.presentation, url);
|
|
373
397
|
const effects = [];
|
|
374
398
|
for (const id of sharing) {
|
|
375
399
|
const refresh = refreshFor(kernel.presentation, id, media.playlist);
|
|
@@ -396,13 +420,15 @@ const reduceHlsLive = (slice, msg, kernel) => {
|
|
|
396
420
|
return [state, []];
|
|
397
421
|
};
|
|
398
422
|
/** The stage factory. Requires hls-cmaf; the loader enforces it. */
|
|
399
|
-
function hlsLive() {
|
|
423
|
+
function hlsLive(options = {}) {
|
|
424
|
+
var _options$unavailableR;
|
|
425
|
+
const retryMs = ((_options$unavailableR = options.unavailableRetrySeconds) !== null && _options$unavailableR !== void 0 ? _options$unavailableR : 15) * 1e3;
|
|
400
426
|
return {
|
|
401
427
|
name: "hls-live",
|
|
402
428
|
provides: ["hls-live"],
|
|
403
429
|
requires: ["hls-cmaf"],
|
|
404
430
|
install(ctx) {
|
|
405
|
-
ctx.reduce("hls-live",
|
|
431
|
+
ctx.reduce("hls-live", createReduceHlsLive(retryMs));
|
|
406
432
|
registerLiveNamespace(ctx);
|
|
407
433
|
}
|
|
408
434
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { scheduled } from "../../kernel/effects.js";
|
|
3
3
|
import { findRendition, isTrick } from "../../kernel/presentation.js";
|
|
4
4
|
import { canSwitchTo } from "../../kernel/rendition-select.js";
|
|
@@ -21,20 +21,31 @@ const DEFAULTS = {
|
|
|
21
21
|
emergencyFactor: .5,
|
|
22
22
|
recoveryFactor: 2
|
|
23
23
|
};
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The conservative estimate: the minimum of the slow and fast EWMAs, and of
|
|
26
|
+
* the server's estimate (CMSD `etp`) when one is known. Before the engine
|
|
27
|
+
* has measured anything, the server's estimate stands alone.
|
|
28
|
+
*/
|
|
25
29
|
function estimateBps(telemetry) {
|
|
26
30
|
var _telemetry$throughput;
|
|
27
31
|
const slow = telemetry.throughputEwma;
|
|
28
32
|
const fast = (_telemetry$throughput = telemetry.throughputFastEwma) !== null && _telemetry$throughput !== void 0 ? _telemetry$throughput : slow;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
const measured = slow === 0 ? fast : fast === 0 ? slow : Math.min(slow, fast);
|
|
34
|
+
const server = telemetry.serverThroughput;
|
|
35
|
+
if (server === void 0) return measured;
|
|
36
|
+
return measured === 0 ? server : Math.min(measured, server);
|
|
37
|
+
}
|
|
38
|
+
/** The codec family and the range, as one key: avc1 and avc3 are one family, hvc1 and hev1 too. */
|
|
39
|
+
function kind(rendition) {
|
|
40
|
+
var _rendition$codecs, _rendition$videoRange;
|
|
41
|
+
return `${((_rendition$codecs = rendition.codecs) !== null && _rendition$codecs !== void 0 ? _rendition$codecs : "").slice(0, 4).replace("avc3", "avc1").replace("hev1", "hvc1")}:${(_rendition$videoRange = rendition.videoRange) !== null && _rendition$videoRange !== void 0 ? _rendition$videoRange : "SDR"}`;
|
|
32
42
|
}
|
|
33
43
|
function choose(allowed, telemetry, options) {
|
|
34
44
|
var _allowed$find, _telemetry$bufferAhea, _telemetry$canSwitchT;
|
|
35
|
-
const sorted = [...allowed].sort((a, b) => a.bitrate - b.bitrate);
|
|
36
|
-
const lowestRendition = sorted[0];
|
|
37
45
|
const current = (_allowed$find = allowed.find((r) => r.id === telemetry.current)) !== null && _allowed$find !== void 0 ? _allowed$find : null;
|
|
46
|
+
const same = current === null ? [] : allowed.filter((r) => kind(r) === kind(current));
|
|
47
|
+
const sorted = [...same.length > 0 ? same : allowed].sort((a, b) => a.bitrate - b.bitrate);
|
|
48
|
+
const lowestRendition = sorted[0];
|
|
38
49
|
const estimate = estimateBps(telemetry);
|
|
39
50
|
if (estimate === 0) return (current !== null && current !== void 0 ? current : lowestRendition).id;
|
|
40
51
|
let best = lowestRendition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _objectSpread2 from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/objectSpread2.js";
|
|
2
2
|
import { scheduled } from "../../kernel/effects.js";
|
|
3
3
|
//#region src/stages/abr-persist/index.ts
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findRendition } from "../../kernel/presentation.js";
|
|
2
|
-
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _asyncToGenerator from "../../_virtual/_@oxc-project_runtime@0.152.0/helpers/esm/asyncToGenerator.js";
|
|
3
3
|
//#region src/stages/aes-128/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* aes-128 as a stage: full-segment AES-CBC decryption for HLS EXT-X-KEY
|
|
@@ -12,7 +12,9 @@ import { groupOf } from "../../kernel/rendition-select.js";
|
|
|
12
12
|
* slice watches the active video rendition; when its coupling names an
|
|
13
13
|
* audio group the current audio track is not in, it selects a track in
|
|
14
14
|
* that group — preferring the current language so a group switch does not
|
|
15
|
-
* silently change languages.
|
|
15
|
+
* silently change languages. A track offered in several groups needs no
|
|
16
|
+
* switch when it is in the required one: the kernel plays its rendition
|
|
17
|
+
* there.
|
|
16
18
|
*
|
|
17
19
|
* A user choice is remembered as its language and its characteristics, and
|
|
18
20
|
* re-applied on top of every group switch, so `alt-audio` never fights
|
|
@@ -24,7 +26,7 @@ const INITIAL = {
|
|
|
24
26
|
preferredLang: null,
|
|
25
27
|
preferredCharacteristics: []
|
|
26
28
|
};
|
|
27
|
-
/** Audio tracks with their
|
|
29
|
+
/** Audio tracks with their groups parsed from the `group:name` rendition id convention. */
|
|
28
30
|
function audioTracks(kernel) {
|
|
29
31
|
var _kernel$presentation$, _kernel$presentation;
|
|
30
32
|
const out = [];
|
|
@@ -33,7 +35,7 @@ function audioTracks(kernel) {
|
|
|
33
35
|
if (track.contentType !== "audio") continue;
|
|
34
36
|
out.push({
|
|
35
37
|
id: track.id,
|
|
36
|
-
|
|
38
|
+
groups: track.renditions.map((r) => groupOf(r.id)),
|
|
37
39
|
lang: (_track$lang = track.lang) !== null && _track$lang !== void 0 ? _track$lang : null,
|
|
38
40
|
characteristics: (_track$characteristic = track.characteristics) !== null && _track$characteristic !== void 0 ? _track$characteristic : [],
|
|
39
41
|
isDefault: track.role === "main"
|
|
@@ -59,7 +61,7 @@ function sameTags(a, b) {
|
|
|
59
61
|
*/
|
|
60
62
|
function pickInGroup(tracks, group, preference) {
|
|
61
63
|
var _ref, _ref2, _sameLang$find;
|
|
62
|
-
const inGroup = tracks.filter((t) => t.group
|
|
64
|
+
const inGroup = tracks.filter((t) => t.groups.includes(group));
|
|
63
65
|
if (inGroup.length === 0) return null;
|
|
64
66
|
const { preferredLang, preferredCharacteristics } = preference;
|
|
65
67
|
const sameLang = preferredLang !== null ? inGroup.filter((t) => t.lang === preferredLang) : [];
|
|
@@ -91,7 +93,7 @@ const reduceAltAudio = (slice, msg, kernel) => {
|
|
|
91
93
|
const active = kernel.tracks.active.get("audio");
|
|
92
94
|
const tracks = audioTracks(kernel);
|
|
93
95
|
const activeInfo = tracks.find((t) => t.id === active);
|
|
94
|
-
if (activeInfo
|
|
96
|
+
if ((activeInfo === null || activeInfo === void 0 ? void 0 : activeInfo.groups.includes(group)) === true) return [state, []];
|
|
95
97
|
const target = pickInGroup(tracks, group, state);
|
|
96
98
|
if (target === void 0 || target === null || target.id === active) return [state, []];
|
|
97
99
|
return [state, [select(target.id)]];
|