@norskvideo/norsk-studio-built-ins 1.12.0-2025-01-28-9ee30e1e → 1.12.0-2025-02-02-6cada821
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 +57 -61
- package/client/style.css +0 -4
- package/lib/input.rtmp/info.js +9 -3
- 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 +24 -5
- package/lib/input.rtmp/runtime.js +114 -34
- package/lib/input.rtmp/runtime.js.map +1 -1
- package/lib/input.rtmp/summary-view.d.ts +1 -1
- package/lib/input.rtmp/summary-view.js +47 -22
- package/lib/input.rtmp/summary-view.js.map +1 -1
- package/lib/input.rtmp/types.d.ts +61 -1
- package/lib/input.rtmp/types.yaml +55 -7
- package/lib/input.srt-listener/summary-view.d.ts +1 -1
- package/lib/input.srt-listener/summary-view.js +3 -33
- package/lib/input.srt-listener/summary-view.js.map +1 -1
- package/package.json +3 -3
package/client/info.js
CHANGED
@@ -52,11 +52,11 @@ __export(inline_view_exports, {
|
|
52
52
|
});
|
53
53
|
function InlineView({ state, config }) {
|
54
54
|
const maxSourceNum = 4;
|
55
|
-
const sourcesToRender = state.
|
56
|
-
if (state.
|
55
|
+
const sourcesToRender = state.connectedStreams.slice(0, maxSourceNum);
|
56
|
+
if (state.connectedStreams.length > maxSourceNum) {
|
57
57
|
sourcesToRender.push("...");
|
58
58
|
}
|
59
|
-
const connectedSources = (0, import_jsx_runtime.jsxs)("div", { className: "mt-2", children: [state.
|
59
|
+
const connectedSources = (0, import_jsx_runtime.jsxs)("div", { className: "mt-2", children: [state.connectedStreams.length > 0 ? (0, import_jsx_runtime.jsx)("span", { children: "Connected sources" }) : (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}), (0, import_jsx_runtime.jsx)("ul", { className: "rtmp-input-connected-sources", children: sourcesToRender.map((sourceName) => {
|
60
60
|
return (0, import_jsx_runtime.jsx)("li", { className: "text-green-300", children: sourceName }, sourceName);
|
61
61
|
}) })] });
|
62
62
|
return (0, import_jsx_runtime.jsx)("div", { className: "rtmp-input", id: `rtmp-input-${config.id}`, children: connectedSources });
|
@@ -75,40 +75,60 @@ var summary_view_exports = {};
|
|
75
75
|
__export(summary_view_exports, {
|
76
76
|
default: () => summary_view_default
|
77
77
|
});
|
78
|
-
function SummaryView({ state, config,
|
78
|
+
function SummaryView({ state, config, sendCommand }) {
|
79
79
|
const connectedSources = [];
|
80
80
|
const disconnectedSources = [];
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
const resetStream = async (streamName) => {
|
82
|
+
try {
|
83
|
+
sendCommand({
|
84
|
+
type: "reset-source",
|
85
|
+
streamName
|
86
|
+
});
|
87
|
+
} catch (error) {
|
88
|
+
console.error("Failed to disconnect stream:", error);
|
86
89
|
}
|
87
|
-
});
|
88
|
-
const handleDisconnectStream = (streamName) => {
|
89
|
-
void disconnectStream(streamName);
|
90
90
|
};
|
91
|
-
const
|
91
|
+
const disableStream = async (streamName) => {
|
92
92
|
try {
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
"Content-Type": "application/json"
|
97
|
-
},
|
98
|
-
body: JSON.stringify({ streamName })
|
93
|
+
sendCommand({
|
94
|
+
type: "disable-source",
|
95
|
+
streamName
|
99
96
|
});
|
100
|
-
|
101
|
-
|
102
|
-
|
97
|
+
} catch (error) {
|
98
|
+
console.error("Failed to disable stream:", error);
|
99
|
+
}
|
100
|
+
};
|
101
|
+
const enableStream = async (streamName) => {
|
102
|
+
try {
|
103
103
|
sendCommand({
|
104
|
-
type: "
|
104
|
+
type: "enable-source",
|
105
105
|
streamName
|
106
106
|
});
|
107
107
|
} catch (error) {
|
108
|
-
console.error("Failed to
|
108
|
+
console.error("Failed to enable stream:", error);
|
109
109
|
}
|
110
110
|
};
|
111
|
-
|
111
|
+
const handleResetStream = (streamName) => {
|
112
|
+
void resetStream(streamName);
|
113
|
+
};
|
114
|
+
const handleDisableStream = (streamName) => {
|
115
|
+
void disableStream(streamName);
|
116
|
+
};
|
117
|
+
const handleEnableStream = (streamName) => {
|
118
|
+
void enableStream(streamName);
|
119
|
+
};
|
120
|
+
config.streamNames.forEach((streamName) => {
|
121
|
+
if (state.connectedStreams.includes(streamName)) {
|
122
|
+
connectedSources.push(streamName);
|
123
|
+
} else {
|
124
|
+
disconnectedSources.push(streamName);
|
125
|
+
}
|
126
|
+
});
|
127
|
+
return (0, import_jsx_runtime2.jsxs)("div", { className: "dark:text-white text-black mb-3 w-60", children: [(0, import_jsx_runtime2.jsxs)("div", { id: "rtmp-sources-connected", children: [(0, import_jsx_runtime2.jsx)("span", { children: "Connected Sources" }), (0, import_jsx_runtime2.jsx)("ul", { children: connectedSources.map((streamName) => {
|
128
|
+
return (0, import_jsx_runtime2.jsxs)("li", { className: "text-green-300", children: [streamName, (0, import_jsx_runtime2.jsx)("button", { onClick: () => handleResetStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Reset" }), (0, import_jsx_runtime2.jsx)("button", { onClick: () => handleDisableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Disable" })] }, streamName);
|
129
|
+
}) })] }), (0, import_jsx_runtime2.jsxs)("div", { id: "rtmp-sources-disconnected", className: "mt-3", children: [(0, import_jsx_runtime2.jsx)("span", { children: "Disconnected Sources" }), (0, import_jsx_runtime2.jsx)("ul", { children: disconnectedSources.map((streamName) => {
|
130
|
+
return (0, import_jsx_runtime2.jsxs)("li", { className: "text-orange-300", children: [streamName, state.disabledStreams.includes(streamName) ? (0, import_jsx_runtime2.jsx)("button", { onClick: () => handleEnableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-blue-600 hover:bg-blue-700 text-white rounded", children: "Enable" }) : (0, import_jsx_runtime2.jsx)("button", { onClick: () => handleDisableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Disable" })] }, streamName);
|
131
|
+
}) })] })] });
|
112
132
|
}
|
113
133
|
var import_jsx_runtime2, summary_view_default;
|
114
134
|
var init_summary_view = __esm({
|
@@ -166,21 +186,11 @@ var summary_view_exports2 = {};
|
|
166
186
|
__export(summary_view_exports2, {
|
167
187
|
default: () => summary_view_default2
|
168
188
|
});
|
169
|
-
function SummaryView3({ state, config,
|
189
|
+
function SummaryView3({ state, config, sendCommand }) {
|
170
190
|
const connectedSources = [];
|
171
191
|
const disconnectedSources = [];
|
172
192
|
const resetStream = async (streamId) => {
|
173
193
|
try {
|
174
|
-
const response = await fetch(`${urls.instanceUrl}/disconnect`, {
|
175
|
-
method: "POST",
|
176
|
-
headers: {
|
177
|
-
"Content-Type": "application/json"
|
178
|
-
},
|
179
|
-
body: JSON.stringify({ streamId })
|
180
|
-
});
|
181
|
-
if (!response.ok) {
|
182
|
-
console.error("Stream failed to disconnect");
|
183
|
-
}
|
184
194
|
sendCommand({
|
185
195
|
type: "reset-source",
|
186
196
|
streamId
|
@@ -191,18 +201,8 @@ function SummaryView3({ state, config, urls, sendCommand }) {
|
|
191
201
|
};
|
192
202
|
const disableStream = async (streamId) => {
|
193
203
|
try {
|
194
|
-
const response = await fetch(`${urls.instanceUrl}/disable`, {
|
195
|
-
method: "POST",
|
196
|
-
headers: {
|
197
|
-
"Content-Type": "application/json"
|
198
|
-
},
|
199
|
-
body: JSON.stringify({ streamId })
|
200
|
-
});
|
201
|
-
if (!response.ok) {
|
202
|
-
console.error("Failed to disable stream");
|
203
|
-
}
|
204
204
|
sendCommand({
|
205
|
-
type: "
|
205
|
+
type: "disable-source",
|
206
206
|
streamId
|
207
207
|
});
|
208
208
|
} catch (error) {
|
@@ -211,18 +211,8 @@ function SummaryView3({ state, config, urls, sendCommand }) {
|
|
211
211
|
};
|
212
212
|
const enableStream = async (streamId) => {
|
213
213
|
try {
|
214
|
-
const response = await fetch(`${urls.instanceUrl}/enable`, {
|
215
|
-
method: "POST",
|
216
|
-
headers: {
|
217
|
-
"Content-Type": "application/json"
|
218
|
-
},
|
219
|
-
body: JSON.stringify({ streamId })
|
220
|
-
});
|
221
|
-
if (!response.ok) {
|
222
|
-
console.error("Failed to enable stream");
|
223
|
-
}
|
224
214
|
sendCommand({
|
225
|
-
type: "
|
215
|
+
type: "enable-source",
|
226
216
|
streamId
|
227
217
|
});
|
228
218
|
} catch (error) {
|
@@ -15925,15 +15915,21 @@ function info_default({ defineComponent, Av, validation: { Z, Port, SourceName,
|
|
15925
15915
|
};
|
15926
15916
|
},
|
15927
15917
|
runtime: {
|
15928
|
-
initialState: () => ({
|
15918
|
+
initialState: () => ({ connectedStreams: [], disabledStreams: [] }),
|
15929
15919
|
handleEvent(ev, state) {
|
15930
15920
|
const evType = ev.type;
|
15931
15921
|
switch (evType) {
|
15932
15922
|
case "source-connected":
|
15933
|
-
state.
|
15923
|
+
state.connectedStreams.push(ev.streamName);
|
15934
15924
|
break;
|
15935
15925
|
case "source-disconnected":
|
15936
|
-
state.
|
15926
|
+
state.connectedStreams = state.connectedStreams.filter((s) => s !== ev.streamName);
|
15927
|
+
break;
|
15928
|
+
case "source-enabled":
|
15929
|
+
state.disabledStreams = state.disabledStreams.filter((streamName) => streamName !== ev.streamName);
|
15930
|
+
break;
|
15931
|
+
case "source-disabled":
|
15932
|
+
state.disabledStreams.push(ev.streamName);
|
15937
15933
|
break;
|
15938
15934
|
default:
|
15939
15935
|
assertUnreachable(evType);
|
package/client/style.css
CHANGED
package/lib/input.rtmp/info.js
CHANGED
@@ -60,15 +60,21 @@ function default_1({ defineComponent, Av, validation: { Z, Port, SourceName, uni
|
|
60
60
|
};
|
61
61
|
},
|
62
62
|
runtime: {
|
63
|
-
initialState: () => ({
|
63
|
+
initialState: () => ({ connectedStreams: [], disabledStreams: [] }),
|
64
64
|
handleEvent(ev, state) {
|
65
65
|
const evType = ev.type;
|
66
66
|
switch (evType) {
|
67
67
|
case "source-connected":
|
68
|
-
state.
|
68
|
+
state.connectedStreams.push(ev.streamName);
|
69
69
|
break;
|
70
70
|
case "source-disconnected":
|
71
|
-
state.
|
71
|
+
state.connectedStreams = state.connectedStreams.filter((s) => s !== ev.streamName);
|
72
|
+
break;
|
73
|
+
case "source-enabled":
|
74
|
+
state.disabledStreams = state.disabledStreams.filter((streamName) => streamName !== ev.streamName);
|
75
|
+
break;
|
76
|
+
case "source-disabled":
|
77
|
+
state.disabledStreams.push(ev.streamName);
|
72
78
|
break;
|
73
79
|
default:
|
74
80
|
assertUnreachable(evType);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.rtmp/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/input.rtmp/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,4BA0EC;AAhFD,kDAA0B;AAC1B,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,eAAe,GAAC,CAAC,CAAC;AACnE,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,gBAAgB,GAAC,CAAC,CAAC;AAErE,MAAM,WAAW,GAAG,IAAI,CAAC;AAEzB,mBAAwB,EACtB,eAAe,EACf,EAAE,EACF,UAAU,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,EAAgB;IAC3D,OAAO,eAAe,CACpB;QACE,UAAU,EAAE,YAAY;QACxB,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,mEAAmE;QAChF,YAAY,EAAE;YACZ,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE;gBACR,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,EAAE;gBACjB,IAAI,EAAE,CAAC,GAAG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AAM,CAAC,YAAY,CAAC;qBAC7B;iBACF;aACF;SACF;KACF,CAAC,CAAC;AACP,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
4
|
function InlineView({ state, config }) {
|
5
5
|
const maxSourceNum = 4;
|
6
|
-
const sourcesToRender = state.
|
7
|
-
if (state.
|
6
|
+
const sourcesToRender = state.connectedStreams.slice(0, maxSourceNum);
|
7
|
+
if (state.connectedStreams.length > maxSourceNum) {
|
8
8
|
sourcesToRender.push("...");
|
9
9
|
}
|
10
|
-
const connectedSources = (0, jsx_runtime_1.jsxs)("div", { className: "mt-2", children: [state.
|
10
|
+
const connectedSources = (0, jsx_runtime_1.jsxs)("div", { className: "mt-2", children: [state.connectedStreams.length > 0 ? (0, jsx_runtime_1.jsx)("span", { children: "Connected sources" }) : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), (0, jsx_runtime_1.jsx)("ul", { className: "rtmp-input-connected-sources", children: sourcesToRender.map((sourceName) => {
|
11
11
|
return (0, jsx_runtime_1.jsx)("li", { className: "text-green-300", children: sourceName }, sourceName);
|
12
12
|
}) })] });
|
13
13
|
return (0, jsx_runtime_1.jsx)("div", { className: "rtmp-input", id: `rtmp-input-${config.id}`, children: connectedSources });
|
@@ -7,14 +7,30 @@ export type RtmpInputSettings = Pick<SdkSettings, 'port' | 'ssl'> & {
|
|
7
7
|
streamNames: string[];
|
8
8
|
};
|
9
9
|
export type RtmpInputState = {
|
10
|
-
|
10
|
+
connectedStreams: string[];
|
11
|
+
disabledStreams: string[];
|
11
12
|
};
|
12
13
|
export type RtmpInputEvent = {
|
13
|
-
type: "source-connected"
|
14
|
+
type: "source-connected";
|
15
|
+
streamName: string;
|
16
|
+
} | {
|
17
|
+
type: "source-disconnected";
|
18
|
+
streamName: string;
|
19
|
+
} | {
|
20
|
+
type: "source-enabled";
|
21
|
+
streamName: string;
|
22
|
+
} | {
|
23
|
+
type: "source-disabled";
|
14
24
|
streamName: string;
|
15
25
|
};
|
16
26
|
export type RtmpInputCommand = {
|
17
|
-
type: "
|
27
|
+
type: "disable-source";
|
28
|
+
streamName: string;
|
29
|
+
} | {
|
30
|
+
type: "enable-source";
|
31
|
+
streamName: string;
|
32
|
+
} | {
|
33
|
+
type: "reset-source";
|
18
34
|
streamName: string;
|
19
35
|
};
|
20
36
|
export declare class RtmpInput implements CreatedMediaNode {
|
@@ -22,14 +38,17 @@ export declare class RtmpInput implements CreatedMediaNode {
|
|
22
38
|
relatedMediaNodes: RelatedMediaNodes;
|
23
39
|
norsk: Norsk;
|
24
40
|
cfg: RtmpInputSettings;
|
25
|
-
activeStreams: string
|
41
|
+
activeStreams: Map<string, number>;
|
42
|
+
disabledStreams: Set<string>;
|
26
43
|
initialised: Promise<void>;
|
27
44
|
rtmpServer: RtmpServerInputNode | null;
|
28
45
|
updates: RuntimeUpdates<RtmpInputState, RtmpInputCommand, RtmpInputEvent>;
|
29
46
|
static create(norsk: Norsk, cfg: RtmpInputSettings, updates: RuntimeUpdates<RtmpInputState, RtmpInputCommand, RtmpInputEvent>): Promise<RtmpInput>;
|
30
47
|
constructor(norsk: Norsk, cfg: RtmpInputSettings, updates: RuntimeUpdates<RtmpInputState, RtmpInputCommand, RtmpInputEvent>);
|
31
48
|
initialise(): Promise<void>;
|
32
|
-
|
49
|
+
enableSource(streamName: string): Promise<void>;
|
50
|
+
disableSource(streamName: string): Promise<void>;
|
51
|
+
resetSource(streamName: string): Promise<void>;
|
33
52
|
}
|
34
53
|
export default class RtmpInputDefinition implements ServerComponentDefinition<RtmpInputSettings, RtmpInput, RtmpInputState, RtmpInputCommand> {
|
35
54
|
create(norsk: Norsk, cfg: RtmpInputSettings, cb: OnCreated<RtmpInput>, runtime: StudioRuntime<RtmpInputState, RtmpInputCommand, RtmpInputEvent>): Promise<void>;
|
@@ -16,7 +16,8 @@ class RtmpInput {
|
|
16
16
|
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
17
17
|
norsk;
|
18
18
|
cfg;
|
19
|
-
activeStreams =
|
19
|
+
activeStreams = new Map();
|
20
|
+
disabledStreams = new Set();
|
20
21
|
initialised;
|
21
22
|
rtmpServer = null;
|
22
23
|
updates;
|
@@ -41,18 +42,46 @@ class RtmpInput {
|
|
41
42
|
certFile: process.env.SSL_CERT_FILE,
|
42
43
|
keyFile: process.env.SSL_KEY_FILE,
|
43
44
|
},
|
44
|
-
|
45
|
+
onConnectionStatusChange: (_cid, status, streamKeys) => {
|
46
|
+
switch (status) {
|
47
|
+
case 'disconnected':
|
48
|
+
for (const key of streamKeys) {
|
49
|
+
if (key.videoStreamKey.sourceName) {
|
50
|
+
const streamName = key.videoStreamKey.sourceName.sourceName;
|
51
|
+
if (streamName) {
|
52
|
+
this.activeStreams.delete(streamName);
|
53
|
+
this.updates.raiseEvent({ type: "source-disconnected", streamName });
|
54
|
+
(0, logging_1.debuglog)("Stream disconnected", { streamName, activeStreams: this.activeStreams });
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
},
|
60
|
+
onConnection: (connnectionId, app, url) => {
|
61
|
+
if (this.disabledStreams.has(connnectionId)) {
|
62
|
+
(0, logging_1.debuglog)("Rejecting connection as stream is presently disabled", { url });
|
63
|
+
return {
|
64
|
+
accept: false
|
65
|
+
};
|
66
|
+
}
|
45
67
|
if (app === this.cfg.appName) {
|
46
|
-
(0, logging_1.debuglog)("Accepted connection with app name", { app,
|
68
|
+
(0, logging_1.debuglog)("Accepted connection with app name", { app, connnectionId, url });
|
47
69
|
return { accept: true };
|
48
70
|
}
|
49
71
|
else {
|
50
|
-
(0, logging_1.debuglog)("Rejecting connection with unknown app name", { app,
|
72
|
+
(0, logging_1.debuglog)("Rejecting connection with unknown app name", { app, connnectionId, url });
|
51
73
|
return { accept: false };
|
52
74
|
}
|
53
75
|
},
|
54
76
|
onStream: (cid, app, url, streamId, publishingName) => {
|
55
77
|
(0, logging_1.debuglog)("Stream request received", { publishingName, activeStreams: this.activeStreams });
|
78
|
+
if (this.disabledStreams.has(publishingName)) {
|
79
|
+
(0, logging_1.debuglog)("Rejecting connection as stream is presently disabled", { publishingName });
|
80
|
+
return {
|
81
|
+
accept: false,
|
82
|
+
reason: "Stream is disabled"
|
83
|
+
};
|
84
|
+
}
|
56
85
|
if (!this.cfg.streamNames.includes(publishingName)) {
|
57
86
|
(0, logging_1.debuglog)("Rejecting unknown stream name", { publishingName });
|
58
87
|
return {
|
@@ -60,18 +89,18 @@ class RtmpInput {
|
|
60
89
|
reason: "Unknown stream name"
|
61
90
|
};
|
62
91
|
}
|
63
|
-
if (this.activeStreams.
|
92
|
+
if (this.activeStreams.has(publishingName)) {
|
64
93
|
(0, logging_1.debuglog)("Rejecting duplicate stream connection", { publishingName });
|
65
94
|
return {
|
66
95
|
accept: false,
|
67
96
|
reason: "Stream already connected"
|
68
97
|
};
|
69
98
|
}
|
70
|
-
(
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
}
|
99
|
+
if (this.cfg.streamNames.includes(publishingName)) {
|
100
|
+
(0, logging_1.debuglog)("Accepting stream", { publishingName });
|
101
|
+
this.activeStreams.set(publishingName, streamId);
|
102
|
+
this.updates.raiseEvent({ type: "source-connected", streamName: publishingName });
|
103
|
+
}
|
75
104
|
return {
|
76
105
|
accept: true,
|
77
106
|
videoStreamKey: {
|
@@ -84,32 +113,37 @@ class RtmpInput {
|
|
84
113
|
},
|
85
114
|
};
|
86
115
|
},
|
87
|
-
|
88
|
-
if (status !== "disconnected") {
|
89
|
-
return;
|
90
|
-
}
|
91
|
-
for (const key of streamKeys) {
|
92
|
-
if (key.videoStreamKey.sourceName) {
|
93
|
-
const streamName = key.videoStreamKey.sourceName.sourceName;
|
94
|
-
this.activeStreams = this.activeStreams.filter((s) => s !== streamName);
|
95
|
-
this.updates.update({
|
96
|
-
connectedSources: [...this.activeStreams]
|
97
|
-
});
|
98
|
-
this.updates.raiseEvent({ type: "source-disconnected", streamName });
|
99
|
-
(0, logging_1.debuglog)("Stream disconnected", { streamName, activeStreams: this.activeStreams });
|
100
|
-
}
|
101
|
-
}
|
102
|
-
},
|
116
|
+
onClose: () => { },
|
103
117
|
onCreate: (node) => {
|
104
118
|
this.relatedMediaNodes.addOutput(node);
|
105
119
|
}
|
106
120
|
});
|
107
121
|
}
|
108
|
-
async
|
109
|
-
|
122
|
+
async enableSource(streamName) {
|
123
|
+
this.disabledStreams.delete(streamName);
|
124
|
+
this.updates.raiseEvent({
|
125
|
+
type: 'source-enabled',
|
126
|
+
streamName
|
127
|
+
});
|
128
|
+
(0, logging_1.debuglog)("Stream enabled", { streamName, activeStreams: this.activeStreams });
|
129
|
+
}
|
130
|
+
async disableSource(streamName) {
|
131
|
+
this.disabledStreams.add(streamName);
|
132
|
+
await this.resetSource(streamName);
|
133
|
+
this.updates.raiseEvent({
|
134
|
+
type: 'source-disabled',
|
135
|
+
streamName
|
136
|
+
});
|
137
|
+
}
|
138
|
+
async resetSource(streamName) {
|
110
139
|
if (this.rtmpServer) {
|
140
|
+
this.rtmpServer.closeConnection(streamName);
|
141
|
+
this.updates.raiseEvent({
|
142
|
+
type: 'source-disconnected',
|
143
|
+
streamName
|
144
|
+
});
|
111
145
|
}
|
112
|
-
(0, logging_1.debuglog)("Stream
|
146
|
+
(0, logging_1.debuglog)("Stream reset", { streamName, afterState: this.activeStreams });
|
113
147
|
}
|
114
148
|
}
|
115
149
|
exports.RtmpInput = RtmpInput;
|
@@ -136,8 +170,14 @@ class RtmpInputDefinition {
|
|
136
170
|
async handleCommand(node, command) {
|
137
171
|
const commandType = command.type;
|
138
172
|
switch (commandType) {
|
139
|
-
case '
|
140
|
-
await node.
|
173
|
+
case 'disable-source':
|
174
|
+
await node.disableSource(command.streamName);
|
175
|
+
break;
|
176
|
+
case 'enable-source':
|
177
|
+
await node.enableSource(command.streamName);
|
178
|
+
break;
|
179
|
+
case 'reset-source':
|
180
|
+
await node.resetSource(command.streamName);
|
141
181
|
break;
|
142
182
|
default:
|
143
183
|
(0, util_1.assertUnreachable)(commandType);
|
@@ -158,12 +198,32 @@ class RtmpInputDefinition {
|
|
158
198
|
return res.status(400).json({ error: 'Stream name is required' });
|
159
199
|
}
|
160
200
|
const state = runtime.updates.latest();
|
161
|
-
|
162
|
-
if (!state.
|
201
|
+
(0, logging_1.debuglog)("Current state during disconnect:", state);
|
202
|
+
if (!state.connectedStreams.includes(streamName)) {
|
163
203
|
return res.status(404).json({ error: 'Stream not found or not connected' });
|
164
204
|
}
|
165
205
|
runtime.updates.sendCommand({
|
166
|
-
type: '
|
206
|
+
type: 'reset-source',
|
207
|
+
streamName
|
208
|
+
});
|
209
|
+
res.status(204).send();
|
210
|
+
}
|
211
|
+
catch (error) {
|
212
|
+
console.error('Error in disconnect handler:', error);
|
213
|
+
res.status(500).json({ error: 'Failed to disconnect stream' });
|
214
|
+
}
|
215
|
+
}
|
216
|
+
},
|
217
|
+
{
|
218
|
+
...post('/enable', paths),
|
219
|
+
handler: ({ runtime }) => async (req, res) => {
|
220
|
+
try {
|
221
|
+
const { streamName } = req.body;
|
222
|
+
if (!streamName) {
|
223
|
+
return res.status(400).json({ error: 'Stream name is required' });
|
224
|
+
}
|
225
|
+
runtime.updates.sendCommand({
|
226
|
+
type: 'enable-source',
|
167
227
|
streamName
|
168
228
|
});
|
169
229
|
res.status(204).send();
|
@@ -174,6 +234,26 @@ class RtmpInputDefinition {
|
|
174
234
|
}
|
175
235
|
}
|
176
236
|
},
|
237
|
+
{
|
238
|
+
...post('/disable', paths),
|
239
|
+
handler: ({ runtime }) => async (req, res) => {
|
240
|
+
try {
|
241
|
+
const { streamName } = req.body;
|
242
|
+
if (!streamName) {
|
243
|
+
return res.status(400).json({ error: 'Stream name is required' });
|
244
|
+
}
|
245
|
+
runtime.updates.sendCommand({
|
246
|
+
type: 'disable-source',
|
247
|
+
streamName
|
248
|
+
});
|
249
|
+
res.status(204).send();
|
250
|
+
}
|
251
|
+
catch (error) {
|
252
|
+
console.error('Error in disconnect handler:', error);
|
253
|
+
res.status(500).json({ error: 'Failed to disconnect stream' });
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}
|
177
257
|
];
|
178
258
|
}
|
179
259
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/input.rtmp/runtime.ts"],"names":[],"mappings":";;;;;;AACA,wFAAmM;AACnM,yEAAuE;AACvE,2DAA6B;AAC7B,yCAAwC;AAExC,gDAAwB;AACxB,gDAAwB;AAExB,mEAA6E;
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/input.rtmp/runtime.ts"],"names":[],"mappings":";;;;;;AACA,wFAAmM;AACnM,yEAAuE;AACvE,2DAA6B;AAC7B,yCAAwC;AAExC,gDAAwB;AACxB,gDAAwB;AAExB,mEAA6E;AAqC7E,MAAa,SAAS;IACpB,EAAE,CAAS;IACX,iBAAiB,GAAsB,IAAI,iCAAiB,EAAE,CAAC;IAE/D,KAAK,CAAQ;IACb,GAAG,CAAoB;IAEvB,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAEpC,WAAW,CAAgB;IAC3B,UAAU,GAA+B,IAAI,CAAC;IAE9C,OAAO,CAAmE;IAE1E,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAsB,EAAE,OAAyE;QACjI,MAAM,IAAI,GAAG,IAAI,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,KAAY,EAAE,GAAsB,EAAE,OAAyE;QACzH,IAAI,CAAC,GAAG,GAAG,GAAG,CA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wBACpE,CAAC;wBACD,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC1B,IAAI,EAAE,gBAAgB;4BACtB,UAAU;yBACX,CAAC,CAAA;wBACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;oBACzB,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;wBACrD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAlGD,sCAkGC"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ViewProps } from "@norskvideo/norsk-studio/lib/extension/client-types";
|
2
2
|
import { RtmpInputCommand, RtmpInputSettings, RtmpInputState } from "./runtime";
|
3
|
-
declare function SummaryView({ state, config,
|
3
|
+
declare function SummaryView({ state, config, sendCommand }: ViewProps<RtmpInputSettings, RtmpInputState, RtmpInputCommand>): import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default SummaryView;
|
@@ -1,42 +1,67 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
-
function SummaryView({ state, config,
|
4
|
+
function SummaryView({ state, config, sendCommand }) {
|
5
5
|
const connectedSources = [];
|
6
6
|
const disconnectedSources = [];
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
const resetStream = async (streamName) => {
|
8
|
+
try {
|
9
|
+
sendCommand({
|
10
|
+
type: "reset-source",
|
11
|
+
streamName
|
12
|
+
});
|
10
13
|
}
|
11
|
-
|
12
|
-
|
14
|
+
catch (error) {
|
15
|
+
console.error("Failed to disconnect stream:", error);
|
13
16
|
}
|
14
|
-
});
|
15
|
-
const handleDisconnectStream = (streamName) => {
|
16
|
-
void disconnectStream(streamName);
|
17
17
|
};
|
18
|
-
const
|
18
|
+
const disableStream = async (streamName) => {
|
19
19
|
try {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"Content-Type": "application/json",
|
24
|
-
},
|
25
|
-
body: JSON.stringify({ streamName }),
|
20
|
+
sendCommand({
|
21
|
+
type: "disable-source",
|
22
|
+
streamName
|
26
23
|
});
|
27
|
-
|
28
|
-
|
29
|
-
|
24
|
+
}
|
25
|
+
catch (error) {
|
26
|
+
console.error("Failed to disable stream:", error);
|
27
|
+
}
|
28
|
+
};
|
29
|
+
const enableStream = async (streamName) => {
|
30
|
+
try {
|
30
31
|
sendCommand({
|
31
|
-
type: "
|
32
|
+
type: "enable-source",
|
32
33
|
streamName
|
33
34
|
});
|
34
35
|
}
|
35
36
|
catch (error) {
|
36
|
-
console.error("Failed to
|
37
|
+
console.error("Failed to enable stream:", error);
|
37
38
|
}
|
38
39
|
};
|
39
|
-
|
40
|
+
const handleResetStream = (streamName) => {
|
41
|
+
void resetStream(streamName);
|
42
|
+
};
|
43
|
+
const handleDisableStream = (streamName) => {
|
44
|
+
void disableStream(streamName);
|
45
|
+
};
|
46
|
+
const handleEnableStream = (streamName) => {
|
47
|
+
void enableStream(streamName);
|
48
|
+
};
|
49
|
+
config.streamNames.forEach((streamName) => {
|
50
|
+
if (state.connectedStreams.includes(streamName)) {
|
51
|
+
connectedSources.push(streamName);
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
disconnectedSources.push(streamName);
|
55
|
+
}
|
56
|
+
});
|
57
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: "dark:text-white text-black mb-3 w-60", children: [(0, jsx_runtime_1.jsxs)("div", { id: "rtmp-sources-connected", children: [(0, jsx_runtime_1.jsx)("span", { children: "Connected Sources" }), (0, jsx_runtime_1.jsx)("ul", { children: connectedSources.map((streamName) => {
|
58
|
+
return (0, jsx_runtime_1.jsxs)("li", { className: "text-green-300", children: [streamName, (0, jsx_runtime_1.jsx)("button", { onClick: () => handleResetStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Reset" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => handleDisableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Disable" })] }, streamName);
|
59
|
+
}) })] }), (0, jsx_runtime_1.jsxs)("div", { id: "rtmp-sources-disconnected", className: "mt-3", children: [(0, jsx_runtime_1.jsx)("span", { children: "Disconnected Sources" }), (0, jsx_runtime_1.jsx)("ul", { children: disconnectedSources.map((streamName) => {
|
60
|
+
return (0, jsx_runtime_1.jsxs)("li", { className: "text-orange-300", children: [streamName, state.disabledStreams.includes(streamName) ?
|
61
|
+
(0, jsx_runtime_1.jsx)("button", { onClick: () => handleEnableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-blue-600 hover:bg-blue-700 text-white rounded", children: "Enable" })
|
62
|
+
:
|
63
|
+
(0, jsx_runtime_1.jsx)("button", { onClick: () => handleDisableStream(streamName), className: "ml-2 px-2 py-1 text-xs bg-red-600 hover:bg-red-700 text-white rounded", children: "Disable" })] }, streamName);
|
64
|
+
}) })] })] });
|
40
65
|
}
|
41
66
|
exports.default = SummaryView;
|
42
67
|
//# sourceMappingURL=summary-view.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/input.rtmp/summary-view.tsx"],"names":[],"mappings":";;;AAGA,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/input.rtmp/summary-view.tsx"],"names":[],"mappings":";;;AAGA,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAmE;IAClH,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,MAAM,mBAAmB,GAAa,EAAE,CAAC;IAEzC,M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ACD,IACF,CAAA;AACR,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
@@ -59,7 +59,7 @@ export interface paths {
|
|
59
59
|
patch?: never;
|
60
60
|
trace?: never;
|
61
61
|
};
|
62
|
-
"/
|
62
|
+
"/enable": {
|
63
63
|
parameters: {
|
64
64
|
query?: never;
|
65
65
|
header?: never;
|
@@ -119,6 +119,66 @@ export interface paths {
|
|
119
119
|
patch?: never;
|
120
120
|
trace?: never;
|
121
121
|
};
|
122
|
+
"/disable": {
|
123
|
+
parameters: {
|
124
|
+
query?: never;
|
125
|
+
header?: never;
|
126
|
+
path?: never;
|
127
|
+
cookie?: never;
|
128
|
+
};
|
129
|
+
get?: never;
|
130
|
+
put?: never;
|
131
|
+
post: {
|
132
|
+
parameters: {
|
133
|
+
query?: never;
|
134
|
+
header?: never;
|
135
|
+
path?: never;
|
136
|
+
cookie?: never;
|
137
|
+
};
|
138
|
+
requestBody?: {
|
139
|
+
content: {
|
140
|
+
"application/json": {
|
141
|
+
streamId: string;
|
142
|
+
};
|
143
|
+
};
|
144
|
+
};
|
145
|
+
responses: {
|
146
|
+
204: {
|
147
|
+
headers: {
|
148
|
+
[name: string]: unknown;
|
149
|
+
};
|
150
|
+
content?: never;
|
151
|
+
};
|
152
|
+
400: {
|
153
|
+
headers: {
|
154
|
+
[name: string]: unknown;
|
155
|
+
};
|
156
|
+
content: {
|
157
|
+
"application/json": {
|
158
|
+
error?: string;
|
159
|
+
details?: string;
|
160
|
+
};
|
161
|
+
};
|
162
|
+
};
|
163
|
+
500: {
|
164
|
+
headers: {
|
165
|
+
[name: string]: unknown;
|
166
|
+
};
|
167
|
+
content: {
|
168
|
+
"application/json": {
|
169
|
+
error?: string;
|
170
|
+
details?: string;
|
171
|
+
};
|
172
|
+
};
|
173
|
+
};
|
174
|
+
};
|
175
|
+
};
|
176
|
+
delete?: never;
|
177
|
+
options?: never;
|
178
|
+
head?: never;
|
179
|
+
patch?: never;
|
180
|
+
trace?: never;
|
181
|
+
};
|
122
182
|
}
|
123
183
|
export type webhooks = Record<string, never>;
|
124
184
|
export interface components {
|
@@ -51,13 +51,13 @@ paths:
|
|
51
51
|
type: string
|
52
52
|
description: Additional error details
|
53
53
|
|
54
|
-
/
|
54
|
+
/enable:
|
55
55
|
post:
|
56
|
-
summary:
|
57
|
-
description:
|
56
|
+
summary: Re-enables a disabled RTMP stream
|
57
|
+
description: Re-enables a previously disconnected RTMP stream
|
58
58
|
x-route-type: instance
|
59
59
|
requestBody:
|
60
|
-
description: The stream to
|
60
|
+
description: The stream to re-enable
|
61
61
|
content:
|
62
62
|
application/json:
|
63
63
|
schema:
|
@@ -66,11 +66,11 @@ paths:
|
|
66
66
|
properties:
|
67
67
|
streamName:
|
68
68
|
type: string
|
69
|
-
description: The name of the stream to
|
69
|
+
description: The name of the stream to re-enable
|
70
70
|
example: camera1
|
71
71
|
responses:
|
72
72
|
204:
|
73
|
-
description: The stream was successfully
|
73
|
+
description: The stream was successfully re-enabled
|
74
74
|
400:
|
75
75
|
description: Stream is already connected or invalid request
|
76
76
|
content:
|
@@ -85,7 +85,7 @@ paths:
|
|
85
85
|
type: string
|
86
86
|
description: Additional error details
|
87
87
|
500:
|
88
|
-
description: Failed to
|
88
|
+
description: Failed to re-enable stream
|
89
89
|
content:
|
90
90
|
application/json:
|
91
91
|
schema:
|
@@ -97,3 +97,51 @@ paths:
|
|
97
97
|
details:
|
98
98
|
type: string
|
99
99
|
description: Additional error details
|
100
|
+
|
101
|
+
/disable:
|
102
|
+
post:
|
103
|
+
summary: Disables an RTMP stream by id
|
104
|
+
description:
|
105
|
+
x-route-type: instance
|
106
|
+
requestBody:
|
107
|
+
description: The stream to disable
|
108
|
+
content:
|
109
|
+
application/json:
|
110
|
+
schema:
|
111
|
+
type: object
|
112
|
+
required: ['streamId']
|
113
|
+
properties:
|
114
|
+
streamId:
|
115
|
+
type: string
|
116
|
+
description: The Id of the stream to disable
|
117
|
+
example: camera1
|
118
|
+
responses:
|
119
|
+
204:
|
120
|
+
description: The stream was successfully disabled
|
121
|
+
400:
|
122
|
+
description: The stream isn't known about, or invalid request
|
123
|
+
content:
|
124
|
+
application/json:
|
125
|
+
schema:
|
126
|
+
type: object
|
127
|
+
properties:
|
128
|
+
error:
|
129
|
+
type: string
|
130
|
+
description: A description of the error
|
131
|
+
details:
|
132
|
+
type: string
|
133
|
+
description: Additional error details
|
134
|
+
500:
|
135
|
+
description: Failed to disable stream
|
136
|
+
content:
|
137
|
+
application/json:
|
138
|
+
schema:
|
139
|
+
type: object
|
140
|
+
properties:
|
141
|
+
error:
|
142
|
+
type: string
|
143
|
+
description: A description of the error
|
144
|
+
details:
|
145
|
+
type: string
|
146
|
+
description: Additional error details
|
147
|
+
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { ViewProps } from "@norskvideo/norsk-studio/lib/extension/client-types";
|
2
2
|
import { SrtInputCommand, SrtInputSettings, SrtInputState } from "./runtime";
|
3
|
-
declare function SummaryView({ state, config,
|
3
|
+
declare function SummaryView({ state, config, sendCommand }: ViewProps<SrtInputSettings, SrtInputState, SrtInputCommand>): import("react/jsx-runtime").JSX.Element;
|
4
4
|
export default SummaryView;
|
@@ -1,21 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
4
|
-
function SummaryView({ state, config,
|
4
|
+
function SummaryView({ state, config, sendCommand }) {
|
5
5
|
const connectedSources = [];
|
6
6
|
const disconnectedSources = [];
|
7
7
|
const resetStream = async (streamId) => {
|
8
8
|
try {
|
9
|
-
const response = await fetch(`${urls.instanceUrl}/disconnect`, {
|
10
|
-
method: "POST",
|
11
|
-
headers: {
|
12
|
-
"Content-Type": "application/json",
|
13
|
-
},
|
14
|
-
body: JSON.stringify({ streamId }),
|
15
|
-
});
|
16
|
-
if (!response.ok) {
|
17
|
-
console.error("Stream failed to disconnect");
|
18
|
-
}
|
19
9
|
sendCommand({
|
20
10
|
type: "reset-source",
|
21
11
|
streamId
|
@@ -27,18 +17,8 @@ function SummaryView({ state, config, urls, sendCommand }) {
|
|
27
17
|
};
|
28
18
|
const disableStream = async (streamId) => {
|
29
19
|
try {
|
30
|
-
const response = await fetch(`${urls.instanceUrl}/disable`, {
|
31
|
-
method: "POST",
|
32
|
-
headers: {
|
33
|
-
"Content-Type": "application/json",
|
34
|
-
},
|
35
|
-
body: JSON.stringify({ streamId }),
|
36
|
-
});
|
37
|
-
if (!response.ok) {
|
38
|
-
console.error("Failed to disable stream");
|
39
|
-
}
|
40
20
|
sendCommand({
|
41
|
-
type: "
|
21
|
+
type: "disable-source",
|
42
22
|
streamId
|
43
23
|
});
|
44
24
|
}
|
@@ -48,18 +28,8 @@ function SummaryView({ state, config, urls, sendCommand }) {
|
|
48
28
|
};
|
49
29
|
const enableStream = async (streamId) => {
|
50
30
|
try {
|
51
|
-
const response = await fetch(`${urls.instanceUrl}/enable`, {
|
52
|
-
method: "POST",
|
53
|
-
headers: {
|
54
|
-
"Content-Type": "application/json",
|
55
|
-
},
|
56
|
-
body: JSON.stringify({ streamId }),
|
57
|
-
});
|
58
|
-
if (!response.ok) {
|
59
|
-
console.error("Failed to enable stream");
|
60
|
-
}
|
61
31
|
sendCommand({
|
62
|
-
type: "
|
32
|
+
type: "enable-source",
|
63
33
|
streamId
|
64
34
|
});
|
65
35
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/input.srt-listener/summary-view.tsx"],"names":[],"mappings":";;;AAGA,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"summary-view.js","sourceRoot":"","sources":["../../src/input.srt-listener/summary-view.tsx"],"names":[],"mappings":";;;AAGA,SAAS,WAAW,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAgE;IAC/G,MAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,MAAM,mBAAmB,GAAa,EA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CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAC5C,SAAS,EAAC,uEAAuE,wBAG1E,KAdG,QAAQ,CAiBnB,CAAA;wBACP,CAAC,CAAC,GACC,IACD,IACF,CAAA;AACR,CAAC;AAED,kBAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@norskvideo/norsk-studio-built-ins",
|
3
|
-
"version": "1.12.0-2025-
|
3
|
+
"version": "1.12.0-2025-02-02-6cada821",
|
4
4
|
"description": "",
|
5
5
|
"scripts": {
|
6
6
|
"clean": "rm -rf lib",
|
@@ -21,8 +21,8 @@
|
|
21
21
|
],
|
22
22
|
"license": "MIT",
|
23
23
|
"dependencies": {
|
24
|
-
"@norskvideo/norsk-sdk": "^1.0.
|
25
|
-
"@norskvideo/norsk-studio": "^1.20.1-2025-
|
24
|
+
"@norskvideo/norsk-sdk": "^1.0.400-2025-02-02-774a309c",
|
25
|
+
"@norskvideo/norsk-studio": "^1.20.1-2025-02-02-1726552b",
|
26
26
|
"@norskvideo/webrtc-client": "^0.1.2",
|
27
27
|
"body-parser": "^1.20.2",
|
28
28
|
"cors": "^2.8.5",
|