@norskvideo/norsk-studio-built-ins 1.27.0-2025-04-05-fad1c39a → 1.27.0-2025-04-07-8f68de69
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 +6824 -1190
- package/lib/info.js +29 -21
- package/lib/info.js.map +1 -1
- package/lib/output.autoCmaf/info.js +4 -132
- package/lib/output.autoCmaf/info.js.map +1 -1
- package/lib/output.autoCmaf/runtime.js +4 -54
- package/lib/output.autoCmaf/runtime.js.map +1 -1
- package/lib/output.autoCmaf/types.d.ts +31 -31
- package/lib/output.autoCmaf/types.yaml +4 -85
- package/lib/output.cmafMultiVariant/info.d.ts +15 -0
- package/lib/output.cmafMultiVariant/info.js +91 -0
- package/lib/output.cmafMultiVariant/info.js.map +1 -0
- package/lib/output.cmafMultiVariant/runtime.d.ts +37 -0
- package/lib/output.cmafMultiVariant/runtime.js +158 -0
- package/lib/output.cmafMultiVariant/runtime.js.map +1 -0
- package/lib/output.cmafMultiVariant/types.d.ts +130 -0
- package/lib/output.cmafMultiVariant/types.js +3 -0
- package/lib/output.cmafMultiVariant/types.js.map +1 -0
- package/lib/output.cmafMultiVariant/types.yaml +74 -0
- package/lib/output.cmafPlaylist/info.d.ts +22 -0
- package/lib/output.cmafPlaylist/info.js +114 -0
- package/lib/output.cmafPlaylist/info.js.map +1 -0
- package/lib/output.cmafPlaylist/runtime.d.ts +41 -0
- package/lib/output.cmafPlaylist/runtime.js +239 -0
- package/lib/output.cmafPlaylist/runtime.js.map +1 -0
- package/lib/output.cmafPlaylist/types.d.ts +155 -0
- package/lib/output.cmafPlaylist/types.js +3 -0
- package/lib/output.cmafPlaylist/types.js.map +1 -0
- package/lib/output.cmafPlaylist/types.yaml +90 -0
- package/lib/output.tsMediaPlaylist/info.d.ts +22 -0
- package/lib/output.tsMediaPlaylist/info.js +113 -0
- package/lib/output.tsMediaPlaylist/info.js.map +1 -0
- package/lib/output.tsMediaPlaylist/runtime.d.ts +41 -0
- package/lib/output.tsMediaPlaylist/runtime.js +225 -0
- package/lib/output.tsMediaPlaylist/runtime.js.map +1 -0
- package/lib/output.tsMediaPlaylist/types.d.ts +155 -0
- package/lib/output.tsMediaPlaylist/types.js +3 -0
- package/lib/output.tsMediaPlaylist/types.js.map +1 -0
- package/lib/output.tsMediaPlaylist/types.yaml +90 -0
- package/lib/output.tsMultiVariant/info.d.ts +15 -0
- package/lib/output.tsMultiVariant/info.js +91 -0
- package/lib/output.tsMultiVariant/info.js.map +1 -0
- package/lib/output.tsMultiVariant/runtime.d.ts +37 -0
- package/lib/output.tsMultiVariant/runtime.js +157 -0
- package/lib/output.tsMultiVariant/runtime.js.map +1 -0
- package/lib/output.tsMultiVariant/types.d.ts +130 -0
- package/lib/output.tsMultiVariant/types.js +3 -0
- package/lib/output.tsMultiVariant/types.js.map +1 -0
- package/lib/output.tsMultiVariant/types.yaml +74 -0
- package/lib/processor.fixedLadder/info.d.ts +3 -3
- package/lib/processor.fixedLadder/info.js +1159 -73
- package/lib/processor.fixedLadder/info.js.map +1 -1
- package/lib/processor.fixedLadder/nvidia-rate-control-view.d.ts +4 -0
- package/lib/processor.fixedLadder/nvidia-rate-control-view.js +20 -0
- package/lib/processor.fixedLadder/nvidia-rate-control-view.js.map +1 -0
- package/lib/processor.fixedLadder/nvidia-view.d.ts +5 -0
- package/lib/processor.fixedLadder/nvidia-view.js +20 -0
- package/lib/processor.fixedLadder/nvidia-view.js.map +1 -0
- package/lib/processor.fixedLadder/quadra-view.d.ts +6 -0
- package/lib/processor.fixedLadder/quadra-view.js +22 -0
- package/lib/processor.fixedLadder/quadra-view.js.map +1 -0
- package/lib/processor.fixedLadder/runtime.js.map +1 -1
- package/lib/processor.fixedLadder/software-view.d.ts +5 -0
- package/lib/processor.fixedLadder/software-view.js +20 -0
- package/lib/processor.fixedLadder/software-view.js.map +1 -0
- package/lib/processor.fixedLadder/types.d.ts +108 -20
- package/lib/processor.fixedLadder/types.yaml +241 -34
- package/lib/processor.fixedLadder/x26x-bitrate-view.d.ts +4 -0
- package/lib/processor.fixedLadder/x26x-bitrate-view.js +20 -0
- package/lib/processor.fixedLadder/x26x-bitrate-view.js.map +1 -0
- package/lib/shared/cmaf.d.ts +17 -0
- package/lib/shared/cmaf.js +198 -0
- package/lib/shared/cmaf.js.map +1 -0
- package/lib/{output.autoCmaf/form-views.d.ts → shared/playlist-form-views.d.ts} +1 -1
- package/lib/{output.autoCmaf/form-views.js → shared/playlist-form-views.js} +1 -1
- package/lib/shared/playlist-form-views.js.map +1 -0
- package/lib/shared/types.d.ts +158 -0
- package/lib/shared/types.js +3 -0
- package/lib/shared/types.js.map +1 -0
- package/lib/shared/types.yaml +182 -0
- package/package.json +3 -3
- package/lib/output.autoCmaf/form-views.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.cmafPlaylist/info.ts"],"names":[],"mappings":";;AAMA,4BA8GC;AAlHD,mEAA6E;AAC7E,yEAAsE;AACtE,yCAAyE;AAEzE,mBAAwB,YAA0B;IAChD,MAAM,EACJ,eAAe,EACf,UAAU,GACX,GAAG,YAAY,CAAC;IACjB,MAAM,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC;IAEzB,OAAO,eAAe,CAAkF;QACtG,UAAU,EAAE,qBAAqB;QACjC,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,6FAA6F;QAC1G,IAAI,EAAE,2BAAY;QAClB,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,SAAS,EAAE,IAAI;gBACf,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,KAAK;aACnB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,eAAe;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,eAAe,EAAE,CAAC,GAAG,E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AAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;qBAC/E;iBACF;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,gEAAgE;oBACtE,IAAI,EAAE;wBACJ,IAAI,EAAE,SAAS;wBACf,YAAY,EAAE,KAAK;qBACpB;iBACF;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,kHAAkH;oBACxH,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACf;iBACF;gBACD,QAAQ,EAAE,uBAAgB;gBAC1B,YAAY,EAAE,4BAAqB;gBACnC,YAAY,EAAE;oBACZ,IAAI,EAAE,8DAA8D;oBACpE,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,YAAY,EAAE,SAAS;wBACvB,WAAW,EAAE,IAAI;wBACjB,OAAO,EAAE;4BACP;gCACE,OAAO,EAAE,SAAS;gCAClB,KAAK,EAAE,SAAS;6BACjB;4BACD;gCACE,OAAO,EAAE,UAAU;gCACnB,KAAK,EAAE,UAAU;6BAClB;yBACF;qBACF;iBACF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,uCAAuC;oBAC7C,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;iBACvC;aACF;SACF;KACF,CAAC,CAAC;AACL,CAAC"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { AncillaryNode, CmafAudioOutputNode, CmafDestinationSettings, CmafVideoOutputNode, CmafWebVttOutputNode, Norsk } from '@norskvideo/norsk-sdk';
|
2
|
+
import { InstanceRouteInfo, OnCreated, ServerComponentDefinition, StudioRuntime, StudioComponentInputStream, ServerComponentSchemas } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
|
3
|
+
import { CustomAutoDuplexNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
|
4
|
+
import { CryptoDetails } from '../shared/drm/cpix';
|
5
|
+
import { components } from './types';
|
6
|
+
export type CmafPlaylistSettings = components['schemas']['CmafConfig'];
|
7
|
+
export type CmafPlaylistState = components['schemas']['CmafOutputState'];
|
8
|
+
export type CmafPlaylistCommand = {
|
9
|
+
type: 'enable-output' | 'disable-output';
|
10
|
+
};
|
11
|
+
export type CmafPlaylistEvent = {
|
12
|
+
type: 'output-enabled' | 'output-disabled';
|
13
|
+
};
|
14
|
+
declare class CmafPlaylist extends CustomAutoDuplexNode {
|
15
|
+
norsk: Norsk;
|
16
|
+
cfg: CmafPlaylistSettings;
|
17
|
+
outputNode: CmafVideoOutputNode | CmafAudioOutputNode | CmafWebVttOutputNode | null;
|
18
|
+
ancillary: AncillaryNode | null;
|
19
|
+
enabled: boolean;
|
20
|
+
initialised: Promise<void>;
|
21
|
+
runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>;
|
22
|
+
currentSources: StudioComponentInputStream[];
|
23
|
+
destinations: CmafDestinationSettings[];
|
24
|
+
advertDestinations: string[];
|
25
|
+
sessionId?: string;
|
26
|
+
crypto?: CryptoDetails;
|
27
|
+
static create(norsk: Norsk, cfg: CmafPlaylistSettings, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>): Promise<CmafPlaylist>;
|
28
|
+
constructor(cfg: CmafPlaylistSettings, norsk: Norsk, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>);
|
29
|
+
initialise(): Promise<void>;
|
30
|
+
enableOutput(): Promise<void>;
|
31
|
+
disableOutput(): Promise<void>;
|
32
|
+
subscribe(sources: StudioComponentInputStream[]): Promise<void>;
|
33
|
+
subscribeImpl(sources: StudioComponentInputStream[]): Promise<void>;
|
34
|
+
}
|
35
|
+
export default class CmafPlaylistDefinition implements ServerComponentDefinition<CmafPlaylistSettings, CmafPlaylist, CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent> {
|
36
|
+
create(norsk: Norsk, cfg: CmafPlaylistSettings, cb: OnCreated<CmafPlaylist>, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>): Promise<void>;
|
37
|
+
handleCommand(node: CmafPlaylist, command: CmafPlaylistCommand): Promise<void>;
|
38
|
+
instanceRoutes(): Promise<InstanceRouteInfo<CmafPlaylistSettings, CmafPlaylist, CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>[]>;
|
39
|
+
schemas(): Promise<ServerComponentSchemas>;
|
40
|
+
}
|
41
|
+
export {};
|
@@ -0,0 +1,239 @@
|
|
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 base_nodes_1 = require("@norskvideo/norsk-studio/lib/extension/base-nodes");
|
7
|
+
const logging_1 = require("@norskvideo/norsk-studio/lib/server/logging");
|
8
|
+
const ezdrm_1 = require("../shared/drm/ezdrm");
|
9
|
+
const axinom_1 = require("../shared/drm/axinom");
|
10
|
+
const path_1 = __importDefault(require("path"));
|
11
|
+
const schemas_1 = require("../shared/schemas");
|
12
|
+
const api_1 = require("@norskvideo/norsk-studio/lib/server/api");
|
13
|
+
const cmaf_1 = require("../shared/cmaf");
|
14
|
+
class CmafPlaylist extends base_nodes_1.CustomAutoDuplexNode {
|
15
|
+
norsk;
|
16
|
+
cfg;
|
17
|
+
outputNode = null;
|
18
|
+
ancillary = null;
|
19
|
+
enabled = true;
|
20
|
+
initialised;
|
21
|
+
runtime;
|
22
|
+
currentSources = [];
|
23
|
+
destinations;
|
24
|
+
advertDestinations = [];
|
25
|
+
sessionId;
|
26
|
+
crypto;
|
27
|
+
static async create(norsk, cfg, runtime) {
|
28
|
+
const node = new CmafPlaylist(cfg, norsk, runtime);
|
29
|
+
await node.initialised;
|
30
|
+
return node;
|
31
|
+
}
|
32
|
+
constructor(cfg, norsk, runtime) {
|
33
|
+
super(cfg.id);
|
34
|
+
this.cfg = cfg;
|
35
|
+
this.id = cfg.id;
|
36
|
+
this.norsk = norsk;
|
37
|
+
this.runtime = runtime;
|
38
|
+
this.enabled = cfg.initialState == 'enabled';
|
39
|
+
if (!this.enabled) {
|
40
|
+
runtime.updates.raiseEvent({ type: 'output-disabled' });
|
41
|
+
}
|
42
|
+
if (this.cfg.sessionId) {
|
43
|
+
this.sessionId = (Math.random() + 1).toString(36).substring(7);
|
44
|
+
}
|
45
|
+
const r = (0, cmaf_1.reifyDestinations)({ publishingGroup: cfg.publishingGroup ?? "cmaf", destinations: cfg.destinations, segments: cfg.segments, sessionId: this.sessionId });
|
46
|
+
this.destinations = r.destinations;
|
47
|
+
this.advertDestinations = r.advertDestinations;
|
48
|
+
this.initialised = this.initialise();
|
49
|
+
}
|
50
|
+
async initialise() {
|
51
|
+
if (this.cfg.drmProvider) {
|
52
|
+
if (this.cfg.drmProvider === 'ezdrm') {
|
53
|
+
this.crypto = await (0, ezdrm_1.ezdrmInit)(this.cfg.__global?.ezdrmConfig);
|
54
|
+
}
|
55
|
+
if (this.cfg.drmProvider === 'axinom') {
|
56
|
+
this.crypto = await (0, axinom_1.axinomInit)(this.cfg.__global?.axinomConfig);
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
async enableOutput() {
|
61
|
+
if (!this.enabled) {
|
62
|
+
this.enabled = true;
|
63
|
+
this.runtime.updates.raiseEvent({ type: 'output-enabled' });
|
64
|
+
await this.subscribeImpl(this.currentSources);
|
65
|
+
(0, logging_1.debuglog)("Output enabled", { id: this.id });
|
66
|
+
}
|
67
|
+
}
|
68
|
+
async disableOutput() {
|
69
|
+
if (this.enabled) {
|
70
|
+
this.enabled = false;
|
71
|
+
if (this.outputNode) {
|
72
|
+
await this.outputNode.close();
|
73
|
+
this.outputNode = null;
|
74
|
+
}
|
75
|
+
this.runtime.updates.raiseEvent({
|
76
|
+
type: 'output-disabled'
|
77
|
+
});
|
78
|
+
(0, logging_1.debuglog)("Output disabled", { id: this.id });
|
79
|
+
}
|
80
|
+
}
|
81
|
+
async subscribe(sources) {
|
82
|
+
this.currentSources = sources;
|
83
|
+
await this.subscribeImpl(this.currentSources);
|
84
|
+
}
|
85
|
+
async subscribeImpl(sources) {
|
86
|
+
if (!this.enabled || sources.filter((s) => s.metadata).length == 0) {
|
87
|
+
(0, logging_1.debuglog)("Skipping context handling - output disabled", { id: this.id });
|
88
|
+
await this.outputNode?.close();
|
89
|
+
this.outputNode = null;
|
90
|
+
return;
|
91
|
+
}
|
92
|
+
const videoSource = sources.find((s) => s.isMedia("video"));
|
93
|
+
const audioSource = sources.find((s) => s.isMedia("audio"));
|
94
|
+
const subtitleSource = sources.find((s) => s.isMedia("subtitle"));
|
95
|
+
const ancillarySource = sources.find((s) => s.isMedia("ancillary"));
|
96
|
+
if (!this.outputNode) {
|
97
|
+
if (videoSource) {
|
98
|
+
const videoCryptoSettings = this.crypto ? {
|
99
|
+
encryption: this.crypto.video,
|
100
|
+
m3uAdditions: this.crypto.video.mediaSignaling,
|
101
|
+
mpdAdditions: this.crypto.video.dashSignalling,
|
102
|
+
} : {};
|
103
|
+
this.outputNode = await this.norsk.output.cmafVideo({
|
104
|
+
id: `${this.id}-cmaf`,
|
105
|
+
name: this.cfg.name ? this.cfg.name : this.id,
|
106
|
+
segmentDurationSeconds: this.cfg.segments.targetSegmentDuration,
|
107
|
+
partDurationSeconds: this.cfg.segments.targetPartDuration,
|
108
|
+
destinations: this.destinations,
|
109
|
+
...videoCryptoSettings,
|
110
|
+
});
|
111
|
+
this.outputNode.subscribe([videoSource.select()]);
|
112
|
+
this.setup({ input: this.outputNode, output: [this.outputNode] });
|
113
|
+
this.runtime.report.registerOutput(this.outputNode.id, await this.outputNode.url());
|
114
|
+
}
|
115
|
+
else if (audioSource) {
|
116
|
+
const audioCryptoSettings = this.crypto ? {
|
117
|
+
encryption: this.crypto.audio,
|
118
|
+
m3uAdditions: this.crypto.audio.mediaSignaling,
|
119
|
+
mpdAdditions: this.crypto.audio.dashSignalling,
|
120
|
+
} : {};
|
121
|
+
this.outputNode = await this.norsk.output.cmafAudio({
|
122
|
+
id: `${this.id}-cmaf`,
|
123
|
+
name: this.cfg.name ? this.cfg.name : this.id,
|
124
|
+
segmentDurationSeconds: this.cfg.segments.targetSegmentDuration,
|
125
|
+
partDurationSeconds: this.cfg.segments.targetPartDuration,
|
126
|
+
destinations: this.destinations,
|
127
|
+
...audioCryptoSettings,
|
128
|
+
});
|
129
|
+
this.outputNode.subscribe([audioSource.select()]);
|
130
|
+
this.setup({ input: this.outputNode, output: [this.outputNode] });
|
131
|
+
this.runtime.report.registerOutput(this.outputNode.id, await this.outputNode.url());
|
132
|
+
}
|
133
|
+
else if (subtitleSource) {
|
134
|
+
this.outputNode = await this.norsk.output.cmafWebVtt({
|
135
|
+
name: this.cfg.name ? this.cfg.name : this.id,
|
136
|
+
segmentDurationSeconds: this.cfg.segments.targetSegmentDuration,
|
137
|
+
destinations: this.destinations,
|
138
|
+
id: `${this.id}-webvtt`,
|
139
|
+
});
|
140
|
+
this.outputNode.subscribe([subtitleSource.select()]);
|
141
|
+
this.setup({ input: this.outputNode, output: [this.outputNode] });
|
142
|
+
this.runtime.report.registerOutput(this.outputNode.id, await this.outputNode.url());
|
143
|
+
}
|
144
|
+
if (ancillarySource && !this.ancillary) {
|
145
|
+
this.ancillary = await this.norsk.processor.transform.ancillary({
|
146
|
+
onScte35: (_stream, message) => {
|
147
|
+
const commandType = message.spliceCommand.type;
|
148
|
+
if (commandType != 'insert')
|
149
|
+
return;
|
150
|
+
const command = message.spliceCommand.value;
|
151
|
+
message.spliceCommand.value;
|
152
|
+
const adId = Math.random().toString().slice(-5);
|
153
|
+
const schedule = new Date();
|
154
|
+
schedule.setSeconds(schedule.getSeconds() + 8);
|
155
|
+
const now = new Date();
|
156
|
+
for (const d of this.advertDestinations) {
|
157
|
+
this.outputNode?.scheduleTag({
|
158
|
+
id: adId,
|
159
|
+
scte35: message,
|
160
|
+
startDate: schedule,
|
161
|
+
durationSeconds: Number((command.breakDuration?.duration ?? 0n) / BigInt(90000.0))
|
162
|
+
}, now, d);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
});
|
166
|
+
this.ancillary.subscribe([ancillarySource.select()]);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
class CmafPlaylistDefinition {
|
172
|
+
async create(norsk, cfg, cb, runtime) {
|
173
|
+
const node = await CmafPlaylist.create(norsk, cfg, runtime);
|
174
|
+
cb(node);
|
175
|
+
}
|
176
|
+
async handleCommand(node, command) {
|
177
|
+
switch (command.type) {
|
178
|
+
case 'enable-output':
|
179
|
+
await node.enableOutput();
|
180
|
+
break;
|
181
|
+
case 'disable-output':
|
182
|
+
await node.disableOutput();
|
183
|
+
break;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
async instanceRoutes() {
|
187
|
+
return (0, api_1.defineApi)(path_1.default.join(__dirname, 'types.yaml'), {
|
188
|
+
'/enable': {
|
189
|
+
post: ({ runtime }) => async (_req, res) => {
|
190
|
+
try {
|
191
|
+
const state = runtime.updates.latest();
|
192
|
+
if (state.enabled) {
|
193
|
+
return res.status(400).json({ error: 'Output is already enabled' });
|
194
|
+
}
|
195
|
+
runtime.updates.update({ ...state, enabled: true });
|
196
|
+
runtime.updates.sendCommand({
|
197
|
+
type: 'enable-output'
|
198
|
+
});
|
199
|
+
runtime.updates.raiseEvent({
|
200
|
+
type: 'output-enabled'
|
201
|
+
});
|
202
|
+
res.sendStatus(204);
|
203
|
+
}
|
204
|
+
catch (error) {
|
205
|
+
console.error('Error in enable handler:', error);
|
206
|
+
res.status(500).json({ error: 'Failed to enable output' });
|
207
|
+
}
|
208
|
+
}
|
209
|
+
},
|
210
|
+
'/disable': {
|
211
|
+
post: ({ runtime }) => async (_req, res) => {
|
212
|
+
try {
|
213
|
+
const state = runtime.updates.latest();
|
214
|
+
if (!state.enabled) {
|
215
|
+
return res.status(400).json({ error: 'Output is already disabled' });
|
216
|
+
}
|
217
|
+
runtime.updates.update({ ...state, enabled: false });
|
218
|
+
runtime.updates.sendCommand({
|
219
|
+
type: 'disable-output'
|
220
|
+
});
|
221
|
+
runtime.updates.raiseEvent({
|
222
|
+
type: 'output-disabled'
|
223
|
+
});
|
224
|
+
res.sendStatus(204);
|
225
|
+
}
|
226
|
+
catch (error) {
|
227
|
+
console.error('Error in disable handler:', error);
|
228
|
+
res.status(500).json({ error: 'Failed to disable output' });
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
});
|
233
|
+
}
|
234
|
+
async schemas() {
|
235
|
+
return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), { config: 'CmafConfig', state: 'CmafOutputState' });
|
236
|
+
}
|
237
|
+
}
|
238
|
+
exports.default = CmafPlaylistDefinition;
|
239
|
+
//# sourceMappingURL=runtime.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.cmafPlaylist/runtime.ts"],"names":[],"mappings":";;;;;AAEA,kFAAyF;AACzF,yEAAuE;AAGvE,+CAAgD;AAChD,iDAAkD;AAElD,gDAAwB;AAExB,+CAAoD;AACpD,iEAAoE;AACpE,yCAAmD;AAanD,MAAM,YAAa,SAAQ,iCAAoB;IAC7C,KAAK,CAAQ;IACb,GAAG,CAAuB;IAC1B,UAAU,GAA4E,IAAI,CAAC;IAC3F,SAAS,GAAyB,IAAI,CAAC;IACvC,OAAO,GAAY,IAAI,CAAC;IACxB,WAAW,CAAgB;IAC3B,OAAO,CAA2E;IAClF,cAAc,GAAiC,EAAE,CAAC;IAClD,YAAY,CAA4B;IACxC,kBAAkB,GAAa,EAAE,CAAC;IAClC,SAAS,CAAU;IACnB,MAAM,CAAiB;IAEvB,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAY,E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?: never;
|
10
|
+
put?: never;
|
11
|
+
post: {
|
12
|
+
parameters: {
|
13
|
+
query?: never;
|
14
|
+
header?: never;
|
15
|
+
path?: never;
|
16
|
+
cookie?: never;
|
17
|
+
};
|
18
|
+
requestBody?: never;
|
19
|
+
responses: {
|
20
|
+
204: {
|
21
|
+
headers: {
|
22
|
+
[name: string]: unknown;
|
23
|
+
};
|
24
|
+
content?: never;
|
25
|
+
};
|
26
|
+
400: {
|
27
|
+
headers: {
|
28
|
+
[name: string]: unknown;
|
29
|
+
};
|
30
|
+
content?: never;
|
31
|
+
};
|
32
|
+
500: {
|
33
|
+
headers: {
|
34
|
+
[name: string]: unknown;
|
35
|
+
};
|
36
|
+
content?: never;
|
37
|
+
};
|
38
|
+
};
|
39
|
+
};
|
40
|
+
delete?: never;
|
41
|
+
options?: never;
|
42
|
+
head?: never;
|
43
|
+
patch?: never;
|
44
|
+
trace?: never;
|
45
|
+
};
|
46
|
+
"/disable": {
|
47
|
+
parameters: {
|
48
|
+
query?: never;
|
49
|
+
header?: never;
|
50
|
+
path?: never;
|
51
|
+
cookie?: never;
|
52
|
+
};
|
53
|
+
get?: never;
|
54
|
+
put?: never;
|
55
|
+
post: {
|
56
|
+
parameters: {
|
57
|
+
query?: never;
|
58
|
+
header?: never;
|
59
|
+
path?: never;
|
60
|
+
cookie?: never;
|
61
|
+
};
|
62
|
+
requestBody?: never;
|
63
|
+
responses: {
|
64
|
+
204: {
|
65
|
+
headers: {
|
66
|
+
[name: string]: unknown;
|
67
|
+
};
|
68
|
+
content?: never;
|
69
|
+
};
|
70
|
+
400: {
|
71
|
+
headers: {
|
72
|
+
[name: string]: unknown;
|
73
|
+
};
|
74
|
+
content?: never;
|
75
|
+
};
|
76
|
+
500: {
|
77
|
+
headers: {
|
78
|
+
[name: string]: unknown;
|
79
|
+
};
|
80
|
+
content?: never;
|
81
|
+
};
|
82
|
+
};
|
83
|
+
};
|
84
|
+
delete?: never;
|
85
|
+
options?: never;
|
86
|
+
head?: never;
|
87
|
+
patch?: never;
|
88
|
+
trace?: never;
|
89
|
+
};
|
90
|
+
}
|
91
|
+
export type webhooks = Record<string, never>;
|
92
|
+
export interface components {
|
93
|
+
schemas: {
|
94
|
+
InitialState: "enabled" | "disabled";
|
95
|
+
CmafConfig: {
|
96
|
+
id: string;
|
97
|
+
displayName: string;
|
98
|
+
name: string;
|
99
|
+
sessionId: boolean;
|
100
|
+
publishingGroup?: string;
|
101
|
+
segments: components["schemas"]["AutoCmafSegment"];
|
102
|
+
destinations: components["schemas"]["AutoCmafDestination"][];
|
103
|
+
initialState: components["schemas"]["InitialState"];
|
104
|
+
drmProvider?: "ezdrm" | "axinom";
|
105
|
+
notes?: string;
|
106
|
+
__global: {
|
107
|
+
ezdrmConfig?: components["schemas"]["EzDrmConfig"];
|
108
|
+
axinomConfig?: components["schemas"]["AxinomConfig"];
|
109
|
+
};
|
110
|
+
};
|
111
|
+
CmafOutputState: {
|
112
|
+
url?: string;
|
113
|
+
drmToken?: string;
|
114
|
+
enabled: boolean;
|
115
|
+
};
|
116
|
+
AutoCmafSegment: {
|
117
|
+
retentionPeriod: number;
|
118
|
+
defaultSegmentCount?: number;
|
119
|
+
targetSegmentDuration: number;
|
120
|
+
targetPartDuration: number;
|
121
|
+
holdBackSegments?: number;
|
122
|
+
holdBackParts?: number;
|
123
|
+
};
|
124
|
+
AutoCmafAkamaiDestination: {
|
125
|
+
type: "akamai";
|
126
|
+
ingest: string;
|
127
|
+
playback: string;
|
128
|
+
includeAdInsertions: boolean;
|
129
|
+
};
|
130
|
+
AutoCmafS3Destination: {
|
131
|
+
type: "s3";
|
132
|
+
host: string;
|
133
|
+
prefix: string;
|
134
|
+
includeAdInsertions: boolean;
|
135
|
+
};
|
136
|
+
AutoCmafDestination: components["schemas"]["AutoCmafAkamaiDestination"] | components["schemas"]["AutoCmafS3Destination"];
|
137
|
+
EzDrmConfig: {
|
138
|
+
token?: string;
|
139
|
+
pX?: string;
|
140
|
+
};
|
141
|
+
AxinomConfig: {
|
142
|
+
tenantId?: string;
|
143
|
+
managementKey?: string;
|
144
|
+
comKeyId?: string;
|
145
|
+
comKey?: string;
|
146
|
+
};
|
147
|
+
};
|
148
|
+
responses: never;
|
149
|
+
parameters: never;
|
150
|
+
requestBodies: never;
|
151
|
+
headers: never;
|
152
|
+
pathItems: never;
|
153
|
+
}
|
154
|
+
export type $defs = Record<string, never>;
|
155
|
+
export type operations = Record<string, never>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/output.cmafPlaylist/types.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
title: Cmaf Media Playlist Component
|
4
|
+
version: 1.0.0
|
5
|
+
|
6
|
+
paths:
|
7
|
+
/enable:
|
8
|
+
post:
|
9
|
+
summary: Enable CMAF output
|
10
|
+
description: Enables output of CMAF streams if currently disabled
|
11
|
+
responses:
|
12
|
+
204:
|
13
|
+
description: Output successfully enabled
|
14
|
+
400:
|
15
|
+
description: Output is already enabled
|
16
|
+
500:
|
17
|
+
description: Server error while enabling output
|
18
|
+
/disable:
|
19
|
+
post:
|
20
|
+
summary: Disable CMAF output
|
21
|
+
description: Disables output of CMAF streams if currently enabled
|
22
|
+
responses:
|
23
|
+
204:
|
24
|
+
description: Output successfully disabled
|
25
|
+
400:
|
26
|
+
description: Output is already disabled
|
27
|
+
500:
|
28
|
+
description: Server error while disabling output
|
29
|
+
|
30
|
+
components:
|
31
|
+
schemas:
|
32
|
+
InitialState:
|
33
|
+
type: string
|
34
|
+
enum: [enabled, disabled]
|
35
|
+
|
36
|
+
CmafConfig:
|
37
|
+
type: object
|
38
|
+
required:
|
39
|
+
- id
|
40
|
+
- displayName
|
41
|
+
- name
|
42
|
+
- sessionId
|
43
|
+
- segments
|
44
|
+
- destinations
|
45
|
+
- initialState
|
46
|
+
- __global
|
47
|
+
properties:
|
48
|
+
id:
|
49
|
+
type: string
|
50
|
+
displayName:
|
51
|
+
type: string
|
52
|
+
name:
|
53
|
+
type: string
|
54
|
+
sessionId:
|
55
|
+
type: boolean
|
56
|
+
publishingGroup:
|
57
|
+
type: string
|
58
|
+
segments:
|
59
|
+
$ref: '../shared/types.yaml#/components/schemas/AutoCmafSegment'
|
60
|
+
destinations:
|
61
|
+
type: array
|
62
|
+
items:
|
63
|
+
$ref: '../shared/types.yaml#/components/schemas/AutoCmafDestination'
|
64
|
+
initialState:
|
65
|
+
$ref: '#/components/schemas/InitialState'
|
66
|
+
drmProvider:
|
67
|
+
type: string
|
68
|
+
enum: [ezdrm, axinom]
|
69
|
+
notes:
|
70
|
+
type: string
|
71
|
+
__global:
|
72
|
+
type: object
|
73
|
+
properties:
|
74
|
+
ezdrmConfig:
|
75
|
+
$ref: '../shared/types.yaml#/components/schemas/EzDrmConfig'
|
76
|
+
axinomConfig:
|
77
|
+
$ref: '../shared/types.yaml#/components/schemas/AxinomConfig'
|
78
|
+
additionalProperties: false
|
79
|
+
|
80
|
+
CmafOutputState:
|
81
|
+
type: object
|
82
|
+
required:
|
83
|
+
- enabled
|
84
|
+
properties:
|
85
|
+
url:
|
86
|
+
type: string
|
87
|
+
drmToken:
|
88
|
+
type: string
|
89
|
+
enabled:
|
90
|
+
type: boolean
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { HlsTsPlaylistCommand, HlsTsPlaylistEvent } from "./runtime";
|
2
|
+
import type Registration from "@norskvideo/norsk-studio/lib/extension/registration";
|
3
|
+
export default function (registration: Registration): import("@norskvideo/norsk-studio/lib/extension/client-types").NodeInfo<{
|
4
|
+
id: string;
|
5
|
+
displayName: string;
|
6
|
+
name: string;
|
7
|
+
sessionId: boolean;
|
8
|
+
publishingGroup?: string;
|
9
|
+
segments: import("./types").components["schemas"]["AutoCmafSegment"];
|
10
|
+
destinations: import("./types").components["schemas"]["AutoCmafDestination"][];
|
11
|
+
initialState: import("./types").components["schemas"]["InitialState"];
|
12
|
+
drmProvider?: "ezdrm" | "axinom";
|
13
|
+
notes?: string;
|
14
|
+
__global: {
|
15
|
+
ezdrmConfig?: import("./types").components["schemas"]["EzDrmConfig"];
|
16
|
+
axinomConfig?: import("./types").components["schemas"]["AxinomConfig"];
|
17
|
+
};
|
18
|
+
}, {
|
19
|
+
url?: string;
|
20
|
+
drmToken?: string;
|
21
|
+
enabled: boolean;
|
22
|
+
}, HlsTsPlaylistCommand, HlsTsPlaylistEvent>;
|