@norskvideo/norsk-studio 1.0.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 +58 -0
- package/bin/info.ts.template +23 -0
- package/bin/studio-bundle +23 -0
- package/bin/studio-editor +3 -0
- package/bin/studio-runner +3 -0
- package/bin/studio-wrap-infos +44 -0
- package/lib/client/comms.d.ts +26 -0
- package/lib/client/comms.js +114 -0
- package/lib/client/comms.js.map +1 -0
- package/lib/client/componentevents.d.ts +12 -0
- package/lib/client/componentevents.js +41 -0
- package/lib/client/componentevents.js.map +1 -0
- package/lib/client/console.d.ts +19 -0
- package/lib/client/console.js +42 -0
- package/lib/client/console.js.map +1 -0
- package/lib/client/controls.d.ts +23 -0
- package/lib/client/controls.js +80 -0
- package/lib/client/controls.js.map +1 -0
- package/lib/client/creator.d.ts +45 -0
- package/lib/client/creator.js +276 -0
- package/lib/client/creator.js.map +1 -0
- package/lib/client/jsx/connection-editor.d.ts +11 -0
- package/lib/client/jsx/connection-editor.js +198 -0
- package/lib/client/jsx/connection-editor.js.map +1 -0
- package/lib/client/jsx/connection.d.ts +7 -0
- package/lib/client/jsx/connection.js +33 -0
- package/lib/client/jsx/connection.js.map +1 -0
- package/lib/client/jsx/console-log.d.ts +11 -0
- package/lib/client/jsx/console-log.js +17 -0
- package/lib/client/jsx/console-log.js.map +1 -0
- package/lib/client/jsx/console.d.ts +20 -0
- package/lib/client/jsx/console.js +30 -0
- package/lib/client/jsx/console.js.map +1 -0
- package/lib/client/jsx/node-editor.d.ts +23 -0
- package/lib/client/jsx/node-editor.js +442 -0
- package/lib/client/jsx/node-editor.js.map +1 -0
- package/lib/client/jsx/node.d.ts +25 -0
- package/lib/client/jsx/node.js +244 -0
- package/lib/client/jsx/node.js.map +1 -0
- package/lib/client/jsx/selected-connection.d.ts +21 -0
- package/lib/client/jsx/selected-connection.js +110 -0
- package/lib/client/jsx/selected-connection.js.map +1 -0
- package/lib/client/jsx/selected-node.d.ts +24 -0
- package/lib/client/jsx/selected-node.js +75 -0
- package/lib/client/jsx/selected-node.js.map +1 -0
- package/lib/client/jsx/selected.d.ts +24 -0
- package/lib/client/jsx/selected.js +15 -0
- package/lib/client/jsx/selected.js.map +1 -0
- package/lib/client/jsx/selectfilename.d.ts +7 -0
- package/lib/client/jsx/selectfilename.js +17 -0
- package/lib/client/jsx/selectfilename.js.map +1 -0
- package/lib/client/jsx/toolbox.d.ts +14 -0
- package/lib/client/jsx/toolbox.js +45 -0
- package/lib/client/jsx/toolbox.js.map +1 -0
- package/lib/client/library.d.ts +12 -0
- package/lib/client/library.js +53 -0
- package/lib/client/library.js.map +1 -0
- package/lib/client/modal.d.ts +21 -0
- package/lib/client/modal.js +34 -0
- package/lib/client/modal.js.map +1 -0
- package/lib/client/rete/connection.d.ts +20 -0
- package/lib/client/rete/connection.js +27 -0
- package/lib/client/rete/connection.js.map +1 -0
- package/lib/client/rete/node.d.ts +28 -0
- package/lib/client/rete/node.js +78 -0
- package/lib/client/rete/node.js.map +1 -0
- package/lib/client/rete/selector.d.ts +10 -0
- package/lib/client/rete/selector.js +22 -0
- package/lib/client/rete/selector.js.map +1 -0
- package/lib/client/rete.d.ts +81 -0
- package/lib/client/rete.js +384 -0
- package/lib/client/rete.js.map +1 -0
- package/lib/client/session-view.d.ts +7 -0
- package/lib/client/session-view.js +132 -0
- package/lib/client/session-view.js.map +1 -0
- package/lib/client/session.d.ts +70 -0
- package/lib/client/session.js +185 -0
- package/lib/client/session.js.map +1 -0
- package/lib/client/tools.d.ts +22 -0
- package/lib/client/tools.js +311 -0
- package/lib/client/tools.js.map +1 -0
- package/lib/extension/base-nodes.d.ts +55 -0
- package/lib/extension/base-nodes.js +120 -0
- package/lib/extension/base-nodes.js.map +1 -0
- package/lib/extension/built-ins.d.ts +4 -0
- package/lib/extension/built-ins.js +52 -0
- package/lib/extension/built-ins.js.map +1 -0
- package/lib/extension/client-system.d.ts +5 -0
- package/lib/extension/client-system.js +3 -0
- package/lib/extension/client-system.js.map +1 -0
- package/lib/extension/client-types.d.ts +245 -0
- package/lib/extension/client-types.js +87 -0
- package/lib/extension/client-types.js.map +1 -0
- package/lib/extension/common.d.ts +34 -0
- package/lib/extension/common.js +45 -0
- package/lib/extension/common.js.map +1 -0
- package/lib/extension/registration.d.ts +7 -0
- package/lib/extension/registration.js +62 -0
- package/lib/extension/registration.js.map +1 -0
- package/lib/extension/runtime-system.d.ts +9 -0
- package/lib/extension/runtime-system.js +3 -0
- package/lib/extension/runtime-system.js.map +1 -0
- package/lib/extension/runtime-types.d.ts +91 -0
- package/lib/extension/runtime-types.js +318 -0
- package/lib/extension/runtime-types.js.map +1 -0
- package/lib/extension/validation.d.ts +16 -0
- package/lib/extension/validation.js +50 -0
- package/lib/extension/validation.js.map +1 -0
- package/lib/library/test.d.ts +2 -0
- package/lib/library/test.js +11 -0
- package/lib/library/test.js.map +1 -0
- package/lib/runtime/document.d.ts +62 -0
- package/lib/runtime/document.js +322 -0
- package/lib/runtime/document.js.map +1 -0
- package/lib/runtime/execution.d.ts +48 -0
- package/lib/runtime/execution.js +327 -0
- package/lib/runtime/execution.js.map +1 -0
- package/lib/runtime/norsk-comms.d.ts +24 -0
- package/lib/runtime/norsk-comms.js +71 -0
- package/lib/runtime/norsk-comms.js.map +1 -0
- package/lib/runtime/system.d.ts +30 -0
- package/lib/runtime/system.js +83 -0
- package/lib/runtime/system.js.map +1 -0
- package/lib/server/config.d.ts +19 -0
- package/lib/server/config.js +26 -0
- package/lib/server/config.js.map +1 -0
- package/lib/server/index.d.ts +1 -0
- package/lib/server/index.js +310 -0
- package/lib/server/index.js.map +1 -0
- package/lib/server/logging.d.ts +6 -0
- package/lib/server/logging.js +96 -0
- package/lib/server/logging.js.map +1 -0
- package/lib/server/medialive.d.ts +1 -0
- package/lib/server/medialive.js +34 -0
- package/lib/server/medialive.js.map +1 -0
- package/lib/server/runner.d.ts +1 -0
- package/lib/server/runner.js +137 -0
- package/lib/server/runner.js.map +1 -0
- package/lib/server/session-registration.d.ts +5 -0
- package/lib/server/session-registration.js +18 -0
- package/lib/server/session-registration.js.map +1 -0
- package/lib/server/session.d.ts +117 -0
- package/lib/server/session.js +364 -0
- package/lib/server/session.js.map +1 -0
- package/lib/shared/client-msg.d.ts +13 -0
- package/lib/shared/client-msg.js +3 -0
- package/lib/shared/client-msg.js.map +1 -0
- package/lib/shared/config.d.ts +7 -0
- package/lib/shared/config.js +60 -0
- package/lib/shared/config.js.map +1 -0
- package/lib/shared/document.d.ts +164 -0
- package/lib/shared/document.js +496 -0
- package/lib/shared/document.js.map +1 -0
- package/lib/shared/names.d.ts +3 -0
- package/lib/shared/names.js +8 -0
- package/lib/shared/names.js.map +1 -0
- package/lib/shared/norsk.d.ts +21 -0
- package/lib/shared/norsk.js +3 -0
- package/lib/shared/norsk.js.map +1 -0
- package/lib/shared/server-msg.d.ts +69 -0
- package/lib/shared/server-msg.js +3 -0
- package/lib/shared/server-msg.js.map +1 -0
- package/lib/shared/util.d.ts +7 -0
- package/lib/shared/util.js +63 -0
- package/lib/shared/util.js.map +1 -0
- package/lib/test/_util/builder.d.ts +46 -0
- package/lib/test/_util/builder.js +200 -0
- package/lib/test/_util/builder.js.map +1 -0
- package/lib/test/_util/callback_app.d.ts +13 -0
- package/lib/test/_util/callback_app.js +25 -0
- package/lib/test/_util/callback_app.js.map +1 -0
- package/lib/test/_util/driver.d.ts +16 -0
- package/lib/test/_util/driver.js +89 -0
- package/lib/test/_util/driver.js.map +1 -0
- package/lib/test/_util/fake-norsk.d.ts +14 -0
- package/lib/test/_util/fake-norsk.js +19 -0
- package/lib/test/_util/fake-norsk.js.map +1 -0
- package/lib/test/_util/ffmpeg.d.ts +80 -0
- package/lib/test/_util/ffmpeg.js +266 -0
- package/lib/test/_util/ffmpeg.js.map +1 -0
- package/lib/test/_util/manual-driver.d.ts +42 -0
- package/lib/test/_util/manual-driver.js +206 -0
- package/lib/test/_util/manual-driver.js.map +1 -0
- package/lib/test/_util/runtime.d.ts +81 -0
- package/lib/test/_util/runtime.js +194 -0
- package/lib/test/_util/runtime.js.map +1 -0
- package/lib/test/_util/server.d.ts +8 -0
- package/lib/test/_util/server.js +33 -0
- package/lib/test/_util/server.js.map +1 -0
- package/lib/test/_util/sinks.d.ts +35 -0
- package/lib/test/_util/sinks.js +200 -0
- package/lib/test/_util/sinks.js.map +1 -0
- package/lib/test/_util/sources.d.ts +18 -0
- package/lib/test/_util/sources.js +113 -0
- package/lib/test/_util/sources.js.map +1 -0
- package/lib/test/_util/test-infos-views.d.ts +9 -0
- package/lib/test/_util/test-infos-views.js +46 -0
- package/lib/test/_util/test-infos-views.js.map +1 -0
- package/lib/test/_util/test-infos.d.ts +44 -0
- package/lib/test/_util/test-infos.js +202 -0
- package/lib/test/_util/test-infos.js.map +1 -0
- package/lib/test/client-designview.d.ts +1 -0
- package/lib/test/client-designview.js +258 -0
- package/lib/test/client-designview.js.map +1 -0
- package/lib/test/client-liveview.d.ts +1 -0
- package/lib/test/client-liveview.js +413 -0
- package/lib/test/client-liveview.js.map +1 -0
- package/lib/test/client-session.d.ts +1 -0
- package/lib/test/client-session.js +205 -0
- package/lib/test/client-session.js.map +1 -0
- package/lib/test/client-ui.d.ts +1 -0
- package/lib/test/client-ui.js +74 -0
- package/lib/test/client-ui.js.map +1 -0
- package/lib/test/document-execution.d.ts +1 -0
- package/lib/test/document-execution.js +162 -0
- package/lib/test/document-execution.js.map +1 -0
- package/lib/test/document-loading.d.ts +1 -0
- package/lib/test/document-loading.js +420 -0
- package/lib/test/document-loading.js.map +1 -0
- package/lib/test/runtime-comms.d.ts +1 -0
- package/lib/test/runtime-comms.js +321 -0
- package/lib/test/runtime-comms.js.map +1 -0
- package/lib/test/subscriptions.d.ts +1 -0
- package/lib/test/subscriptions.js +334 -0
- package/lib/test/subscriptions.js.map +1 -0
- package/package.json +112 -0
- package/static/98_slides.html +61 -0
- package/static/Norsk-Favicon-150x150.png +0 -0
- package/static/Norsk-Favicon.png +0 -0
- package/static/Norsk-Logo-Dark-Background.png +0 -0
- package/static/Norsk.png +0 -0
- package/static/ShortStack.woff2 +0 -0
- package/static/bonnie-green.png +0 -0
- package/static/button.svg +67 -0
- package/static/doodle.css +174 -0
- package/static/flowbite.min.css +1 -0
- package/static/flowbite.min.js +2 -0
- package/static/font.css +20 -0
- package/static/jese-leos.png +0 -0
- package/static/joseph-mcfall.png +0 -0
- package/static/michael-gough.png +0 -0
- package/static/news-embedded.html +106 -0
- package/static/overlay-score.html +210 -0
- package/static/overlay-ui.html +918 -0
- package/static/react-dom.development.js +29869 -0
- package/static/react.development.js +3342 -0
- package/static/robert-brown.png +0 -0
- package/static/roberta-casas.png +0 -0
- package/static/style-dark.css +2467 -0
- package/static/style.css +7252 -0
- package/static/tailwind.css +31 -0
- package/static/team1.png +0 -0
- package/static/team2.png +0 -0
- package/static/videoFrame.html +73 -0
- package/static/webrtc.js +430 -0
- package/tailwind-theme.js +66 -0
- package/tailwind.config.js +11 -0
- package/ui/bypass-esbuild.js +24 -0
- package/ui/index.html +189 -0
- package/ui/index.js +229180 -0
- package/ui/studio.css +31 -0
- package/ui/test.html +95 -0
- package/ui/view.html +23 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultValidation = exports.defaultSubscription = exports.SimpleProcessorWrapper = exports.SimpleSinkWrapper = exports.SimpleInputWrapper = exports.CustomSinkNode = exports.CustomSourceNode = exports.CustomAutoDuplexNode = void 0;
|
|
4
|
+
const runtime_types_1 = require("./runtime-types");
|
|
5
|
+
class CustomAutoDuplexNode {
|
|
6
|
+
id;
|
|
7
|
+
innerInput;
|
|
8
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
|
9
|
+
constructor(id) {
|
|
10
|
+
this.id = id;
|
|
11
|
+
}
|
|
12
|
+
setup(setup) {
|
|
13
|
+
this.innerInput = setup.input;
|
|
14
|
+
this.relatedMediaNodes.addInput(setup.input);
|
|
15
|
+
setup.output.forEach((o) => this.relatedMediaNodes.addOutput(o));
|
|
16
|
+
}
|
|
17
|
+
async close() {
|
|
18
|
+
await this.innerInput?.close();
|
|
19
|
+
await Promise.all(this.relatedMediaNodes.output.map(async (o) => o.close()));
|
|
20
|
+
}
|
|
21
|
+
subscribe(sources, opts) {
|
|
22
|
+
if (this.innerInput)
|
|
23
|
+
defaultSubscription(this.innerInput, sources, opts);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.CustomAutoDuplexNode = CustomAutoDuplexNode;
|
|
27
|
+
class CustomSourceNode {
|
|
28
|
+
id;
|
|
29
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
|
30
|
+
constructor(id) {
|
|
31
|
+
this.id = id;
|
|
32
|
+
}
|
|
33
|
+
setup(setup) {
|
|
34
|
+
setup.output.forEach((o) => {
|
|
35
|
+
this.relatedMediaNodes.addOutput(o);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async close() {
|
|
39
|
+
await Promise.all(this.relatedMediaNodes.output.map(async (o) => o.close()));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.CustomSourceNode = CustomSourceNode;
|
|
43
|
+
class CustomSinkNode {
|
|
44
|
+
id;
|
|
45
|
+
inner;
|
|
46
|
+
relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
|
|
47
|
+
constructor(id) {
|
|
48
|
+
this.id = id;
|
|
49
|
+
}
|
|
50
|
+
setup(setup) {
|
|
51
|
+
this.inner = setup.sink;
|
|
52
|
+
this.relatedMediaNodes.addInput(setup.sink);
|
|
53
|
+
}
|
|
54
|
+
subscribe(sources, opts) {
|
|
55
|
+
if (this.inner)
|
|
56
|
+
defaultSubscription(this.inner, sources, opts);
|
|
57
|
+
}
|
|
58
|
+
registerInput(input) {
|
|
59
|
+
this.relatedMediaNodes.addInput(input);
|
|
60
|
+
}
|
|
61
|
+
async close() {
|
|
62
|
+
await this.inner?.close();
|
|
63
|
+
this.inner = undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.CustomSinkNode = CustomSinkNode;
|
|
67
|
+
class SimpleInputWrapper extends CustomSourceNode {
|
|
68
|
+
initialised;
|
|
69
|
+
constructor(id, create) {
|
|
70
|
+
super(id);
|
|
71
|
+
this.initialised = (async () => { const node = await create(); this.setup({ output: [node] }); })();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.SimpleInputWrapper = SimpleInputWrapper;
|
|
75
|
+
class SimpleSinkWrapper extends CustomSinkNode {
|
|
76
|
+
initialised;
|
|
77
|
+
constructor(id, create) {
|
|
78
|
+
super(id);
|
|
79
|
+
this.initialised = (async () => { const node = await create(); this.setup({ sink: node }); })();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.SimpleSinkWrapper = SimpleSinkWrapper;
|
|
83
|
+
class SimpleProcessorWrapper extends CustomAutoDuplexNode {
|
|
84
|
+
initialised;
|
|
85
|
+
constructor(id, create) {
|
|
86
|
+
super(id);
|
|
87
|
+
this.initialised = (async () => { const node = await create(); this.setup({ input: node, output: [node] }); })();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.SimpleProcessorWrapper = SimpleProcessorWrapper;
|
|
91
|
+
function defaultSubscription(innerInput, sources, opts) {
|
|
92
|
+
let subs = [];
|
|
93
|
+
sources.forEach((s) => {
|
|
94
|
+
const output = s.source.relatedMediaNodes.output[0];
|
|
95
|
+
if (!output) {
|
|
96
|
+
console.warn("Missing output on subscription source", s.source.id);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
subs = subs.concat(s.selectStreams());
|
|
100
|
+
});
|
|
101
|
+
if (subs.length > 0) {
|
|
102
|
+
innerInput.subscribe(subs, defaultValidation(sources, opts));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.warn("Attempt to do subscription resulted in a no-op");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.defaultSubscription = defaultSubscription;
|
|
110
|
+
function defaultValidation(sources, opts) {
|
|
111
|
+
const totalStreamsExpected = sources.reduce((acc, s) => {
|
|
112
|
+
return acc + s.streams.select.length;
|
|
113
|
+
}, 0);
|
|
114
|
+
const requireAll = opts?.requireOneOfEverything == undefined ? false : opts.requireOneOfEverything;
|
|
115
|
+
return requireAll ? (ctx) => {
|
|
116
|
+
return ctx.streams.length == totalStreamsExpected;
|
|
117
|
+
} : undefined;
|
|
118
|
+
}
|
|
119
|
+
exports.defaultValidation = defaultValidation;
|
|
120
|
+
//# sourceMappingURL=base-nodes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-nodes.js","sourceRoot":"","sources":["../../src/extension/base-nodes.ts"],"names":[],"mappings":";;;AACA,mDAAoG;AAOpG,MAAa,oBAAoB;IAE/B,EAAE,CAAS;IACX,UAAU,CAA6B;IACvC,iBAAiB,GAAsB,IAAI,iCAAiB,EAAE,CAAC;IAE/D,YAAY,EAAU;QACpB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,KAAK,CAAC,KAA8B;QAClC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC5C,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;IAClE,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC;QAC/B,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,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CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC;IAEnG,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,GAAY,EAAE,EAAE;QACnC,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,oBAAoB,CAAA;IACnD,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAXD,8CAWC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Media, SelectorInfoTable, SelectorInfo } from "./client-types";
|
|
2
|
+
export declare const Selectors: SelectorInfoTable;
|
|
3
|
+
export declare function findSubscriptionSelector(wanted: Media[], exact?: boolean): [string, SelectorInfo] | null;
|
|
4
|
+
export declare function isSubscriptionUsingMedia(media: Media, selector: string): boolean;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isSubscriptionUsingMedia = exports.findSubscriptionSelector = exports.Selectors = void 0;
|
|
7
|
+
const intersect_1 = __importDefault(require("intersect"));
|
|
8
|
+
exports.Selectors = {
|
|
9
|
+
selectVideo: {
|
|
10
|
+
name: "Select Video",
|
|
11
|
+
description: "Selects all video streams from the source",
|
|
12
|
+
media: ["video"]
|
|
13
|
+
},
|
|
14
|
+
selectAudio: {
|
|
15
|
+
name: "Select Audio",
|
|
16
|
+
description: "Selects all audio streams from the source",
|
|
17
|
+
media: ["audio"]
|
|
18
|
+
},
|
|
19
|
+
selectAV: {
|
|
20
|
+
name: "Select A/V",
|
|
21
|
+
description: "Selects all video & audio streams from the source",
|
|
22
|
+
media: ["video", "audio"],
|
|
23
|
+
validation: "requireAV"
|
|
24
|
+
},
|
|
25
|
+
selectSubtitles: {
|
|
26
|
+
name: "Select Subtitles",
|
|
27
|
+
description: "Selects all subtitles streams from the source",
|
|
28
|
+
media: ["subtitle"]
|
|
29
|
+
},
|
|
30
|
+
selectPlaylist: {
|
|
31
|
+
name: "Select Playlists",
|
|
32
|
+
description: "Selects all playlist streams from the source",
|
|
33
|
+
media: ["playlist"]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function findSubscriptionSelector(wanted, exact) {
|
|
37
|
+
const [key, largestAvailable] = Object.entries(exports.Selectors).sort(([_key, s1], [_key2, s2]) => (0, intersect_1.default)(s2.media, wanted).length - (0, intersect_1.default)(s1.media, wanted).length)[0];
|
|
38
|
+
if ((0, intersect_1.default)(largestAvailable.media, wanted).length == 0) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (exact && largestAvailable.media.length < wanted.length) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return [key, largestAvailable];
|
|
45
|
+
}
|
|
46
|
+
exports.findSubscriptionSelector = findSubscriptionSelector;
|
|
47
|
+
function isSubscriptionUsingMedia(media, selector) {
|
|
48
|
+
const info = exports.Selectors[selector];
|
|
49
|
+
return info.media.includes(media);
|
|
50
|
+
}
|
|
51
|
+
exports.isSubscriptionUsingMedia = isSubscriptionUsingMedia;
|
|
52
|
+
//# sourceMappingURL=built-ins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-ins.js","sourceRoot":"","sources":["../../src/extension/built-ins.ts"],"names":[],"mappings":";;;;;;AACA,0DAAkC;AAErB,QAAA,SAAS,GAAsB;IAC1C,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,2CAA2C;QACxD,KAAK,EAAE,CAAC,OAAO,CAAC;KACjB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,2CAA2C;QACxD,KAAK,EAAE,CAAC,OAAO,CAAC;KACjB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,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AAK,CAAC,CAAC;AACpC,CAAC;AAHD,4DAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-system.js","sourceRoot":"","sources":["../../src/extension/client-system.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { DocumentDescription, NodeDescription, NodeSubscriptionDescription, NodeValidationContext } from "../shared/document";
|
|
2
|
+
import type * as Z from 'zod';
|
|
3
|
+
import type { StreamKey, StreamMetadata, StreamMetadataMessage } from "@norskvideo/norsk-sdk";
|
|
4
|
+
export type Media = Exclude<StreamMetadataMessage["case"], undefined>;
|
|
5
|
+
export declare const All: Media[];
|
|
6
|
+
export declare const Av: Media[];
|
|
7
|
+
export declare const Audio: Media[];
|
|
8
|
+
export declare const Video: Media[];
|
|
9
|
+
export declare const Playlist: Media[];
|
|
10
|
+
export declare const Subtitle: Media[];
|
|
11
|
+
export declare function subscriptionMedia(s: NodeSubscriptionDescription<BaseConfig>): Media[];
|
|
12
|
+
export declare function outputMedia(s: SubscriptionProduceInfo<BaseConfig> | undefined): Media[];
|
|
13
|
+
export declare function inputMedia(s: SubscriptionAcceptInfo | undefined): Media[];
|
|
14
|
+
export type ComponentCategory = 'input' | 'output' | 'processor';
|
|
15
|
+
export type SubscriptionAcceptInfo = {
|
|
16
|
+
type: 'single-stream';
|
|
17
|
+
media: Media[];
|
|
18
|
+
} | {
|
|
19
|
+
type: 'multi-stream';
|
|
20
|
+
media: Media[];
|
|
21
|
+
};
|
|
22
|
+
export type SubscriptionProduceInfo<Config> = {
|
|
23
|
+
type: 'single-stream';
|
|
24
|
+
media: Media[];
|
|
25
|
+
} | {
|
|
26
|
+
type: 'fixed-list';
|
|
27
|
+
keys: (cfg: Config, subscriptions: NodeSubscriptionDescription<BaseConfig>[]) => FixedSubscriptionSelection[];
|
|
28
|
+
possibleMedia: Media[];
|
|
29
|
+
selector: (selection: string[], metadata: StreamMetadata[], cfg: Config, subscriptions: NodeSubscriptionDescription<BaseConfig>[]) => StreamKey[];
|
|
30
|
+
} | {
|
|
31
|
+
type: 'multi-stream';
|
|
32
|
+
media: Media[];
|
|
33
|
+
};
|
|
34
|
+
export type FixedSubscriptionSelection = {
|
|
35
|
+
key: string;
|
|
36
|
+
media: Media[];
|
|
37
|
+
display: string;
|
|
38
|
+
};
|
|
39
|
+
export type SubscriptionInfo<Config extends BaseConfig> = {
|
|
40
|
+
accepts?: SubscriptionAcceptInfo;
|
|
41
|
+
produces?: SubscriptionProduceInfo<Config>;
|
|
42
|
+
};
|
|
43
|
+
export type NodeInfo<Config extends BaseConfig, RuntimeState extends object = object, RuntimeCommand extends object = object, RuntimeEvent extends object = object> = {
|
|
44
|
+
identifier: string;
|
|
45
|
+
name: string;
|
|
46
|
+
category: ComponentCategory;
|
|
47
|
+
subscription: SubscriptionInfo<Config>;
|
|
48
|
+
display?: ((description: NodeDescription<Config>) => {
|
|
49
|
+
[key: string]: string;
|
|
50
|
+
});
|
|
51
|
+
validation?: (context: NodeValidationContext<Config>) => void;
|
|
52
|
+
extraValidation?: (context: NodeValidationContext<Config>) => void;
|
|
53
|
+
designtime?: {
|
|
54
|
+
node?: LazyExoticComponent<(props: {
|
|
55
|
+
node: NodeDescription<Config>;
|
|
56
|
+
}) => React.JSX.Element>;
|
|
57
|
+
uiEvents?: {
|
|
58
|
+
onSubscriptionAdded?: (this: NodeDescription<Config>, subscription: NodeSubscriptionDescription<Config>) => void;
|
|
59
|
+
onSubscriptionRemoved?: (this: NodeDescription<Config>, subscription: NodeSubscriptionDescription<Config>) => void;
|
|
60
|
+
onSubscriptionUpdated?: (this: NodeDescription<Config>, subscription: NodeSubscriptionDescription<Config>) => void;
|
|
61
|
+
onNodeUpdated?: (this: NodeDescription<Config>, id: string) => void;
|
|
62
|
+
onGlobalNodeUpdated?: (this: NodeDescription<Config>, node: NodeDescription<BaseConfig>, id: string) => void;
|
|
63
|
+
onNodeRemoved?: (this: NodeDescription<Config>, id: string) => void;
|
|
64
|
+
onGlobalNodeRemoved?: (this: NodeDescription<Config>, node: NodeDescription<BaseConfig>, id: string) => void;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
runtime?: {
|
|
68
|
+
initialState?: () => RuntimeState;
|
|
69
|
+
handleEvent?: (ev: RuntimeEvent, state: RuntimeState) => RuntimeState;
|
|
70
|
+
inline?: LazyExoticComponent<(props: {
|
|
71
|
+
state: RuntimeState;
|
|
72
|
+
config: Config;
|
|
73
|
+
sendCommand: (cmd: RuntimeCommand) => void;
|
|
74
|
+
}) => React.JSX.Element>;
|
|
75
|
+
summary?: LazyExoticComponent<(props: {
|
|
76
|
+
state: RuntimeState;
|
|
77
|
+
config: Config;
|
|
78
|
+
sendCommand: (cmd: RuntimeCommand) => void;
|
|
79
|
+
}) => React.JSX.Element>;
|
|
80
|
+
fullscreen?: LazyExoticComponent<(props: {
|
|
81
|
+
state: RuntimeState;
|
|
82
|
+
config: Config;
|
|
83
|
+
sendCommand: (cmd: RuntimeCommand) => void;
|
|
84
|
+
}) => React.JSX.Element>;
|
|
85
|
+
helpPopup?: {
|
|
86
|
+
jsx?: LazyExoticComponent<(props: {
|
|
87
|
+
state: RuntimeState;
|
|
88
|
+
config: Config;
|
|
89
|
+
sendCommand: (cmd: RuntimeCommand) => void;
|
|
90
|
+
}) => React.JSX.Element>;
|
|
91
|
+
simple?: {
|
|
92
|
+
title: string;
|
|
93
|
+
content: string[];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
css?: string[];
|
|
98
|
+
configForm: NodeInfoConfigForm<Config>;
|
|
99
|
+
};
|
|
100
|
+
export type SelectOption<_T> = {
|
|
101
|
+
value: unknown;
|
|
102
|
+
display: string;
|
|
103
|
+
};
|
|
104
|
+
export type CustomEditorProps<AllConfig, T> = {
|
|
105
|
+
defaultValue?: T;
|
|
106
|
+
id: string;
|
|
107
|
+
latestDocument: DocumentDescription;
|
|
108
|
+
latest: Partial<AllConfig>;
|
|
109
|
+
onChanged: (value: T) => void;
|
|
110
|
+
};
|
|
111
|
+
export type FormHint<AllConfig, T> = T extends unknown[] ? FormHintArray<AllConfig, T[number]> : FormHintSingle<AllConfig, T>;
|
|
112
|
+
export type FormHintArray<AllConfig, TElement> = {
|
|
113
|
+
type: 'multiselect';
|
|
114
|
+
options: SelectOption<TElement>[];
|
|
115
|
+
defaultValue: TElement[];
|
|
116
|
+
validation?: Z.Schema<TElement[]>;
|
|
117
|
+
} | {
|
|
118
|
+
type: 'list';
|
|
119
|
+
defaultValue: string[];
|
|
120
|
+
envOverride?: (cfg: AllConfig) => string;
|
|
121
|
+
validation?: Z.Schema<string[]>;
|
|
122
|
+
global?: GlobalValidation<AllConfig>;
|
|
123
|
+
} | {
|
|
124
|
+
type: 'form-list';
|
|
125
|
+
defaultValue: TElement[];
|
|
126
|
+
form: ConfigForm<TElement>;
|
|
127
|
+
validation?: Z.Schema<TElement>;
|
|
128
|
+
global?: GlobalValidation<AllConfig>;
|
|
129
|
+
view: LazyExoticComponent<(item: TElement) => React.JSX.Element>;
|
|
130
|
+
} | {
|
|
131
|
+
type: 'custom';
|
|
132
|
+
validation?: Z.Schema<TElement[]>;
|
|
133
|
+
defaultValue?: TElement[];
|
|
134
|
+
global?: GlobalValidation<AllConfig>;
|
|
135
|
+
component: LazyExoticComponent<(props: CustomEditorProps<AllConfig, TElement[]>) => React.JSX.Element>;
|
|
136
|
+
};
|
|
137
|
+
export type FormHintSelect<T> = {
|
|
138
|
+
type: 'select';
|
|
139
|
+
options: SelectOption<T>[];
|
|
140
|
+
defaultValue?: T;
|
|
141
|
+
optional?: boolean;
|
|
142
|
+
};
|
|
143
|
+
export type FormHintSingle<AllConfig, T> = {
|
|
144
|
+
type: 'numeric';
|
|
145
|
+
defaultValue?: number;
|
|
146
|
+
envOverride?: (cfg: AllConfig) => string;
|
|
147
|
+
validation?: Z.Schema<number | undefined>;
|
|
148
|
+
global?: GlobalValidation<AllConfig>;
|
|
149
|
+
} | {
|
|
150
|
+
type: 'text';
|
|
151
|
+
defaultValue?: string;
|
|
152
|
+
envOverride?: (cfg: AllConfig) => string;
|
|
153
|
+
validation?: Z.Schema<string | undefined>;
|
|
154
|
+
global?: GlobalValidation<AllConfig>;
|
|
155
|
+
} | FormHintSelect<T> | {
|
|
156
|
+
type: 'custom';
|
|
157
|
+
validation?: Z.Schema<T>;
|
|
158
|
+
defaultValue?: T;
|
|
159
|
+
global?: GlobalValidation<AllConfig>;
|
|
160
|
+
component: LazyExoticComponent<(props: CustomEditorProps<AllConfig, T>) => React.JSX.Element>;
|
|
161
|
+
} | {
|
|
162
|
+
type: 'boolean';
|
|
163
|
+
defaultValue?: boolean;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'form-item';
|
|
166
|
+
defaultValue?: T;
|
|
167
|
+
form: ConfigForm<T>;
|
|
168
|
+
validation?: Z.Schema<T>;
|
|
169
|
+
global?: GlobalValidation<AllConfig>;
|
|
170
|
+
view: LazyExoticComponent<(item: T) => React.JSX.Element>;
|
|
171
|
+
};
|
|
172
|
+
export type GlobalValidationUniqueKey = 'port' | 'sourceName';
|
|
173
|
+
export type GlobalValidation<AllConfig> = {
|
|
174
|
+
key: GlobalValidationUniqueKey;
|
|
175
|
+
constraint: 'unique';
|
|
176
|
+
include?: (c: AllConfig, document: DocumentDescription) => boolean;
|
|
177
|
+
} | {
|
|
178
|
+
constraint: 'custom';
|
|
179
|
+
validate: (c: AllConfig, document: DocumentDescription) => boolean;
|
|
180
|
+
message: string;
|
|
181
|
+
};
|
|
182
|
+
export type GlobalFormEntry<T> = {
|
|
183
|
+
id: string;
|
|
184
|
+
form: FormEntry<object, T>;
|
|
185
|
+
};
|
|
186
|
+
export type FormEntry<AllConfig, T> = {
|
|
187
|
+
help: string;
|
|
188
|
+
hint: FormHint<AllConfig, T>;
|
|
189
|
+
};
|
|
190
|
+
export type BaseConfig<Global = object> = {
|
|
191
|
+
id: string;
|
|
192
|
+
displayName: string;
|
|
193
|
+
__global?: Global;
|
|
194
|
+
[k: string]: unknown;
|
|
195
|
+
};
|
|
196
|
+
export type ConfigForm<Config> = {
|
|
197
|
+
[P in keyof Config]: FormEntry<Config, Config[P]>;
|
|
198
|
+
};
|
|
199
|
+
export type NodeInfoConfigForm<Config extends BaseConfig> = {
|
|
200
|
+
global?: {
|
|
201
|
+
[P in keyof Config['__global']]: GlobalFormEntry<Config['__global'][P]>;
|
|
202
|
+
};
|
|
203
|
+
form: {
|
|
204
|
+
[P in keyof Omit<Config, "id" | "displayName" | "__global">]: FormEntry<Config, Config[P]>;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
export type NodeInfoMap = {
|
|
208
|
+
[key: string]: NodeInfo<BaseConfig>;
|
|
209
|
+
};
|
|
210
|
+
export type NodeInfoTable = {
|
|
211
|
+
input: NodeInfoMap;
|
|
212
|
+
processor: {
|
|
213
|
+
transform: NodeInfoMap;
|
|
214
|
+
control: NodeInfoMap;
|
|
215
|
+
};
|
|
216
|
+
duplex: NodeInfoMap;
|
|
217
|
+
output: NodeInfoMap;
|
|
218
|
+
};
|
|
219
|
+
export type SelectorInfo = {
|
|
220
|
+
name: string;
|
|
221
|
+
description: string;
|
|
222
|
+
media: Media[];
|
|
223
|
+
validation?: string;
|
|
224
|
+
};
|
|
225
|
+
export type SelectorInfoTable = {
|
|
226
|
+
[key: string]: SelectorInfo;
|
|
227
|
+
};
|
|
228
|
+
import * as validation from './validation';
|
|
229
|
+
import * as common from './common';
|
|
230
|
+
import React, { LazyExoticComponent } from "react";
|
|
231
|
+
import { assertUnreachable } from "../shared/util";
|
|
232
|
+
export type Validation = typeof validation;
|
|
233
|
+
export declare const RegistrationConsts: {
|
|
234
|
+
defineComponent: <Config extends BaseConfig<object>, RuntimeState extends object = object, RuntimeCommand extends object = object, RuntimeEvent extends object = object>(info: NodeInfo<Config, RuntimeState, RuntimeCommand, RuntimeEvent>) => NodeInfo<Config, RuntimeState, RuntimeCommand, RuntimeEvent>;
|
|
235
|
+
assertUnreachable: typeof assertUnreachable;
|
|
236
|
+
All: Media[];
|
|
237
|
+
Audio: Media[];
|
|
238
|
+
Video: Media[];
|
|
239
|
+
Av: Media[];
|
|
240
|
+
Subtitle: Media[];
|
|
241
|
+
Playlist: Media[];
|
|
242
|
+
validation: typeof validation;
|
|
243
|
+
common: typeof common;
|
|
244
|
+
React: typeof React;
|
|
245
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.RegistrationConsts = exports.inputMedia = exports.outputMedia = exports.subscriptionMedia = exports.Subtitle = exports.Playlist = exports.Video = exports.Audio = exports.Av = exports.All = void 0;
|
|
30
|
+
exports.All = ["video", "audio", "subtitle"];
|
|
31
|
+
exports.Av = ["video", "audio"];
|
|
32
|
+
exports.Audio = ["audio"];
|
|
33
|
+
exports.Video = ["video"];
|
|
34
|
+
exports.Playlist = ["playlist"];
|
|
35
|
+
exports.Subtitle = ["subtitle"];
|
|
36
|
+
function subscriptionMedia(s) {
|
|
37
|
+
return s.streams.select;
|
|
38
|
+
}
|
|
39
|
+
exports.subscriptionMedia = subscriptionMedia;
|
|
40
|
+
function outputMedia(s) {
|
|
41
|
+
if (!s)
|
|
42
|
+
return [];
|
|
43
|
+
const t = s.type;
|
|
44
|
+
switch (t) {
|
|
45
|
+
case 'single-stream':
|
|
46
|
+
return s.media;
|
|
47
|
+
case 'multi-stream':
|
|
48
|
+
return s.media;
|
|
49
|
+
case 'fixed-list':
|
|
50
|
+
return s.possibleMedia;
|
|
51
|
+
default:
|
|
52
|
+
(0, util_1.assertUnreachable)(t);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.outputMedia = outputMedia;
|
|
56
|
+
function inputMedia(s) {
|
|
57
|
+
if (!s)
|
|
58
|
+
return [];
|
|
59
|
+
const t = s.type;
|
|
60
|
+
switch (t) {
|
|
61
|
+
case "multi-stream":
|
|
62
|
+
return s.media;
|
|
63
|
+
case "single-stream":
|
|
64
|
+
return s.media;
|
|
65
|
+
default:
|
|
66
|
+
(0, util_1.assertUnreachable)(t);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.inputMedia = inputMedia;
|
|
70
|
+
const validation = __importStar(require("./validation"));
|
|
71
|
+
const common = __importStar(require("./common"));
|
|
72
|
+
const react_1 = __importDefault(require("react"));
|
|
73
|
+
const util_1 = require("../shared/util");
|
|
74
|
+
exports.RegistrationConsts = {
|
|
75
|
+
defineComponent: (info) => info,
|
|
76
|
+
assertUnreachable: util_1.assertUnreachable,
|
|
77
|
+
All: exports.All,
|
|
78
|
+
Audio: exports.Audio,
|
|
79
|
+
Video: exports.Video,
|
|
80
|
+
Av: exports.Av,
|
|
81
|
+
Subtitle: exports.Subtitle,
|
|
82
|
+
Playlist: exports.Playlist,
|
|
83
|
+
validation,
|
|
84
|
+
common,
|
|
85
|
+
React: react_1.default,
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=client-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-types.js","sourceRoot":"","sources":["../../src/extension/client-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMa,QAAA,GAAG,GAAY,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAC9C,QAAA,EAAE,GAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACjC,QAAA,KAAK,GAAY,CAAC,OAAO,CAAC,CAAC;AAC3B,QAAA,KAAK,GAAY,CAAC,OAAO,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAY,CAAC,UAAU,CAAC,CAAC;AACjC,QAAA,QAAQ,GAAY,CAAC,UAAU,CAAC,CAAC;AAG9C,SAAgB,iBAAiB,CAAC,CAA0C;IAC1E,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAFD,8CAEC;AAED,SAAgB,WAAW,CAAC,CAAkD;IAC5E,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,eAAe;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB,KAAK,YAAY;YACf,OAAO,CAAC,CAAC,aAAa,CAAC;QACzB;YACE,IAAA,wBAAiB,EAAC,CAAC,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;AAbD,kCAaC;AAED,SAAgB,UAAU,CAAC,CAAqC;IAC9D,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAClB,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,cAAc;YACjB,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB,KAAK,eAAe;YAClB,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB;YACE,IAAA,wBAAiB,EAAC,CAAC,CAAC,CAAC;IACzB,CAAC;AACH,CAAC;AAXD,gCAWC;AAmRD,yDAA2C;AAC3C,iDAAmC;AACnC,kDAAmD;AACnD,yCAAmD;AAItC,QAAA,kBAAkB,GAAG;IAEhC,eAAe,EAAE,CAGyB,IAAkE,EAAgE,EAAE,CAAC,IAAI;IACnL,iBAAiB,EAAjB,wBAAiB;IACjB,GAAG,EAAH,WAAG;IACH,KAAK,EAAL,aAAK;IACL,KAAK,EAAL,aAAK;IACL,EAAE,EAAF,UAAE;IACF,QAAQ,EAAR,gBAAQ;IACR,QAAQ,EAAR,gBAAQ;IACR,UAAU;IACV,MAAM;IACN,KAAK,EAAL,eAAK;CACN,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const resolutionNames: readonly ["1920x1080", "1280x720", "640x360", "320x180"];
|
|
2
|
+
export type ResolutionName = typeof resolutionNames[number];
|
|
3
|
+
export declare const Resolutions: ({
|
|
4
|
+
display: "1920x1080";
|
|
5
|
+
value: {
|
|
6
|
+
width: 1920;
|
|
7
|
+
height: 1080;
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
display: "1280x720";
|
|
11
|
+
value: {
|
|
12
|
+
width: 1280;
|
|
13
|
+
height: 720;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
display: "640x360";
|
|
17
|
+
value: {
|
|
18
|
+
width: 640;
|
|
19
|
+
height: 360;
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
display: "320x180";
|
|
23
|
+
value: {
|
|
24
|
+
width: 320;
|
|
25
|
+
height: 180;
|
|
26
|
+
};
|
|
27
|
+
})[];
|
|
28
|
+
export declare const FrameRates: {
|
|
29
|
+
value: {
|
|
30
|
+
frames: number;
|
|
31
|
+
seconds: number;
|
|
32
|
+
};
|
|
33
|
+
display: string;
|
|
34
|
+
}[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FrameRates = exports.Resolutions = exports.resolutionNames = void 0;
|
|
4
|
+
exports.resolutionNames = [
|
|
5
|
+
'1920x1080',
|
|
6
|
+
'1280x720',
|
|
7
|
+
'640x360',
|
|
8
|
+
'320x180',
|
|
9
|
+
];
|
|
10
|
+
function mkResolution(resName) {
|
|
11
|
+
const [w, h] = resName.split('x');
|
|
12
|
+
return ({ display: resName, value: { width: parseInt(w), height: parseInt(h) } });
|
|
13
|
+
}
|
|
14
|
+
exports.Resolutions = exports.resolutionNames.map(mkResolution);
|
|
15
|
+
exports.FrameRates = [
|
|
16
|
+
{
|
|
17
|
+
value: { frames: 1, seconds: 1 },
|
|
18
|
+
display: "1fps"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: { frames: 24, seconds: 1 },
|
|
22
|
+
display: "24fps"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: { frames: 24001, seconds: 1001 },
|
|
26
|
+
display: "23.98fps"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: { frames: 25, seconds: 1 },
|
|
30
|
+
display: "25fps"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: { frames: 30, seconds: 1 },
|
|
34
|
+
display: "30fps"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: { frames: 50, seconds: 1 },
|
|
38
|
+
display: "50fps"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: { frames: 60, seconds: 1 },
|
|
42
|
+
display: "60fps"
|
|
43
|
+
}
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/extension/common.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG;IAC7B,WAAW;IACX,UAAU;IACV,SAAS;IACT,SAAS;CACD,CAAA;AAUV,SAAS,YAAY,CAAkC,OAAU;IAC/D,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAY,CAAA;AAC9F,CAAC;AACY,QAAA,WAAW,GAAG,uBAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAEhD,QAAA,UAAU,GAAG;IACxB;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;QAChC,OAAO,EAAE,MAAM;KAChB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;QACjC,OAAO,EAAE,OAAO;KACjB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;QACvC,OAAO,EAAE,UAAU;KACpB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;QACjC,OAAO,EAAE,OAAO;KACjB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;QACjC,OAAO,EAAE,OAAO;KACjB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;QACjC,OAAO,EAAE,OAAO;KACjB;IACD;QACE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;QACjC,OAAO,EAAE,OAAO;KACjB;CACF,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RegistrationConsts } from "./client-types";
|
|
2
|
+
export type { Media } from './client-types';
|
|
3
|
+
export type * as Document from '../shared/document';
|
|
4
|
+
import { RuntimeSystem } from "../extension/runtime-system";
|
|
5
|
+
export type Registration = typeof RegistrationConsts;
|
|
6
|
+
export default Registration;
|
|
7
|
+
export declare function autoRegisterComponents(rootDir: string, bundledInfoJs: string, componentPathToClientDir: (componentPath: string) => string): (system: RuntimeSystem) => Promise<void>;
|