@norskvideo/norsk-studio-built-ins 1.5.0 → 1.6.1

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.
Files changed (68) hide show
  1. package/client/info.js +211 -922
  2. package/client/style.css +1411 -0
  3. package/lib/index.js +1 -1
  4. package/lib/info.js +9 -17
  5. package/lib/info.js.map +1 -1
  6. package/lib/output.preview/runtime.js +3 -2
  7. package/lib/output.preview/runtime.js.map +1 -1
  8. package/lib/output.whep/runtime.js +2 -1
  9. package/lib/output.whep/runtime.js.map +1 -1
  10. package/lib/shared/webrtcSettings.d.ts +6 -0
  11. package/lib/shared/webrtcSettings.js +13 -0
  12. package/lib/shared/webrtcSettings.js.map +1 -0
  13. package/package.json +4 -4
  14. package/client/processor.audioLevel/styles.css +0 -164
  15. package/client/processor.audioMixer/styles.css +0 -249
  16. package/lib/processor.actionReplay/info.d.ts +0 -5
  17. package/lib/processor.actionReplay/info.js +0 -100
  18. package/lib/processor.actionReplay/info.js.map +0 -1
  19. package/lib/processor.actionReplay/runtime.d.ts +0 -59
  20. package/lib/processor.actionReplay/runtime.js +0 -224
  21. package/lib/processor.actionReplay/runtime.js.map +0 -1
  22. package/lib/processor.actionReplay/summary.d.ts +0 -7
  23. package/lib/processor.actionReplay/summary.js +0 -76
  24. package/lib/processor.actionReplay/summary.js.map +0 -1
  25. package/lib/processor.audioLevel/info.d.ts +0 -3
  26. package/lib/processor.audioLevel/info.js +0 -83
  27. package/lib/processor.audioLevel/info.js.map +0 -1
  28. package/lib/processor.audioLevel/inline-view.d.ts +0 -6
  29. package/lib/processor.audioLevel/inline-view.js +0 -23
  30. package/lib/processor.audioLevel/inline-view.js.map +0 -1
  31. package/lib/processor.audioLevel/runtime.d.ts +0 -49
  32. package/lib/processor.audioLevel/runtime.js +0 -82
  33. package/lib/processor.audioLevel/runtime.js.map +0 -1
  34. package/lib/processor.audioLevel/summary-view.d.ts +0 -7
  35. package/lib/processor.audioLevel/summary-view.js +0 -36
  36. package/lib/processor.audioLevel/summary-view.js.map +0 -1
  37. package/lib/processor.audioMixer/fullscreen-view.d.ts +0 -8
  38. package/lib/processor.audioMixer/fullscreen-view.js +0 -121
  39. package/lib/processor.audioMixer/fullscreen-view.js.map +0 -1
  40. package/lib/processor.audioMixer/info.d.ts +0 -4
  41. package/lib/processor.audioMixer/info.js +0 -148
  42. package/lib/processor.audioMixer/info.js.map +0 -1
  43. package/lib/processor.audioMixer/inline-view.d.ts +0 -7
  44. package/lib/processor.audioMixer/inline-view.js +0 -43
  45. package/lib/processor.audioMixer/inline-view.js.map +0 -1
  46. package/lib/processor.audioMixer/runtime.d.ts +0 -119
  47. package/lib/processor.audioMixer/runtime.js +0 -142
  48. package/lib/processor.audioMixer/runtime.js.map +0 -1
  49. package/lib/processor.audioMixer/summary-view.d.ts +0 -7
  50. package/lib/processor.audioMixer/summary-view.js +0 -11
  51. package/lib/processor.audioMixer/summary-view.js.map +0 -1
  52. package/lib/processor.fixedLadder/newFile.d.ts +0 -3
  53. package/lib/processor.fixedLadder/newFile.js +0 -145
  54. package/lib/processor.fixedLadder/newFile.js.map +0 -1
  55. package/lib/processor.monetise/info.d.ts +0 -3
  56. package/lib/processor.monetise/info.js +0 -90
  57. package/lib/processor.monetise/info.js.map +0 -1
  58. package/lib/processor.monetise/runtime.d.ts +0 -57
  59. package/lib/processor.monetise/runtime.js +0 -141
  60. package/lib/processor.monetise/runtime.js.map +0 -1
  61. package/lib/processor.monetise/summary.d.ts +0 -7
  62. package/lib/processor.monetise/summary.js +0 -39
  63. package/lib/processor.monetise/summary.js.map +0 -1
  64. package/lib/test/audio-mixer.d.ts +0 -0
  65. package/lib/test/audio-mixer.js +0 -2
  66. package/lib/test/audio-mixer.js.map +0 -1
  67. /package/{shared → client/shared}/style.css +0 -0
  68. /package/{shared → client/shared}/tailwind.css +0 -0
