@norskvideo/norsk-studio-built-ins 1.19.0 → 1.26.0-2025-02-19-33cde15d
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/client/info.js +5983 -699
- package/client/output.preview/styles.css +69 -69
- package/client/output.whep/styles.css +9 -0
- package/client/style.css +283 -856
- package/lib/info.js +14 -14
- package/lib/info.js.map +1 -1
- package/lib/input.rtmp/info.js +19 -5
- package/lib/input.rtmp/info.js.map +1 -1
- package/lib/input.rtmp/inline-view.js +3 -3
- package/lib/input.rtmp/runtime.d.ts +46 -7
- package/lib/input.rtmp/runtime.js +245 -59
- package/lib/input.rtmp/runtime.js.map +1 -1
- package/lib/input.rtmp/summary-view.d.ts +3 -5
- package/lib/input.rtmp/summary-view.js +51 -6
- package/lib/input.rtmp/summary-view.js.map +1 -1
- package/lib/input.rtmp/types.d.ts +193 -0
- package/lib/{processor.browserOverlay/openApi.js → input.rtmp/types.js} +1 -1
- package/lib/input.rtmp/types.js.map +1 -0
- package/lib/input.rtmp/types.yaml +147 -0
- package/lib/input.silence/info.js +9 -2
- package/lib/input.silence/info.js.map +1 -1
- package/lib/input.silence/runtime.d.ts +1 -0
- package/lib/input.silence/runtime.js.map +1 -1
- package/lib/input.srt-caller/info.js +8 -1
- package/lib/input.srt-caller/info.js.map +1 -1
- package/lib/input.srt-caller/runtime.d.ts +1 -0
- package/lib/input.srt-caller/runtime.js.map +1 -1
- package/lib/input.srt-listener/info.js +15 -2
- package/lib/input.srt-listener/info.js.map +1 -1
- package/lib/input.srt-listener/runtime.d.ts +41 -5
- package/lib/input.srt-listener/runtime.js +236 -57
- package/lib/input.srt-listener/runtime.js.map +1 -1
- package/lib/input.srt-listener/summary-view.d.ts +3 -5
- package/lib/input.srt-listener/summary-view.js +45 -6
- package/lib/input.srt-listener/summary-view.js.map +1 -1
- package/lib/input.srt-listener/types.d.ts +193 -0
- package/lib/input.srt-listener/types.js +3 -0
- package/lib/input.srt-listener/types.js.map +1 -0
- package/lib/input.srt-listener/types.yaml +145 -0
- package/lib/input.udp-ts/info.js +2 -1
- package/lib/input.udp-ts/info.js.map +1 -1
- package/lib/input.udp-ts/runtime.d.ts +1 -0
- package/lib/input.udp-ts/runtime.js.map +1 -1
- package/lib/input.videoTestCard/info.d.ts +1 -1
- package/lib/input.videoTestCard/info.js +17 -4
- package/lib/input.videoTestCard/info.js.map +1 -1
- package/lib/input.videoTestCard/runtime.d.ts +1 -0
- package/lib/output.autoCmaf/form-views.d.ts +2 -2
- package/lib/output.autoCmaf/form-views.js +13 -3
- package/lib/output.autoCmaf/form-views.js.map +1 -1
- package/lib/output.autoCmaf/info.d.ts +21 -2
- package/lib/output.autoCmaf/info.js +106 -32
- package/lib/output.autoCmaf/info.js.map +1 -1
- package/lib/output.autoCmaf/inline-view.d.ts +6 -0
- package/lib/output.autoCmaf/inline-view.js +8 -0
- package/lib/output.autoCmaf/inline-view.js.map +1 -0
- package/lib/output.autoCmaf/runtime.d.ts +29 -43
- package/lib/output.autoCmaf/runtime.js +314 -96
- package/lib/output.autoCmaf/runtime.js.map +1 -1
- package/lib/output.autoCmaf/summary-view.d.ts +4 -0
- package/lib/output.autoCmaf/summary-view.js +24 -0
- package/lib/output.autoCmaf/summary-view.js.map +1 -0
- package/lib/output.autoCmaf/summary.js +3 -0
- package/lib/output.autoCmaf/summary.js.map +1 -1
- package/lib/output.autoCmaf/types.d.ts +158 -0
- package/lib/output.autoCmaf/types.js +3 -0
- package/lib/output.autoCmaf/types.js.map +1 -0
- package/lib/output.autoCmaf/types.yaml +182 -0
- package/lib/output.autoHls/info.d.ts +3 -0
- package/lib/output.autoHls/info.js +22 -0
- package/lib/output.autoHls/info.js.map +1 -0
- package/lib/output.autoHls/runtime.d.ts +6 -0
- package/lib/output.autoHls/runtime.js +13 -0
- package/lib/output.autoHls/runtime.js.map +1 -0
- package/lib/output.preview/info.d.ts +5 -2
- package/lib/output.preview/info.js +23 -3
- package/lib/output.preview/info.js.map +1 -1
- package/lib/output.preview/inline-view.d.ts +2 -4
- package/lib/output.preview/inline-view.js +65 -7
- package/lib/output.preview/inline-view.js.map +1 -1
- package/lib/output.preview/runtime.d.ts +18 -12
- package/lib/output.preview/runtime.js +122 -33
- package/lib/output.preview/runtime.js.map +1 -1
- package/lib/output.preview/types.d.ts +56 -0
- package/lib/output.preview/types.js +3 -0
- package/lib/output.preview/types.js.map +1 -0
- package/lib/output.preview/types.yaml +37 -0
- package/lib/output.rtmp/info.js +14 -2
- package/lib/output.rtmp/info.js.map +1 -1
- package/lib/output.rtmp/inline-view.js +5 -2
- package/lib/output.rtmp/inline-view.js.map +1 -1
- package/lib/output.rtmp/runtime.d.ts +31 -5
- package/lib/output.rtmp/runtime.js +169 -34
- package/lib/output.rtmp/runtime.js.map +1 -1
- package/lib/output.rtmp/summary-view.d.ts +4 -0
- package/lib/output.rtmp/summary-view.js +24 -0
- package/lib/output.rtmp/summary-view.js.map +1 -0
- package/lib/output.rtmp/types.d.ts +101 -0
- package/lib/output.rtmp/types.js +3 -0
- package/lib/output.rtmp/types.js.map +1 -0
- package/lib/output.rtmp/types.yaml +30 -0
- package/lib/output.srt/info.d.ts +2 -2
- package/lib/output.srt/info.js +29 -1
- package/lib/output.srt/info.js.map +1 -1
- package/lib/output.srt/inline-view.d.ts +6 -0
- package/lib/output.srt/inline-view.js +8 -0
- package/lib/output.srt/inline-view.js.map +1 -0
- package/lib/output.srt/runtime.d.ts +35 -5
- package/lib/output.srt/runtime.js +174 -6
- package/lib/output.srt/runtime.js.map +1 -1
- package/lib/output.srt/summary-view.d.ts +4 -0
- package/lib/output.srt/summary-view.js +24 -0
- package/lib/output.srt/summary-view.js.map +1 -0
- package/lib/output.srt/types.d.ts +101 -0
- package/lib/output.srt/types.js +3 -0
- package/lib/output.srt/types.js.map +1 -0
- package/lib/output.srt/types.yaml +31 -0
- package/lib/output.statistics/info.js +3 -1
- package/lib/output.statistics/info.js.map +1 -1
- package/lib/output.statistics/inline-view.js +3 -2
- package/lib/output.statistics/inline-view.js.map +1 -1
- package/lib/output.statistics/runtime.d.ts +1 -0
- package/lib/output.statistics/runtime.js.map +1 -1
- package/lib/output.udpTs/info.js +4 -0
- package/lib/output.udpTs/info.js.map +1 -1
- package/lib/output.udpTs/runtime.d.ts +1 -0
- package/lib/output.udpTs/runtime.js.map +1 -1
- package/lib/output.whep/info.d.ts +2 -2
- package/lib/output.whep/info.js +61 -1
- package/lib/output.whep/info.js.map +1 -1
- package/lib/output.whep/inline-view.d.ts +4 -0
- package/lib/output.whep/inline-view.js +57 -0
- package/lib/output.whep/inline-view.js.map +1 -0
- package/lib/output.whep/runtime.d.ts +39 -5
- package/lib/output.whep/runtime.js +175 -13
- package/lib/output.whep/runtime.js.map +1 -1
- package/lib/output.whep/summary-view.d.ts +4 -0
- package/lib/output.whep/summary-view.js +24 -0
- package/lib/output.whep/summary-view.js.map +1 -0
- package/lib/output.whep/types.d.ts +101 -0
- package/lib/output.whep/types.js +3 -0
- package/lib/output.whep/types.js.map +1 -0
- package/lib/output.whep/types.yaml +30 -0
- package/lib/processor.audioEncoder/form-views.d.ts +8 -0
- package/lib/processor.audioEncoder/form-views.js +8 -0
- package/lib/processor.audioEncoder/form-views.js.map +1 -0
- package/lib/processor.audioEncoder/info.d.ts +3 -0
- package/lib/processor.audioEncoder/info.js +160 -0
- package/lib/processor.audioEncoder/info.js.map +1 -0
- package/lib/processor.audioEncoder/runtime.d.ts +21 -0
- package/lib/processor.audioEncoder/runtime.js +20 -0
- package/lib/processor.audioEncoder/runtime.js.map +1 -0
- package/lib/processor.browserOverlay/info.js +1 -0
- package/lib/processor.browserOverlay/info.js.map +1 -1
- package/lib/processor.browserOverlay/runtime.d.ts +1 -0
- package/lib/processor.browserOverlay/runtime.js +6 -26
- package/lib/processor.browserOverlay/runtime.js.map +1 -1
- package/lib/processor.browserOverlay/types.js +3 -0
- package/lib/processor.browserOverlay/types.js.map +1 -0
- package/lib/processor.cascadingSwitch/info.js +3 -2
- package/lib/processor.cascadingSwitch/info.js.map +1 -1
- package/lib/processor.cascadingSwitch/inline-view.js +3 -3
- package/lib/processor.cascadingSwitch/runtime.d.ts +1 -0
- package/lib/processor.cascadingSwitch/runtime.js +2 -2
- package/lib/processor.cascadingSwitch/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/codec-editor.js +1 -1
- package/lib/processor.fixedLadder/codec-editor.js.map +1 -1
- package/lib/processor.fixedLadder/codec-view.d.ts +1 -1
- package/lib/processor.fixedLadder/codec-view.js +1 -1
- package/lib/processor.fixedLadder/codec-view.js.map +1 -1
- package/lib/processor.fixedLadder/info.d.ts +33 -7
- package/lib/processor.fixedLadder/info.js +19 -6
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/runtime.d.ts +16 -29
- package/lib/processor.fixedLadder/runtime.js +16 -1
- package/lib/processor.fixedLadder/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/types.d.ts +240 -0
- package/lib/processor.fixedLadder/types.js +3 -0
- package/lib/processor.fixedLadder/types.js.map +1 -0
- package/lib/processor.fixedLadder/types.yaml +541 -0
- package/lib/processor.onscreenGraphic/info.js +11 -5
- package/lib/processor.onscreenGraphic/info.js.map +1 -1
- package/lib/processor.onscreenGraphic/runtime.d.ts +27 -2
- package/lib/processor.onscreenGraphic/runtime.js +116 -52
- package/lib/processor.onscreenGraphic/runtime.js.map +1 -1
- package/lib/processor.onscreenGraphic/summary-view.d.ts +1 -1
- package/lib/processor.onscreenGraphic/summary-view.js +235 -11
- package/lib/processor.onscreenGraphic/summary-view.js.map +1 -1
- package/lib/processor.onscreenGraphic/types.d.ts +15 -1
- package/lib/processor.onscreenGraphic/types.yaml +63 -14
- package/lib/processor.streamKeyOverride/info.d.ts +3 -0
- package/lib/processor.streamKeyOverride/info.js +151 -0
- package/lib/processor.streamKeyOverride/info.js.map +1 -0
- package/lib/processor.streamKeyOverride/runtime.d.ts +55 -0
- package/lib/processor.streamKeyOverride/runtime.js +226 -0
- package/lib/processor.streamKeyOverride/runtime.js.map +1 -0
- package/lib/shared/api.d.ts +35 -0
- package/lib/shared/api.js +34 -0
- package/lib/shared/api.js.map +1 -0
- package/lib/test/auto-cmaf.js +219 -43
- package/lib/test/auto-cmaf.js.map +1 -1
- package/lib/test/onscreen-graphic.js +79 -42
- package/lib/test/onscreen-graphic.js.map +1 -1
- package/lib/test/preview.js +69 -64
- package/lib/test/preview.js.map +1 -1
- package/lib/test/rtmp-input.js +6 -3
- package/lib/test/rtmp-input.js.map +1 -1
- package/lib/test/rtmp-output.js +105 -1
- package/lib/test/rtmp-output.js.map +1 -1
- package/lib/test/srt-input-listener.js +331 -0
- package/lib/test/srt-input-listener.js.map +1 -1
- package/lib/test/srt-output.js +93 -4
- package/lib/test/srt-output.js.map +1 -1
- package/lib/test/whep-output.js +192 -5
- package/lib/test/whep-output.js.map +1 -1
- package/lib/util.stats.latency/info.js +1 -0
- package/lib/util.stats.latency/info.js.map +1 -1
- package/lib/util.stats.latency/runtime.d.ts +1 -0
- package/lib/util.stats.latency/runtime.js +2 -2
- package/lib/util.stats.latency/runtime.js.map +1 -1
- package/package.json +4 -4
- package/lib/processor.browserOverlay/openApi.js.map +0 -1
- package/lib/processor.whisper-transcribe/info.d.ts +0 -3
- package/lib/processor.whisper-transcribe/info.js +0 -44
- package/lib/processor.whisper-transcribe/info.js.map +0 -1
- package/lib/processor.whisper-transcribe/runtime.d.ts +0 -29
- package/lib/processor.whisper-transcribe/runtime.js +0 -83
- package/lib/processor.whisper-transcribe/runtime.js.map +0 -1
- package/lib/util.stats.ma35d/info.d.ts +0 -3
- package/lib/util.stats.ma35d/info.js +0 -79
- package/lib/util.stats.ma35d/info.js.map +0 -1
- package/lib/util.stats.ma35d/inline-view.d.ts +0 -6
- package/lib/util.stats.ma35d/inline-view.js +0 -76
- package/lib/util.stats.ma35d/inline-view.js.map +0 -1
- package/lib/util.stats.ma35d/runtime.d.ts +0 -21
- package/lib/util.stats.ma35d/runtime.js +0 -49
- package/lib/util.stats.ma35d/runtime.js.map +0 -1
- package/lib/util.timestamps/info.d.ts +0 -5
- package/lib/util.timestamps/info.js +0 -87
- package/lib/util.timestamps/info.js.map +0 -1
- package/lib/util.timestamps/inline-view.d.ts +0 -6
- package/lib/util.timestamps/inline-view.js +0 -94
- package/lib/util.timestamps/inline-view.js.map +0 -1
- package/lib/util.timestamps/runtime.d.ts +0 -29
- package/lib/util.timestamps/runtime.js +0 -40
- package/lib/util.timestamps/runtime.js.map +0 -1
- /package/lib/processor.browserOverlay/{openApi.d.ts → types.d.ts} +0 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
const react_1 = require("react");
|
5
|
+
const webrtc_client_1 = require("@norskvideo/webrtc-client");
|
6
|
+
function InlineView({ state, config, raise }) {
|
7
|
+
const url = state.url;
|
8
|
+
const id = config.id;
|
9
|
+
const [showPreview, setShowPreview] = (0, react_1.useState)(config.showPreview ?? true);
|
10
|
+
const [client, setClient] = (0, react_1.useState)(null);
|
11
|
+
const createClient = (url) => {
|
12
|
+
const newClient = new webrtc_client_1.WhepClient({
|
13
|
+
url,
|
14
|
+
container: document.getElementById(`whep-${id}`) ?? undefined,
|
15
|
+
});
|
16
|
+
newClient.start().catch(console.error);
|
17
|
+
return newClient;
|
18
|
+
};
|
19
|
+
const cleanupClient = (client) => {
|
20
|
+
client.outputVideoTracks.forEach(track => track.stop());
|
21
|
+
if (client.outputAudioTrack) {
|
22
|
+
client.outputAudioTrack.stop();
|
23
|
+
}
|
24
|
+
client.videoElements.forEach(video => {
|
25
|
+
video.srcObject = null;
|
26
|
+
video.remove();
|
27
|
+
});
|
28
|
+
};
|
29
|
+
(0, react_1.useEffect)(() => {
|
30
|
+
if (!url || !showPreview) {
|
31
|
+
if (client) {
|
32
|
+
cleanupClient(client);
|
33
|
+
setClient(null);
|
34
|
+
}
|
35
|
+
return;
|
36
|
+
}
|
37
|
+
const newClient = createClient(url);
|
38
|
+
setClient(newClient);
|
39
|
+
return () => {
|
40
|
+
cleanupClient(newClient);
|
41
|
+
};
|
42
|
+
}, [state.url, showPreview]);
|
43
|
+
(0, react_1.useEffect)(() => {
|
44
|
+
setShowPreview(config.showPreview ?? true);
|
45
|
+
}, [config.showPreview]);
|
46
|
+
raise && (0, react_1.useEffect)(raise, []);
|
47
|
+
if (!url)
|
48
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "..." });
|
49
|
+
const videoStyles = `
|
50
|
+
#whep-${id} video::-webkit-media-controls-play-button {
|
51
|
+
display: none;
|
52
|
+
}
|
53
|
+
`;
|
54
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "whep-container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "checkbox", id: `video-toggle-${id}`, checked: showPreview, onChange: (e) => setShowPreview(e.target.checked), className: "h-4 w-4" }), (0, jsx_runtime_1.jsx)("label", { htmlFor: `video-toggle-${id}`, className: "text-sm", children: "Show Preview" })] }), showPreview ? ((0, jsx_runtime_1.jsx)("div", { className: "whep-video", id: `whep-${id}`, children: (0, jsx_runtime_1.jsx)("style", { children: videoStyles }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "whep-video bg-black flex items-center justify-center text-white h-full", children: "Preview turned off" }))] }));
|
55
|
+
}
|
56
|
+
exports.default = InlineView;
|
57
|
+
//# sourceMappingURL=inline-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/output.whep/inline-view.tsx"],"names":[],"mappings":";;;AAAA,iCAA4C;AAE5C,6DAAuD;AAGvD,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAqE;IAC7G,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACtB,MAAM,EAAE,GAA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, WhepOutputSettings as SdkSettings } from '@norskvideo/norsk-sdk';
|
2
|
-
import { OnCreated, ServerComponentDefinition, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
-
import {
|
1
|
+
import { Norsk, WhepOutputSettings as SdkSettings, WhepOutputNode } from '@norskvideo/norsk-sdk';
|
2
|
+
import { CreatedMediaNode, InstanceRouteInfo, OnCreated, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomSinkNode, SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
4
|
import { IceServer } from '@norskvideo/norsk-studio/lib/shared/config';
|
5
|
+
import { ContextPromiseControl } from '@norskvideo/norsk-studio/lib/runtime/util';
|
5
6
|
export type WhepOutputSettings = {
|
6
7
|
id: string;
|
7
8
|
displayName: string;
|
9
|
+
notes?: string;
|
8
10
|
bufferDelayMs?: SdkSettings['bufferDelayMs'];
|
11
|
+
showPreview?: boolean;
|
9
12
|
__global: {
|
10
13
|
iceServers: IceServer[];
|
11
14
|
};
|
12
15
|
};
|
13
|
-
export
|
14
|
-
|
16
|
+
export type WhepOutputState = {
|
17
|
+
url?: string;
|
18
|
+
enabled: boolean;
|
19
|
+
};
|
20
|
+
export type WhepOutputEvent = {
|
21
|
+
type: 'output-enabled' | 'output-disabled';
|
22
|
+
} | {
|
23
|
+
type: 'url-published';
|
24
|
+
url: string;
|
25
|
+
};
|
26
|
+
export type WhepOutputCommand = {
|
27
|
+
type: "enable-output" | "disable-output";
|
28
|
+
};
|
29
|
+
export declare class WhepOutput extends CustomSinkNode {
|
30
|
+
norsk: Norsk;
|
31
|
+
runtime: StudioRuntime<WhepOutputState, WhepOutputCommand, WhepOutputEvent>;
|
32
|
+
cfg: WhepOutputSettings;
|
33
|
+
whep?: WhepOutputNode;
|
34
|
+
context: ContextPromiseControl;
|
35
|
+
currentSources: Map<CreatedMediaNode, StudioNodeSubscriptionSource>;
|
36
|
+
initialised: Promise<void>;
|
37
|
+
enabled: boolean;
|
38
|
+
static create(norsk: Norsk, cfg: WhepOutputSettings, runtime: StudioRuntime<WhepOutputState, WhepOutputCommand, WhepOutputEvent>): Promise<WhepOutput>;
|
39
|
+
constructor(cfg: WhepOutputSettings, norsk: Norsk, runtime: StudioRuntime<WhepOutputState, WhepOutputCommand, WhepOutputEvent>);
|
40
|
+
subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts): void;
|
41
|
+
subscribeImpl(sources: StudioNodeSubscriptionSource[]): Promise<void>;
|
42
|
+
enableOutput(): Promise<void>;
|
43
|
+
disableOutput(): Promise<void>;
|
44
|
+
}
|
45
|
+
export default class WhepOutputDefinition implements ServerComponentDefinition<WhepOutputSettings, WhepOutput, WhepOutputState, WhepOutputCommand, WhepOutputEvent> {
|
46
|
+
create(norsk: Norsk, cfg: WhepOutputSettings, cb: OnCreated<WhepOutput>, runtime: StudioRuntime<WhepOutputState, WhepOutputCommand, WhepOutputEvent>): Promise<void>;
|
47
|
+
handleCommand(node: WhepOutput, command: WhepOutputCommand): Promise<void>;
|
48
|
+
instanceRoutes(): Promise<InstanceRouteInfo<WhepOutputSettings, WhepOutput, WhepOutputState, WhepOutputCommand, WhepOutputEvent>[]>;
|
15
49
|
}
|
@@ -1,21 +1,183 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.WhepOutput = void 0;
|
3
7
|
const base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
4
8
|
const webrtcSettings_1 = require("../shared/webrtcSettings");
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
const util_1 = require("@norskvideo/norsk-studio/lib/runtime/util");
|
10
|
+
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
11
|
+
const json_refs_1 = require("json-refs");
|
12
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
13
|
+
const path_1 = __importDefault(require("path"));
|
14
|
+
const yaml_1 = __importDefault(require("yaml"));
|
15
|
+
class WhepOutput extends base_nodes_1.CustomSinkNode {
|
16
|
+
norsk;
|
17
|
+
runtime;
|
18
|
+
cfg;
|
19
|
+
whep;
|
20
|
+
context = new util_1.ContextPromiseControl(this.subscribeImpl.bind(this));
|
21
|
+
currentSources = new Map();
|
22
|
+
initialised;
|
23
|
+
enabled = true;
|
24
|
+
static async create(norsk, cfg, runtime) {
|
25
|
+
const node = new WhepOutput(cfg, norsk, runtime);
|
26
|
+
await node.initialised;
|
27
|
+
return node;
|
28
|
+
}
|
29
|
+
constructor(cfg, norsk, runtime) {
|
30
|
+
super(cfg.id);
|
31
|
+
this.cfg = cfg;
|
32
|
+
this.norsk = norsk;
|
33
|
+
this.runtime = runtime;
|
34
|
+
this.initialised = Promise.resolve();
|
35
|
+
}
|
36
|
+
subscribe(sources, _opts) {
|
37
|
+
this.currentSources = new Map();
|
38
|
+
sources.forEach((s) => {
|
39
|
+
this.currentSources.set(s.source, s);
|
16
40
|
});
|
17
|
-
|
18
|
-
|
41
|
+
this.context.setSources(sources);
|
42
|
+
}
|
43
|
+
async subscribeImpl(sources) {
|
44
|
+
if (!this.enabled) {
|
45
|
+
(0, logging_1.debuglog)("Skipping subscription - output disabled", { id: this.id });
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
const videoSource = sources.filter((s) => s.streams.select.includes("video")).at(0)?.selectVideo();
|
49
|
+
const audioSource = sources.filter((s) => s.streams.select.includes("audio")).at(0)?.selectAudio();
|
50
|
+
const subscriptions = [];
|
51
|
+
if (videoSource && videoSource.length > 0) {
|
52
|
+
subscriptions.push(videoSource[0]);
|
53
|
+
}
|
54
|
+
if (audioSource && audioSource.length > 0) {
|
55
|
+
subscriptions.push(audioSource[0]);
|
56
|
+
}
|
57
|
+
if (subscriptions.length > 0) {
|
58
|
+
if (!this.whep) {
|
59
|
+
const whepCfg = {
|
60
|
+
id: `${this.cfg.id}-whep`,
|
61
|
+
bufferDelayMs: this.cfg.bufferDelayMs,
|
62
|
+
onPublishStart: () => {
|
63
|
+
const url = this.whep?.endpointUrl;
|
64
|
+
if (url) {
|
65
|
+
this.runtime.updates.raiseEvent({ type: 'url-published', url });
|
66
|
+
}
|
67
|
+
},
|
68
|
+
...(0, webrtcSettings_1.webRtcSettings)(this.cfg.__global.iceServers)
|
69
|
+
};
|
70
|
+
this.whep = await this.norsk.output.whep(whepCfg);
|
71
|
+
}
|
72
|
+
this.whep?.subscribe(subscriptions, (ctx) => {
|
73
|
+
return ctx.streams.length === subscriptions.length;
|
74
|
+
});
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
await this.whep?.close();
|
78
|
+
this.whep = undefined;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
async enableOutput() {
|
82
|
+
if (!this.enabled) {
|
83
|
+
this.enabled = true;
|
84
|
+
const sources = Array.from(this.currentSources.values());
|
85
|
+
(0, logging_1.debuglog)("Sources", sources);
|
86
|
+
await this.subscribeImpl(sources);
|
87
|
+
this.runtime.updates.raiseEvent({ type: 'output-enabled' });
|
88
|
+
(0, logging_1.debuglog)("Output enabled", { id: this.id });
|
89
|
+
}
|
90
|
+
}
|
91
|
+
async disableOutput() {
|
92
|
+
if (this.enabled) {
|
93
|
+
this.enabled = false;
|
94
|
+
if (this.whep) {
|
95
|
+
await this.whep.close();
|
96
|
+
this.whep = undefined;
|
97
|
+
}
|
98
|
+
this.runtime.updates.raiseEvent({ type: 'output-disabled' });
|
99
|
+
(0, logging_1.debuglog)("Output disabled", { id: this.id });
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
exports.WhepOutput = WhepOutput;
|
104
|
+
function coreInfo(path, op) {
|
105
|
+
return {
|
106
|
+
url: path,
|
107
|
+
summary: op.summary,
|
108
|
+
description: op.description,
|
109
|
+
requestBody: op.requestBody,
|
110
|
+
responses: op.responses,
|
111
|
+
};
|
112
|
+
}
|
113
|
+
function post(path, paths) {
|
114
|
+
return {
|
115
|
+
...coreInfo(path, paths[path]['post']),
|
116
|
+
method: 'POST',
|
117
|
+
};
|
118
|
+
}
|
119
|
+
class WhepOutputDefinition {
|
120
|
+
async create(norsk, cfg, cb, runtime) {
|
121
|
+
const node = new WhepOutput(cfg, norsk, runtime);
|
122
|
+
runtime.report.registerOutput(cfg.id, node.whep?.endpointUrl);
|
123
|
+
await node.initialised;
|
124
|
+
cb(node);
|
125
|
+
}
|
126
|
+
async handleCommand(node, command) {
|
127
|
+
switch (command.type) {
|
128
|
+
case 'enable-output':
|
129
|
+
await node.enableOutput();
|
130
|
+
break;
|
131
|
+
case 'disable-output':
|
132
|
+
await node.disableOutput();
|
133
|
+
break;
|
134
|
+
}
|
135
|
+
}
|
136
|
+
async instanceRoutes() {
|
137
|
+
const types = await promises_1.default.readFile(path_1.default.join(__dirname, 'types.yaml'));
|
138
|
+
const root = yaml_1.default.parse(types.toString());
|
139
|
+
const resolved = await (0, json_refs_1.resolveRefs)(root, {}).then((r) => r.resolved);
|
140
|
+
const paths = resolved.paths;
|
141
|
+
return [
|
142
|
+
{
|
143
|
+
...post('/enable', paths),
|
144
|
+
handler: ({ runtime }) => async (_req, res) => {
|
145
|
+
try {
|
146
|
+
const state = runtime.updates.latest();
|
147
|
+
if (state.enabled) {
|
148
|
+
return res.status(400).json({ error: 'Output is already enabled' });
|
149
|
+
}
|
150
|
+
runtime.updates.sendCommand({
|
151
|
+
type: 'enable-output'
|
152
|
+
});
|
153
|
+
res.sendStatus(204);
|
154
|
+
}
|
155
|
+
catch (error) {
|
156
|
+
console.error('Error in enable handler:', error);
|
157
|
+
res.status(500).json({ error: 'Failed to enable output' });
|
158
|
+
}
|
159
|
+
}
|
160
|
+
},
|
161
|
+
{
|
162
|
+
...post('/disable', paths),
|
163
|
+
handler: ({ runtime }) => async (_req, res) => {
|
164
|
+
try {
|
165
|
+
const state = runtime.updates.latest();
|
166
|
+
if (!state.enabled) {
|
167
|
+
return res.status(400).json({ error: 'Output is already disabled' });
|
168
|
+
}
|
169
|
+
runtime.updates.sendCommand({
|
170
|
+
type: 'disable-output'
|
171
|
+
});
|
172
|
+
res.sendStatus(204);
|
173
|
+
}
|
174
|
+
catch (error) {
|
175
|
+
console.error('Error in disable handler:', error);
|
176
|
+
res.status(500).json({ error: 'Failed to disable output' });
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
];
|
19
181
|
}
|
20
182
|
}
|
21
183
|
exports.default = WhepOutputDefinition;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.whep/runtime.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.whep/runtime.ts"],"names":[],"mappings":";;;;;;AAEA,kFAAqG;AAErG,6DAA0D;AAC1D,oEAAkF;AAClF,yEAAuE;AACvE,yCAAwC;AAExC,2DAA6B;AAC7B,gDAAwB;AACxB,gDAAwB;AA2BxB,MAAa,UAAW,SAAQ,2BAAc;IAC5C,KAAK,CAAQ;IACb,OAAO,CAAqE;IAE5E,GAAG,CAAqB;IACxB,IAAI,CAAkB;IACtB,OAAO,GAA0B,IAAI,4BAAqB,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1F,cAAc,GAAwD,IAAI,GAAG,EAAE,CAAC;IAEhF,WAAW,CAAe;IAC1B,OAAO,GAAY,IAAI,CAAC;IAExB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAuB,EAAE,OAA2E;QACpI,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,IAAI,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AM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;wBACvC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;4BACnB,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;wBACvE,CAAC;wBACD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC1B,IAAI,EAAE,gBAAgB;yBACvB,CAAC,CAAC;wBACH,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBACtB,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;wBAClD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;oBAC9D,CAAC;gBACH,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAhED,uCAgEC"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import type { WhepOutputSettings, WhepOutputCommand, WhepOutputState } from "./runtime";
|
2
|
+
import { ViewProps } from "@norskvideo/norsk-studio/lib/extension/client-types";
|
3
|
+
declare function SummaryView({ state, sendCommand, }: ViewProps<WhepOutputSettings, WhepOutputState, WhepOutputCommand>): import("react/jsx-runtime").JSX.Element;
|
4
|
+
export default SummaryView;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
+
function SummaryView({ state, sendCommand, }) {
|
5
|
+
const handleEnableOutput = () => {
|
6
|
+
void enableOutput();
|
7
|
+
};
|
8
|
+
const enableOutput = async () => {
|
9
|
+
sendCommand({
|
10
|
+
type: "enable-output",
|
11
|
+
});
|
12
|
+
};
|
13
|
+
const handleDisableOutput = () => {
|
14
|
+
void disableOutput();
|
15
|
+
};
|
16
|
+
const disableOutput = async () => {
|
17
|
+
sendCommand({
|
18
|
+
type: "disable-output",
|
19
|
+
});
|
20
|
+
};
|
21
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "mb-5", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center space-x-2", children: [(0, jsx_runtime_1.jsx)("span", { className: `inline-block w-2 h-2 rounded-full ${state.enabled ? "bg-blue-500" : "bg-red-500"}` }), (0, jsx_runtime_1.jsxs)("span", { className: "text-sm", children: ["Status: ", state.enabled ? "Enabled" : "Disabled"] })] }), (0, jsx_runtime_1.jsx)("div", { children: state.enabled ? ((0, jsx_runtime_1.jsx)("button", { onClick: handleDisableOutput, className: "px-3 py-1 text-sm bg-red-600 hover:bg-red-700 text-white rounded", children: "Disable Output" })) : ((0, jsx_runtime_1.jsx)("button", { onClick: handleEnableOutput, className: "px-3 py-1 text-sm bg-blue-600 hover:bg-blue-700 text-white rounded", children: "Enable Output" })) })] }) }));
|
22
|
+
}
|
23
|
+
exports.default = SummaryView;
|
24
|
+
//# sourceMappingURL=summary-view.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/output.whep/summary-view.tsx"],"names":[],"mappings":";;;AAOA,SAAS,WAAW,CAAC,EACnB,KAAK,EACL,WAAW,GACuD;IAElE,MAAM,kBAAkB,GAAG,GAAS,EAAE;QACpC,KAAK,YAAY,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;QAC9B,WAAW,CAAC;YACV,IAAI,EAAE,eAAe;SACtB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,GAAS,EAAE;QACrC,KAAK,aAAa,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,KAAK,IAAI,EAAE;QAC/B,WAAW,CAAC;YACV,IAAI,EAAE,gBAAgB;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,gCAAK,SAAS,EAAC,MAAM,YACnB,iCAAK,SAAS,EAAC,wCAAwC,aACrD,iCAAK,SAAS,EAAC,6BAA6B,aAC1C,iCACE,SAAS,EAAE,qCACT,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAClC,EAAE,GACI,EACR,kCAAM,SAAS,EAAC,SAAS,yBACd,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAC1C,IACH,EACN,0CACG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CACf,mCACE,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAC,kEAAkE,+BAGrE,CACV,CAAC,CAAC,CAAC,CACF,mCACE,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAC,oEAAoE,8BAGvE,CACV,GACG,IACF,GACF,CACP,CAAC;AACJ,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
export interface paths {
|
2
|
+
"/enable": {
|
3
|
+
parameters: {
|
4
|
+
query?: never;
|
5
|
+
header?: never;
|
6
|
+
path?: never;
|
7
|
+
cookie?: never;
|
8
|
+
};
|
9
|
+
get?: never;
|
10
|
+
put?: never;
|
11
|
+
post: {
|
12
|
+
parameters: {
|
13
|
+
query?: never;
|
14
|
+
header?: never;
|
15
|
+
path?: never;
|
16
|
+
cookie?: never;
|
17
|
+
};
|
18
|
+
requestBody?: never;
|
19
|
+
responses: {
|
20
|
+
204: {
|
21
|
+
headers: {
|
22
|
+
[name: string]: unknown;
|
23
|
+
};
|
24
|
+
content?: never;
|
25
|
+
};
|
26
|
+
400: {
|
27
|
+
headers: {
|
28
|
+
[name: string]: unknown;
|
29
|
+
};
|
30
|
+
content?: never;
|
31
|
+
};
|
32
|
+
500: {
|
33
|
+
headers: {
|
34
|
+
[name: string]: unknown;
|
35
|
+
};
|
36
|
+
content?: never;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
delete?: never;
|
41
|
+
options?: never;
|
42
|
+
head?: never;
|
43
|
+
patch?: never;
|
44
|
+
trace?: never;
|
45
|
+
};
|
46
|
+
"/disable": {
|
47
|
+
parameters: {
|
48
|
+
query?: never;
|
49
|
+
header?: never;
|
50
|
+
path?: never;
|
51
|
+
cookie?: never;
|
52
|
+
};
|
53
|
+
get?: never;
|
54
|
+
put?: never;
|
55
|
+
post: {
|
56
|
+
parameters: {
|
57
|
+
query?: never;
|
58
|
+
header?: never;
|
59
|
+
path?: never;
|
60
|
+
cookie?: never;
|
61
|
+
};
|
62
|
+
requestBody?: never;
|
63
|
+
responses: {
|
64
|
+
204: {
|
65
|
+
headers: {
|
66
|
+
[name: string]: unknown;
|
67
|
+
};
|
68
|
+
content?: never;
|
69
|
+
};
|
70
|
+
400: {
|
71
|
+
headers: {
|
72
|
+
[name: string]: unknown;
|
73
|
+
};
|
74
|
+
content?: never;
|
75
|
+
};
|
76
|
+
500: {
|
77
|
+
headers: {
|
78
|
+
[name: string]: unknown;
|
79
|
+
};
|
80
|
+
content?: never;
|
81
|
+
};
|
82
|
+
};
|
83
|
+
};
|
84
|
+
delete?: never;
|
85
|
+
options?: never;
|
86
|
+
head?: never;
|
87
|
+
patch?: never;
|
88
|
+
trace?: never;
|
89
|
+
};
|
90
|
+
}
|
91
|
+
export type webhooks = Record<string, never>;
|
92
|
+
export interface components {
|
93
|
+
schemas: never;
|
94
|
+
responses: never;
|
95
|
+
parameters: never;
|
96
|
+
requestBodies: never;
|
97
|
+
headers: never;
|
98
|
+
pathItems: never;
|
99
|
+
}
|
100
|
+
export type $defs = Record<string, never>;
|
101
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/output.whep/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Whep Output Component
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
paths:
|
7
|
+
/enable:
|
8
|
+
post:
|
9
|
+
summary: Enable WHEP output
|
10
|
+
description: Enables output if currently disabled
|
11
|
+
x-route-type: instance
|
12
|
+
responses:
|
13
|
+
204:
|
14
|
+
description: Output successfully enabled
|
15
|
+
400:
|
16
|
+
description: Output is already enabled
|
17
|
+
500:
|
18
|
+
description: Server error while enabling output
|
19
|
+
/disable:
|
20
|
+
post:
|
21
|
+
summary: Disable WHEP output
|
22
|
+
description: Disables output if currently enabled
|
23
|
+
x-route-type: instance
|
24
|
+
responses:
|
25
|
+
204:
|
26
|
+
description: Output successfully disabled
|
27
|
+
400:
|
28
|
+
description: Output is already disabled
|
29
|
+
500:
|
30
|
+
description: Server error while disabling output
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.default = CodecConfiguration;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
function CodecConfiguration(cfg) {
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "grid grid-flow-row-dense grid-cols-3 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Codec" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: cfg.kind }), cfg.kind === 'aac' ? (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Profile" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: cfg.profile }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Sample Rate" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: cfg.sampleRate })] }) : null] }));
|
7
|
+
}
|
8
|
+
//# sourceMappingURL=form-views.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"form-views.js","sourceRoot":"","sources":["../../src/processor.audioEncoder/form-views.tsx"],"names":[],"mappings":";;AAEA,qCAoBC;;AApBD,SAAwB,kBAAkB,CAAC,GAOxC;IACD,OAAO,CAAC,iCAAK,SAAS,EAAC,8CAA8C,aACnE,gCAAK,SAAS,EAAC,YAAY,sBAAY,EACvC,gCAAK,SAAS,EAAC,YAAY,YAAE,GAAG,CAAC,IAAI,GAAO,EAE3C,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,6DACtB,gCAAK,SAAS,EAAC,YAAY,wBAAc,EACzC,gCAAK,SAAS,EAAC,YAAY,YAAE,GAAG,CAAC,OAAO,GAAO,EAE/C,gCAAK,SAAS,EAAC,YAAY,4BAAkB,EAC7C,gCAAK,SAAS,EAAC,YAAY,YAAE,GAAG,CAAC,UAAU,GAAO,IAC/C,CAAC,CAAC,CAAC,IAAI,IACL,CAAC,CAAA;AACV,CAAC"}
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
2
|
+
import type { AudioEncoderConfig } from "./runtime";
|
3
|
+
export default function ({ defineComponent, Audio, validation: { Z }, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<AudioEncoderConfig, object, object, object>;
|