@@ -1,100 +0,0 @@
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.hardwareNames = void 0;
30
- const react_1 = __importDefault(require("react"));
31
- const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
32
- function default_1({ defineComponent, assertUnreachable, Av, }) {
33
- const SummaryView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./summary'))));
34
- return defineComponent({
35
- identifier: 'processor.transform.actionReplay',
36
- category: 'processor',
37
- name: "Action Replay",
38
- subscription: {
39
- accepts: {
40
- type: 'single-stream',
41
- media: Av
42
- },
43
- produces: {
44
- type: 'single-stream',
45
- media: Av
46
- },
47
- },
48
- extraValidation: (ctx) => {
49
- if (ctx.subscriptions.length == 0) {
50
- return;
51
- }
52
- if (ctx.subscriptions.length > 1) {
53
- ctx.addError("Action replay can only subscribe to a single source");
54
- return;
55
- }
56
- if (!ctx.subscriptions[0].streams.select.includes("audio")) {
57
- ctx.addError("Action replay requires audio in the subscription");
58
- }
59
- if (!ctx.subscriptions[0].streams.select.includes("video")) {
60
- ctx.addError("Action replay requires video in the subscription");
61
- }
62
- },
63
- runtime: {
64
- summary: SummaryView,
65
- initialState: () => ({
66
- replaying: false,
67
- contentPlayerUrl: undefined
68
- }),
69
- handleEvent: (ev, state) => {
70
- const evType = ev.type;
71
- switch (evType) {
72
- case "content-player-created":
73
- return { ...state, contentPlayerUrl: ev.url };
74
- case "replay-started":
75
- return { ...state, replaying: true };
76
- case "replay-finished":
77
- return { ...state, replaying: false };
78
- default:
79
- return assertUnreachable(evType);
80
- }
81
- }
82
- },
83
- display: (desc) => {
84
- const { __global: _, ...rem } = desc.config;
85
- return rem;
86
- },
87
- configForm: {
88
- global: {
89
- hardware: (0, config_1.HardwareSelection)()
90
- },
91
- form: {}
92
- }
93
- });
94
- }
95
- exports.default = default_1;
96
- exports.hardwareNames = [
97
- 'quadra',
98
- 'nvidia'
99
- ];
100
- //# sourceMappingURL=info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.actionReplay/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kDAA0B;AAC1B,uEAA+E;AAG/E,mBAAwB,EACtB,eAAe,EACf,iBAAiB,EACjB,EAAE,GACW;IACb,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,WAAW,GAAC,CAAC,CAAC;IAEhE,OAAO,eAAe,CAAgF;QACpG,UAAU,EAAE,kCAAkC;QAC9C,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,eAAe;QACrB,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;aACV;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;aACV;SACF;QACD,eAAe,EAAE,CAAC,GAAG,EAAE,EAAE;YACvB,IAAI,GAAG,CAAC,aAAa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SACF;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;YAC5C,OAAO,GAAG,CAAC;QACb,CAAC;QACD,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAA,0BAAiB,GAAE;aAC9B;YACD,IAAI,EAAE,EACL;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAlED,4BAkEC;AAEY,QAAA,aAAa,GAAG;IAC3B,QAAQ;IACR,QAAQ;CACA,CAAA"}
@@ -1,59 +0,0 @@
1
- import { AudioEncodeNode, CmafAudioOutputNode, CmafMultiVariantOutputNode, CmafVideoOutputNode, FrameStorePlayerNode, FrameStoreRecorderNode, Norsk, SourceMediaNode, StreamKey, StreamMetadataOverrideNode, StreamSwitchSmoothNode, SubscriptionError } from '@norskvideo/norsk-sdk';
2
- import { OnCreated, RelatedMediaNodes, RuntimeUpdates, ServerComponentDefinition, StudioNodeSubscriptionSource, StudioRuntime, StudioShared } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
- import { SubscriptionOpts } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
4
- import { HardwareAccelerationType } from '@norskvideo/norsk-studio/lib/shared/config';
5
- export type ActionReplayConfig = {
6
- id: string;
7
- displayName: string;
8
- __global: {
9
- hardware?: HardwareAccelerationType;
10
- };
11
- };
12
- export type ActionReplayState = {
13
- contentPlayerUrl?: string;
14
- replaying: boolean;
15
- };
16
- export type ActionReplayEvent = {
17
- type: 'content-player-created';
18
- url: string;
19
- } | {
20
- type: 'replay-started';
21
- } | {
22
- type: 'replay-finished';
23
- };
24
- export type ActionReplayCommand = {
25
- type: 'do-replay';
26
- from: number;
27
- duration: number;
28
- };
29
- export default class ActionReplayDefinition implements ServerComponentDefinition<ActionReplayConfig, ActionReplay, ActionReplayState, ActionReplayCommand, ActionReplayEvent> {
30
- create(norsk: Norsk, cfg: ActionReplayConfig, cb: OnCreated<ActionReplay>, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>): Promise<void>;
31
- handleCommand(node: ActionReplay, command: ActionReplayCommand): void;
32
- }
33
- export declare class ActionReplay {
34
- id: string;
35
- norsk: Norsk;
36
- cfg: ActionReplayConfig;
37
- initialised: Promise<void>;
38
- updates: RuntimeUpdates<ActionReplayState, ActionReplayEvent>;
39
- shared: StudioShared;
40
- relatedMediaNodes: RelatedMediaNodes;
41
- smooth?: StreamSwitchSmoothNode<'source' | 'replay'>;
42
- audioEncode?: AudioEncodeNode;
43
- videoEncode?: SourceMediaNode;
44
- audioCmaf?: CmafAudioOutputNode;
45
- videoCmaf?: CmafVideoOutputNode;
46
- mvCmaf?: CmafMultiVariantOutputNode;
47
- writer?: FrameStoreRecorderNode;
48
- reader?: FrameStorePlayerNode;
49
- currentSource?: StudioNodeSubscriptionSource;
50
- passthrough?: StreamMetadataOverrideNode;
51
- audioStreamKey?: StreamKey;
52
- videoStreamKey?: StreamKey;
53
- constructor(norsk: Norsk, cfg: ActionReplayConfig, runtime: StudioRuntime<ActionReplayState, ActionReplayEvent>);
54
- initialise(): Promise<void>;
55
- subscribe(sources: StudioNodeSubscriptionSource[], _opts?: SubscriptionOpts | undefined): void;
56
- replay(from: number, duration: number): Promise<void>;
57
- sourceContextChange(_responseCallback: (error?: SubscriptionError) => void): Promise<boolean>;
58
- teardown(): void;
59
- }
@@ -1,224 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionReplay = void 0;
4
- const norsk_sdk_1 = require("@norskvideo/norsk-sdk");
5
- const runtime_types_1 = require("@norskvideo/norsk-studio/lib/extension/runtime-types");
6
- const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
7
- const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
8
- const os_1 = require("os");
9
- const config_1 = require("@norskvideo/norsk-studio/lib/shared/config");
10
- class ActionReplayDefinition {
11
- async create(norsk, cfg, cb, runtime) {
12
- const node = new ActionReplay(norsk, cfg, runtime);
13
- await node.initialised;
14
- cb(node);
15
- }
16
- handleCommand(node, command) {
17
- const cmdType = command.type;
18
- switch (cmdType) {
19
- case 'do-replay':
20
- void node.replay(command.from, command.duration);
21
- break;
22
- default:
23
- (0, util_1.assertUnreachable)(cmdType);
24
- }
25
- }
26
- }
27
- exports.default = ActionReplayDefinition;
28
- class ActionReplay {
29
- id;
30
- norsk;
31
- cfg;
32
- initialised;
33
- updates;
34
- shared;
35
- relatedMediaNodes = new runtime_types_1.RelatedMediaNodes();
36
- smooth;
37
- audioEncode;
38
- videoEncode;
39
- audioCmaf;
40
- videoCmaf;
41
- mvCmaf;
42
- writer;
43
- reader;
44
- currentSource;
45
- passthrough;
46
- audioStreamKey;
47
- videoStreamKey;
48
- constructor(norsk, cfg, runtime) {
49
- this.id = cfg.id;
50
- this.norsk = norsk;
51
- this.cfg = cfg;
52
- this.updates = runtime.updates;
53
- this.shared = runtime.shared;
54
- this.initialised = this.initialise();
55
- }
56
- async initialise() {
57
- this.passthrough = await this.norsk.processor.transform.streamMetadataOverride({
58
- id: `${this.id}-output`,
59
- });
60
- this.relatedMediaNodes.addOutput(this.passthrough);
61
- }
62
- subscribe(sources, _opts) {
63
- this.currentSource = sources[0];
64
- this.currentSource.registerForContextChange(this);
65
- void this.sourceContextChange(() => { });
66
- }
67
- async replay(from, duration) {
68
- if (this.reader) {
69
- (0, logging_1.debuglog)("Multiple replay attempts started, ignoring", { from, duration });
70
- return;
71
- }
72
- if (!this.smooth || !this.currentSource || !this.currentSource.source.relatedMediaNodes.output) {
73
- (0, logging_1.errorlog)("Attempt to do replay before node is set up???", { from, duration });
74
- return;
75
- }
76
- if (!this.audioStreamKey || !this.videoStreamKey) {
77
- (0, logging_1.errorlog)("Attempt to do replay with no known stream keys", { from, duration });
78
- return;
79
- }
80
- this.updates.raiseEvent({
81
- type: 'replay-started'
82
- });
83
- const smooth = this.smooth;
84
- const currentSource = this.currentSource;
85
- this.reader = await this.norsk.input.frameStore({
86
- id: `${this.id}-reader`,
87
- name: `${this.id}-store`,
88
- streamSelection: [
89
- this.videoStreamKey,
90
- this.audioStreamKey
91
- ],
92
- cuts: [{
93
- durationMs: duration * 1000,
94
- startDateTime: new Date((new Date()).getTime() - (from * 1000))
95
- }],
96
- trimPartialSegments: true,
97
- sourceName: `${this.id}-cut`,
98
- onCreate: (node) => {
99
- smooth.subscribeToPins(currentSource.selectAvToPin("source").concat([
100
- { source: node, sourceSelector: (0, norsk_sdk_1.avToPin)("replay") }
101
- ]));
102
- },
103
- onClose: () => {
104
- this.reader = undefined;
105
- this.updates.raiseEvent({
106
- type: 'replay-finished'
107
- });
108
- smooth.subscribeToPins(currentSource.selectAvToPin("source"));
109
- }
110
- });
111
- }
112
- async sourceContextChange(_responseCallback) {
113
- if (!this.currentSource) {
114
- this.teardown();
115
- return false;
116
- }
117
- const latestStreams = this.currentSource?.latestStreams();
118
- if (latestStreams.length < 2) {
119
- this.teardown();
120
- return false;
121
- }
122
- const video = latestStreams.find((s) => s.metadata.message.case == 'video');
123
- const audio = latestStreams.find((s) => s.metadata.message.case == 'audio');
124
- if (!video || !audio) {
125
- this.teardown();
126
- return false;
127
- }
128
- const videoMetadata = video.metadata.message.value;
129
- const audioMetadata = audio.metadata.message.value;
130
- this.audioStreamKey = audio.metadata.streamKey;
131
- this.videoStreamKey = video.metadata.streamKey;
132
- (0, logging_1.infolog)("Action replay node has a valid context, spinning up some nodes", { videoMetadata, audioMetadata });
133
- this.smooth = await this.norsk.processor.control.streamSwitchSmooth({
134
- id: `${this.id}-switch`,
135
- outputSource: `${this.id}-source`,
136
- outputResolution: { width: videoMetadata.width, height: videoMetadata.height },
137
- frameRate: videoMetadata.frameRate ?? { frames: 25, seconds: 1 },
138
- sampleRate: audioMetadata.sampleRate,
139
- channelLayout: audioMetadata.channelLayout ?? 'stereo',
140
- hardwareAcceleration: (0, config_1.contractHardwareAcceleration)(this.cfg.__global.hardware, ["quadra", "nvidia"]),
141
- activeSource: 'source',
142
- transitionDurationMs: 500.0,
143
- onInboundContextChange: async (ctx) => {
144
- if (ctx.get('replay')?.length == 2) {
145
- this.smooth?.switchSource('replay');
146
- }
147
- else {
148
- this.smooth?.switchSource('source');
149
- }
150
- }
151
- });
152
- this.relatedMediaNodes.addInput(this.smooth);
153
- const dir = (0, os_1.tmpdir)();
154
- this.writer = await this.norsk.output.frameStore({
155
- id: `${this.id}-store`,
156
- name: `${this.id}-store`,
157
- path: dir,
158
- chunkFileDurationSeconds: 60,
159
- });
160
- this.videoEncode = await this.shared.previewEncode(this.currentSource.selectStreams((0, norsk_sdk_1.selectExactKey)(this.videoStreamKey))[0], this.cfg.__global.hardware);
161
- this.audioEncode = await this.norsk.processor.transform.audioEncode({
162
- id: `${this.id}-audio-encode`,
163
- channelLayout: 'stereo',
164
- bitrate: 64000,
165
- outputRenditionName: `${this.id}-preview`,
166
- codec: {
167
- kind: 'aac',
168
- sampleRate: audioMetadata.sampleRate,
169
- profile: 'lc'
170
- }
171
- });
172
- const localDestination = {
173
- id: `${this.id}-local`,
174
- type: 'local',
175
- retentionPeriodSeconds: 360
176
- };
177
- this.audioCmaf = await this.norsk.output.cmafAudio({
178
- id: `${this.id}-cmaf-audio`,
179
- segmentDurationSeconds: 2,
180
- partDurationSeconds: 0.5,
181
- destinations: [localDestination]
182
- });
183
- this.videoCmaf = await this.norsk.output.cmafVideo({
184
- id: `${this.id}-cmaf-video`,
185
- segmentDurationSeconds: 2,
186
- partDurationSeconds: 0.5,
187
- destinations: [localDestination]
188
- });
189
- this.mvCmaf = await this.norsk.output.cmafMultiVariant({
190
- id: `${this.id}-cmaf-mv`,
191
- playlistName: `${this.id}-mv`,
192
- destinations: [localDestination]
193
- });
194
- this.smooth.subscribeToPins(this.currentSource.selectAvToPin("source"), (ctx) => {
195
- if (ctx.streams.length == 2)
196
- return 'accept';
197
- return 'deny';
198
- });
199
- this.audioEncode.subscribe(this.currentSource.selectAudio());
200
- this.audioCmaf.subscribe([
201
- { source: this.audioEncode, sourceSelector: norsk_sdk_1.selectAudio }
202
- ]);
203
- this.videoCmaf.subscribe([
204
- { source: this.videoEncode, sourceSelector: norsk_sdk_1.selectVideo }
205
- ]);
206
- this.mvCmaf.subscribe([
207
- { source: this.audioCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
208
- { source: this.videoCmaf, sourceSelector: norsk_sdk_1.selectPlaylist },
209
- ]);
210
- this.updates.raiseEvent({
211
- type: 'content-player-created',
212
- url: this.mvCmaf.url
213
- });
214
- this.passthrough?.subscribe([
215
- { source: this.smooth, sourceSelector: norsk_sdk_1.selectAV }
216
- ]);
217
- this.writer.subscribe(this.currentSource.selectStreams());
218
- return false;
219
- }
220
- teardown() {
221
- }
222
- }
223
- exports.ActionReplay = ActionReplay;
224
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/processor.actionReplay/runtime.ts"],"names":[],"mappings":";;;AAAA,qDAG+B;AAE/B,wFAA0M;AAE1M,mEAA6E;AAC7E,yEAA0F;AAC1F,2BAA4B;AAC5B,uEAAoH;AA+BpH,MAAqB,sBAAsB;IACzC,KAAK,CAAC,MAAM,CAAC,KAAY,EAAE,GAAuB,EAAE,EAA2B,EAAE,OAA4D;QAC3I,MAAM,IAAI,GAAG,IAAI,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,EAAE,CAAC,IAAI,CAAC,CAAC;IACX,CAAC;IACD,aAAa,CAAC,IAAkB,EAAE,OAA4B;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,WAAW;gBACd,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACjD,MAAM;YACR;g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Command }: {
3
- state: ActionReplayState;
4
- config: ActionReplayConfig;
5
- sendCommand: (cmd: ActionReplayCommand) => void;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export default InlineView;
@@ -1,76 +0,0 @@
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
- const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = require("react");
8
- const hls_js_1 = __importDefault(require("hls.js"));
9
- let changingDuration = false;
10
- function InlineView({ state, config, sendCommand }) {
11
- const url = state.contentPlayerUrl;
12
- const id = config.id;
13
- const previewVideo = (0, react_1.useRef)(null);
14
- const [lastSeek, setLastSeek] = (0, react_1.useState)(undefined);
15
- const [playbackDuration, setPlaybackDuration] = (0, react_1.useState)(10);
16
- (0, react_1.useEffect)(() => {
17
- if (!url)
18
- return;
19
- if (!previewVideo.current)
20
- return;
21
- if (hls_js_1.default.isSupported()) {
22
- const hls = new hls_js_1.default();
23
- hls.loadSource(url);
24
- hls.attachMedia(previewVideo.current);
25
- }
26
- else if (previewVideo.current.canPlayType('application/vnd.apple.mpegurl')) {
27
- previewVideo.current.src = url;
28
- }
29
- }, [state.contentPlayerUrl]);
30
- if (!url)
31
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "..." });
32
- return (0, jsx_runtime_1.jsxs)("div", { className: "mb-5", children: [(0, jsx_runtime_1.jsx)("h5", { children: "Preview" }), (0, jsx_runtime_1.jsx)("video", { ref: previewVideo, controls: true, onSeeked: onSeeked, autoPlay: true, muted: true, className: state.replaying ? "hidden" : "", id: `${id}-video` }), state.replaying ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Current Performing Replay" }) :
33
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [lastSeek ?
34
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("p", { children: ["Replay from ", lastSeek.time.toFixed(1), "(s) "] }), (0, jsx_runtime_1.jsxs)("p", { className: "block mb-2 text-sm font-medium text-gray-900 dark:text-white", children: ["Duration: ", playbackDuration, "s"] }), (0, jsx_runtime_1.jsx)("input", { id: "duration-range", type: "range", min: currentMinDuration(), max: currentMaxDuration(), defaultValue: playbackDuration, className: "w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700", onChange: onDurationChange, onInput: onDurationChange })] })
35
- :
36
- (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}), (0, jsx_runtime_1.jsx)("button", { onClick: sendReplayCommand, type: "button", className: "mt-2 mb-2 text-white w-full justify-center bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800", children: "Replay" })] })] });
37
- function sendReplayCommand() {
38
- if (!previewVideo.current)
39
- return;
40
- if (!lastSeek)
41
- return;
42
- const fromHead = previewVideo.current.duration - lastSeek.time;
43
- sendCommand({
44
- type: "do-replay",
45
- from: fromHead,
46
- duration: playbackDuration
47
- });
48
- }
49
- function onDurationChange(e) {
50
- const v = parseInt(e.currentTarget.value, 10);
51
- setPlaybackDuration(v);
52
- }
53
- function currentMinDuration() {
54
- if (!previewVideo.current || !lastSeek)
55
- return 10;
56
- return Math.min(10, previewVideo.current.duration - lastSeek.time);
57
- }
58
- function currentMaxDuration() {
59
- if (!previewVideo.current || !lastSeek)
60
- return 30;
61
- return Math.min(30, previewVideo.current.duration - lastSeek.time);
62
- }
63
- function onSeeked() {
64
- if (changingDuration) {
65
- changingDuration = false;
66
- return;
67
- }
68
- const v = previewVideo.current;
69
- if (v?.currentTime && v.duration)
70
- setLastSeek({ time: v?.currentTime, end: v?.duration });
71
- else
72
- setLastSeek(undefined);
73
- }
74
- }
75
- exports.default = InlineView;
76
- //# sour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C5D,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC9C,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,SAAS,kBAAkB;QACzB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,SAAS,kBAAkB;QACzB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,QAAQ;YAAE,OAAO,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;IAED,SAAS,QAAQ;QACf,IAAI,gBAAgB,EAAE,CAAC;YACrB,gBAAgB,GAAG,KAAK,CAAC;YACzB,OAAO;QACT,CAAC;QACD,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,EAAE,WAAW,IAAI,CAAC,CAAC,QAAQ;YAC9B,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;;YAEvD,WAAW,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,kBAAe,UAAU,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { AudioLevelCommand, AudioLevelEvent, AudioLevelSettings, AudioLevelState } from "./runtime";
2
- import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
3
- export default function ({ defineComponent, Audio, validation: { Z }, }: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<AudioLevelSettings, AudioLevelState, AudioLevelCommand, AudioLevelEvent>;
@@ -1,83 +0,0 @@
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
- const react_1 = __importDefault(require("react"));
30
- function default_1({ defineComponent, Audio, validation: { Z }, }) {
31
- const InlineView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./inline-view'))));
32
- const SummaryView = react_1.default.lazy(async () => Promise.resolve().then(() => __importStar(require('./summary-view'))));
33
- return defineComponent({
34
- identifier: 'processor.audioLevel',
35
- category: 'processor',
36
- name: "Audio Levels",
37
- subscription: {
38
- accepts: {
39
- type: "single-stream",
40
- media: Audio
41
- },
42
- produces: {
43
- type: "single-stream",
44
- media: Audio,
45
- }
46
- },
47
- extraValidation: function (ctx) {
48
- ctx.requireAudio(1);
49
- },
50
- display: (_desc) => { return {}; },
51
- css: ["styles.css"],
52
- runtime: {
53
- initialState: () => ({}),
54
- handleEvent(ev, state) {
55
- const evType = ev.type;
56
- switch (evType) {
57
- case 'audio-levels':
58
- state.levels = ev.levels;
59
- break;
60
- case 'set-gain':
61
- state.sliderGain = ev.sliderGain;
62
- state.nodeGain = ev.nodeGain;
63
- break;
64
- default:
65
- assertUnreachable(evType);
66
- }
67
- return { ...state };
68
- },
69
- inline: InlineView,
70
- summary: SummaryView,
71
- },
72
- configForm: {
73
- form: {
74
- defaultGain: { help: "The default gain for audio dB", hint: { type: 'numeric', validation: Z.number().gte(-40).lte(40), defaultValue: 0 } },
75
- }
76
- }
77
- });
78
- }
79
- exports.default = default_1;
80
- function assertUnreachable(_) {
81
- throw new Error("Didn't expect to get here");
82
- }
83
- //# sourceMappingURL=info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/processor.audioLevel/info.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAA0B;AAI1B,mBAAwB,EACtB,eAAe,EACf,KAAK,EACL,UAAU,EAAE,EAAE,CAAC,EAAE,GACJ;IAEb,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,eAAe,GAAC,CAAC,CAAC;IACnE,MAAM,WAAW,GAAG,eAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,mDAAQ,gBAAgB,GAAC,CAAC,CAAC;IAErE,OAAO,eAAe,CAA0E;QAC9F,UAAU,EAAE,sBAAsB;QAClC,QAAQ,EAAE,WAAW;QACrB,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE;YAEZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,KAAK;aACb;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,KAAK;aACb;SACF;QACD,eAAe,EAAE,UAAS,GAAG;YAC3B,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;QAClC,GAAG,EAAE,CAAC,YAAY,CAAC;QACnB,OAAO,EAAE;YACP,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;YACxB,WAAW,CAAC,EAAE,EAAE,KAAK;gBACnB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC;gBACvB,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,cAAc;wBACjB,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;wBACzB,MAAM;oBACR,KAAK,UAAU;wBACb,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAA;wBAChC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAA;wBAC5B,MAAM;oBACR;wBACE,iBAAiB,CAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC;gBACD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;YACtB,CAAC;YACD,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,WAAW;SACrB;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,WAAW,EAAE,EAAE,IAAI,EAAE,+BAA+B,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE;aAC5I;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAvDD,4BAuDC;AAED,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC/C,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { AudioLevelState, AudioLevelSettings } from "./runtime";
2
- declare function InlineView({ state }: {
3
- state: AudioLevelState;
4
- config: AudioLevelSettings;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- export default InlineView;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- function InlineView({ state }) {
5
- function percentage(levels) {
6
- if (!levels) {
7
- return 0;
8
- }
9
- if (levels.peak == 0 && levels.rms == 0) {
10
- return 0;
11
- }
12
- const rebase = levels.rms - 12.0;
13
- const capped = 0 - (rebase / 112);
14
- const snapped = Math.floor(capped * 10.0) * 10;
15
- return Math.max(0, 100 - snapped);
16
- }
17
- if (!state.levels) {
18
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
19
- }
20
- return (0, jsx_runtime_1.jsx)("div", { className: "audio-level-container-inline", children: (0, jsx_runtime_1.jsx)("div", { className: "preview-levels-inline", children: (0, jsx_runtime_1.jsx)("div", { className: `preview-level clip-${percentage(state.levels)}` }) }) });
21
- }
22
- exports.default = InlineView;
23
- //# sourceMappingURL=inline-view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-view.js","sourceRoot":"","sources":["../../src/processor.audioLevel/inline-view.tsx"],"names":[],"mappings":";;;AAEA,SAAS,UAAU,CAAC,EAAE,KAAK,EAA0D;IACnF,SAAS,UAAU,CAAC,MAAkD;QACpE,IAAI,CAAC,MAAM,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAC1B,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;YAAC,OAAO,CAAC,CAAC;QAAC,CAAC;QAGtD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC;QAGjC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;QAGlC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,kDAAK,CAAA;IACd,CAAC;IAED,OAAO,gCAAK,SAAS,EAAC,8BAA8B,YAClD,gCAAK,SAAS,EAAC,uBAAuB,YACpC,gCAAK,SAAS,EAAE,sBAAsB,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,GAAQ,GACpE,GACD,CAAA;AACT,CAAC;AAED,kBAAe,UAAU,CAAC"}