@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.
Files changed (82) hide show
  1. package/client/info.js +6824 -1190
  2. package/lib/info.js +29 -21
  3. package/lib/info.js.map +1 -1
  4. package/lib/output.autoCmaf/info.js +4 -132
  5. package/lib/output.autoCmaf/info.js.map +1 -1
  6. package/lib/output.autoCmaf/runtime.js +4 -54
  7. package/lib/output.autoCmaf/runtime.js.map +1 -1
  8. package/lib/output.autoCmaf/types.d.ts +31 -31
  9. package/lib/output.autoCmaf/types.yaml +4 -85
  10. package/lib/output.cmafMultiVariant/info.d.ts +15 -0
  11. package/lib/output.cmafMultiVariant/info.js +91 -0
  12. package/lib/output.cmafMultiVariant/info.js.map +1 -0
  13. package/lib/output.cmafMultiVariant/runtime.d.ts +37 -0
  14. package/lib/output.cmafMultiVariant/runtime.js +158 -0
  15. package/lib/output.cmafMultiVariant/runtime.js.map +1 -0
  16. package/lib/output.cmafMultiVariant/types.d.ts +130 -0
  17. package/lib/output.cmafMultiVariant/types.js +3 -0
  18. package/lib/output.cmafMultiVariant/types.js.map +1 -0
  19. package/lib/output.cmafMultiVariant/types.yaml +74 -0
  20. package/lib/output.cmafPlaylist/info.d.ts +22 -0
  21. package/lib/output.cmafPlaylist/info.js +114 -0
  22. package/lib/output.cmafPlaylist/info.js.map +1 -0
  23. package/lib/output.cmafPlaylist/runtime.d.ts +41 -0
  24. package/lib/output.cmafPlaylist/runtime.js +239 -0
  25. package/lib/output.cmafPlaylist/runtime.js.map +1 -0
  26. package/lib/output.cmafPlaylist/types.d.ts +155 -0
  27. package/lib/output.cmafPlaylist/types.js +3 -0
  28. package/lib/output.cmafPlaylist/types.js.map +1 -0
  29. package/lib/output.cmafPlaylist/types.yaml +90 -0
  30. package/lib/output.tsMediaPlaylist/info.d.ts +22 -0
  31. package/lib/output.tsMediaPlaylist/info.js +113 -0
  32. package/lib/output.tsMediaPlaylist/info.js.map +1 -0
  33. package/lib/output.tsMediaPlaylist/runtime.d.ts +41 -0
  34. package/lib/output.tsMediaPlaylist/runtime.js +225 -0
  35. package/lib/output.tsMediaPlaylist/runtime.js.map +1 -0
  36. package/lib/output.tsMediaPlaylist/types.d.ts +155 -0
  37. package/lib/output.tsMediaPlaylist/types.js +3 -0
  38. package/lib/output.tsMediaPlaylist/types.js.map +1 -0
  39. package/lib/output.tsMediaPlaylist/types.yaml +90 -0
  40. package/lib/output.tsMultiVariant/info.d.ts +15 -0
  41. package/lib/output.tsMultiVariant/info.js +91 -0
  42. package/lib/output.tsMultiVariant/info.js.map +1 -0
  43. package/lib/output.tsMultiVariant/runtime.d.ts +37 -0
  44. package/lib/output.tsMultiVariant/runtime.js +157 -0
  45. package/lib/output.tsMultiVariant/runtime.js.map +1 -0
  46. package/lib/output.tsMultiVariant/types.d.ts +130 -0
  47. package/lib/output.tsMultiVariant/types.js +3 -0
  48. package/lib/output.tsMultiVariant/types.js.map +1 -0
  49. package/lib/output.tsMultiVariant/types.yaml +74 -0
  50. package/lib/processor.fixedLadder/info.d.ts +3 -3
  51. package/lib/processor.fixedLadder/info.js +1159 -73
  52. package/lib/processor.fixedLadder/info.js.map +1 -1
  53. package/lib/processor.fixedLadder/nvidia-rate-control-view.d.ts +4 -0
  54. package/lib/processor.fixedLadder/nvidia-rate-control-view.js +20 -0
  55. package/lib/processor.fixedLadder/nvidia-rate-control-view.js.map +1 -0
  56. package/lib/processor.fixedLadder/nvidia-view.d.ts +5 -0
  57. package/lib/processor.fixedLadder/nvidia-view.js +20 -0
  58. package/lib/processor.fixedLadder/nvidia-view.js.map +1 -0
  59. package/lib/processor.fixedLadder/quadra-view.d.ts +6 -0
  60. package/lib/processor.fixedLadder/quadra-view.js +22 -0
  61. package/lib/processor.fixedLadder/quadra-view.js.map +1 -0
  62. package/lib/processor.fixedLadder/runtime.js.map +1 -1
  63. package/lib/processor.fixedLadder/software-view.d.ts +5 -0
  64. package/lib/processor.fixedLadder/software-view.js +20 -0
  65. package/lib/processor.fixedLadder/software-view.js.map +1 -0
  66. package/lib/processor.fixedLadder/types.d.ts +108 -20
  67. package/lib/processor.fixedLadder/types.yaml +241 -34
  68. package/lib/processor.fixedLadder/x26x-bitrate-view.d.ts +4 -0
  69. package/lib/processor.fixedLadder/x26x-bitrate-view.js +20 -0
  70. package/lib/processor.fixedLadder/x26x-bitrate-view.js.map +1 -0
  71. package/lib/shared/cmaf.d.ts +17 -0
  72. package/lib/shared/cmaf.js +198 -0
  73. package/lib/shared/cmaf.js.map +1 -0
  74. package/lib/{output.autoCmaf/form-views.d.ts → shared/playlist-form-views.d.ts} +1 -1
  75. package/lib/{output.autoCmaf/form-views.js → shared/playlist-form-views.js} +1 -1
  76. package/lib/shared/playlist-form-views.js.map +1 -0
  77. package/lib/shared/types.d.ts +158 -0
  78. package/lib/shared/types.js +3 -0
  79. package/lib/shared/types.js.map +1 -0
  80. package/lib/shared/types.yaml +182 -0
  81. package/package.json +3 -3
  82. package/lib/output.autoCmaf/form-views.js.map +0 -1
@@ -0,0 +1,15 @@
1
+ import type { CmafPlaylistCommand, CmafPlaylistEvent } 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
+ publishingGroup?: string;
8
+ destinations: import("./types").components["schemas"]["AutoCmafDestination"][];
9
+ initialState: import("./types").components["schemas"]["InitialState"];
10
+ notes?: string;
11
+ __global: Record<string, never>;
12
+ }, {
13
+ url?: string;
14
+ enabled: boolean;
15
+ }, CmafPlaylistCommand, CmafPlaylistEvent>;
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
5
+ const FaHeadphones_1 = require("@react-icons/all-files/fa/FaHeadphones");
6
+ const cmaf_1 = require("../shared/cmaf");
7
+ function default_1(registration) {
8
+ const { defineComponent, validation, } = registration;
9
+ const { Z } = validation;
10
+ return defineComponent({
11
+ identifier: 'output.cmafMultiVariant',
12
+ category: 'output',
13
+ name: "CMAF Multivariant",
14
+ description: "This component creates, and optionally publishes, a multivariant playlist for a collection of CMAF playlists",
15
+ icon: FaHeadphones_1.FaHeadphones,
16
+ subscription: {
17
+ accepts: {
18
+ type: "dynamic-streams",
19
+ mode: 'any',
20
+ makeProgram: false,
21
+ streams: () => [{ media: 'playlist' }]
22
+ }
23
+ },
24
+ display: (desc) => {
25
+ return {
26
+ name: desc.config.name
27
+ };
28
+ },
29
+ runtime: {
30
+ initialState: () => ({
31
+ enabled: true
32
+ }),
33
+ handleEvent(ev, state) {
34
+ const evType = ev.type;
35
+ switch (evType) {
36
+ case 'output-enabled':
37
+ state.enabled = true;
38
+ break;
39
+ case 'output-disabled':
40
+ state.enabled = false;
41
+ break;
42
+ default:
43
+ (0, util_1.assertUnreachable)(evType);
44
+ }
45
+ return { ...state };
46
+ },
47
+ },
48
+ configForm: {
49
+ form: {
50
+ name: {
51
+ help: "The name of the playlist",
52
+ hint: {
53
+ type: 'text', optional: true, validation: Z.string().min(1).max(15).optional()
54
+ }
55
+ },
56
+ destinations: cmaf_1.DestinationsFormEntry,
57
+ publishingGroup: {
58
+ help: "This *must* match the publishing group of any playlists that are being given to this component",
59
+ advanced: true,
60
+ hint: {
61
+ type: 'text',
62
+ optional: true
63
+ }
64
+ },
65
+ initialState: {
66
+ help: "The publishing state of this endpoint by default on start-up",
67
+ hint: {
68
+ type: 'select',
69
+ defaultValue: 'enabled',
70
+ envOverride: true,
71
+ options: [
72
+ {
73
+ display: "Enabled",
74
+ value: 'enabled',
75
+ },
76
+ {
77
+ display: "Disabled",
78
+ value: 'disabled',
79
+ },
80
+ ],
81
+ },
82
+ },
83
+ notes: {
84
+ help: "Additional notes about this component",
85
+ hint: { type: 'text', optional: true }
86
+ },
87
+ }
88
+ }
89
+ });
90
+ }
91
+ //# sourceMappingURL=info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"info.js","sourceRoot":"","sources":["../../src/output.cmafMultiVariant/info.ts"],"names":[],"mappings":";;AAMA,4BAuFC;AA3FD,mEAA6E;AAC7E,yEAAsE;AACtE,yCAAuD;AAEvD,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,yBAAyB;QACrC,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,8GAA8G;QAC3H,IAAI,EAAE,2BAAY;QAClB,YAAY,EAAE;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,KAAK;gBACX,WAAW,EAAE,KAAK;gBAClB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;aACvC;SACF;QACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;aACvB,CAAA;QACH,CAAC;QACD,OAAO,EAAE;YACP,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC;gBACnB,OAAO,EAAE,IAAI;aACd,CAAC;YACF,WAAW,CAAC,EAAE,EAAE,KAAK;gBACnB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC;gBACvB,QAAQ,MAAM,EAAE,CAAC;oBACf,KAAK,gBAAgB;wBACnB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;wBACrB,MAAM;oBACR,KAAK,iBAAiB;wBACpB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;wBACtB,MAAM;oBACR;wBACE,IAAA,wBAAiB,EAAC,MAAM,CAAC,CAAA;gBAC7B,CAAC;gBACD,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;YACtB,CAAC;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ,IAAI,EAAE,0BAA0B;oBAChC,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;qBAC/E;iBACF;gBACD,YAAY,EAAE,4BAAqB;gBACnC,eAAe,EAAE;oBACf,IAAI,EAAE,gGAAgG;oBACtG,QAAQ,EAAE,IAAI;oBACd,IAAI,EAAE;wBACJ,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,IAAI;qBACf;iBACF;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,8DAA8D;oBACpE,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,37 @@
1
+ import { AncillaryNode, CmafDestinationSettings, CmafMultiVariantOutputNode, Norsk } from '@norskvideo/norsk-sdk';
2
+ import { InstanceRouteInfo, OnCreated, ServerComponentDefinition, StudioRuntime, StudioComponentInputStream, ServerComponentSchemas } from '@norskvideo/norsk-studio/lib/extension/runtime-types';
3
+ import { CustomSinkNode } from '@norskvideo/norsk-studio/lib/extension/base-nodes';
4
+ import { components } from './types';
5
+ export type CmafPlaylistSettings = components['schemas']['CmafConfig'];
6
+ export type CmafPlaylistState = components['schemas']['CmafOutputState'];
7
+ export type CmafPlaylistCommand = {
8
+ type: 'enable-output' | 'disable-output';
9
+ };
10
+ export type CmafPlaylistEvent = {
11
+ type: 'output-enabled' | 'output-disabled';
12
+ };
13
+ declare class CmafPlaylist extends CustomSinkNode {
14
+ norsk: Norsk;
15
+ cfg: CmafPlaylistSettings;
16
+ outputNode: CmafMultiVariantOutputNode | null;
17
+ ancillary: AncillaryNode | null;
18
+ enabled: boolean;
19
+ initialised: Promise<void>;
20
+ runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>;
21
+ currentSources: StudioComponentInputStream[];
22
+ destinations: CmafDestinationSettings[];
23
+ static create(norsk: Norsk, cfg: CmafPlaylistSettings, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>): Promise<CmafPlaylist>;
24
+ constructor(cfg: CmafPlaylistSettings, norsk: Norsk, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>);
25
+ initialise(): Promise<void>;
26
+ enableOutput(): Promise<void>;
27
+ disableOutput(): Promise<void>;
28
+ subscribe(sources: StudioComponentInputStream[]): Promise<void>;
29
+ subscribeImpl(sources: StudioComponentInputStream[]): Promise<void>;
30
+ }
31
+ export default class CmafPlaylistDefinition implements ServerComponentDefinition<CmafPlaylistSettings, CmafPlaylist, CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent> {
32
+ create(norsk: Norsk, cfg: CmafPlaylistSettings, cb: OnCreated<CmafPlaylist>, runtime: StudioRuntime<CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>): Promise<void>;
33
+ handleCommand(node: CmafPlaylist, command: CmafPlaylistCommand): Promise<void>;
34
+ instanceRoutes(): Promise<InstanceRouteInfo<CmafPlaylistSettings, CmafPlaylist, CmafPlaylistState, CmafPlaylistCommand, CmafPlaylistEvent>[]>;
35
+ schemas(): Promise<ServerComponentSchemas>;
36
+ }
37
+ export {};
@@ -0,0 +1,158 @@
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 path_1 = __importDefault(require("path"));
9
+ const schemas_1 = require("../shared/schemas");
10
+ const api_1 = require("@norskvideo/norsk-studio/lib/server/api");
11
+ const cmaf_1 = require("../shared/cmaf");
12
+ class CmafPlaylist extends base_nodes_1.CustomSinkNode {
13
+ norsk;
14
+ cfg;
15
+ outputNode = null;
16
+ ancillary = null;
17
+ enabled = true;
18
+ initialised;
19
+ runtime;
20
+ currentSources = [];
21
+ destinations;
22
+ static async create(norsk, cfg, runtime) {
23
+ const node = new CmafPlaylist(cfg, norsk, runtime);
24
+ await node.initialised;
25
+ return node;
26
+ }
27
+ constructor(cfg, norsk, runtime) {
28
+ super(cfg.id);
29
+ this.cfg = cfg;
30
+ this.id = cfg.id;
31
+ this.norsk = norsk;
32
+ this.runtime = runtime;
33
+ this.enabled = cfg.initialState == 'enabled';
34
+ if (!this.enabled) {
35
+ runtime.updates.raiseEvent({ type: 'output-disabled' });
36
+ }
37
+ const r = (0, cmaf_1.reifyDestinations)({
38
+ publishingGroup: cfg.publishingGroup ?? "cmaf", destinations: cfg.destinations, segments: { retentionPeriod: 360, targetSegmentDuration: 0, targetPartDuration: 0 }
39
+ });
40
+ this.destinations = r.destinations;
41
+ this.initialised = this.initialise();
42
+ }
43
+ async initialise() {
44
+ }
45
+ async enableOutput() {
46
+ if (!this.enabled) {
47
+ this.enabled = true;
48
+ this.runtime.updates.raiseEvent({ type: 'output-enabled' });
49
+ await this.subscribeImpl(this.currentSources);
50
+ (0, logging_1.debuglog)("Output enabled", { id: this.id });
51
+ }
52
+ }
53
+ async disableOutput() {
54
+ if (this.enabled) {
55
+ this.enabled = false;
56
+ if (this.outputNode) {
57
+ await this.outputNode.close();
58
+ this.outputNode = null;
59
+ }
60
+ this.runtime.updates.raiseEvent({
61
+ type: 'output-disabled'
62
+ });
63
+ (0, logging_1.debuglog)("Output disabled", { id: this.id });
64
+ }
65
+ }
66
+ async subscribe(sources) {
67
+ this.currentSources = sources;
68
+ await this.subscribeImpl(this.currentSources);
69
+ }
70
+ async subscribeImpl(sources) {
71
+ if (!this.enabled || sources.filter((s) => s.metadata).length == 0) {
72
+ (0, logging_1.debuglog)("Skipping context handling - output disabled", { id: this.id });
73
+ await this.outputNode?.close();
74
+ this.outputNode = null;
75
+ return;
76
+ }
77
+ if (!this.outputNode) {
78
+ this.outputNode = await this.norsk.output.cmafMultiVariant({
79
+ id: `${this.id}-mv`,
80
+ destinations: this.destinations,
81
+ playlistName: this.cfg.name,
82
+ });
83
+ this.setup({ sink: this.outputNode });
84
+ this.runtime.report.registerOutput(this.id, this.outputNode.url);
85
+ this.runtime.report.registerOutput(this.id, this.outputNode.dashUrl);
86
+ }
87
+ this.outputNode.subscribe(sources.filter((s) => s.isMedia('playlist')).map((s) => s.select()));
88
+ }
89
+ }
90
+ class CmafPlaylistDefinition {
91
+ async create(norsk, cfg, cb, runtime) {
92
+ const node = await CmafPlaylist.create(norsk, cfg, runtime);
93
+ cb(node);
94
+ }
95
+ async handleCommand(node, command) {
96
+ switch (command.type) {
97
+ case 'enable-output':
98
+ await node.enableOutput();
99
+ break;
100
+ case 'disable-output':
101
+ await node.disableOutput();
102
+ break;
103
+ }
104
+ }
105
+ async instanceRoutes() {
106
+ return (0, api_1.defineApi)(path_1.default.join(__dirname, 'types.yaml'), {
107
+ '/enable': {
108
+ post: ({ runtime }) => async (_req, res) => {
109
+ try {
110
+ const state = runtime.updates.latest();
111
+ if (state.enabled) {
112
+ return res.status(400).json({ error: 'Output is already enabled' });
113
+ }
114
+ runtime.updates.update({ ...state, enabled: true });
115
+ runtime.updates.sendCommand({
116
+ type: 'enable-output'
117
+ });
118
+ runtime.updates.raiseEvent({
119
+ type: 'output-enabled'
120
+ });
121
+ res.sendStatus(204);
122
+ }
123
+ catch (error) {
124
+ console.error('Error in enable handler:', error);
125
+ res.status(500).json({ error: 'Failed to enable output' });
126
+ }
127
+ }
128
+ },
129
+ '/disable': {
130
+ post: ({ runtime }) => async (_req, res) => {
131
+ try {
132
+ const state = runtime.updates.latest();
133
+ if (!state.enabled) {
134
+ return res.status(400).json({ error: 'Output is already disabled' });
135
+ }
136
+ runtime.updates.update({ ...state, enabled: false });
137
+ runtime.updates.sendCommand({
138
+ type: 'disable-output'
139
+ });
140
+ runtime.updates.raiseEvent({
141
+ type: 'output-disabled'
142
+ });
143
+ res.sendStatus(204);
144
+ }
145
+ catch (error) {
146
+ console.error('Error in disable handler:', error);
147
+ res.status(500).json({ error: 'Failed to disable output' });
148
+ }
149
+ }
150
+ }
151
+ });
152
+ }
153
+ async schemas() {
154
+ return (0, schemas_1.schemaFromTypes)(path_1.default.join(__dirname, 'types.yaml'), { config: 'CmafConfig', state: 'CmafOutputState' });
155
+ }
156
+ }
157
+ exports.default = CmafPlaylistDefinition;
158
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/output.cmafMultiVariant/runtime.ts"],"names":[],"mappings":";;;;;AAEA,kFAAmF;AACnF,yEAAuE;AAEvE,gDAAwB;AAExB,+CAAoD;AACpD,iEAAoE;AACpE,yCAAmD;AAanD,MAAM,YAAa,SAAQ,2BAAc;IACvC,KAAK,CAAQ;IACb,GAAG,CAAuB;IAC1B,UAAU,GAAsC,IAAI,CAAC;IACrD,SAAS,GAAyB,IAAI,CAAC;IACvC,OAAO,GAAY,IAAI,CAAC;IACxB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,YAAY,CAAC,EACvD,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB,EAAE,CACnD,CAAA;IACH,CAAC;CACF;AA/ED,yCA+EC"}
@@ -0,0 +1,130 @@
1
+ export interface paths {
2
+ "/enable": {
3
+ parameters: {
4
+ query?: never;
5
+ header?: never;
6
+ path?: never;
7
+ cookie?: never;
8
+ };
9
+ get?: never;
10
+ put?: never;
11
+ post: {
12
+ parameters: {
13
+ query?: never;
14
+ header?: never;
15
+ path?: never;
16
+ cookie?: never;
17
+ };
18
+ requestBody?: never;
19
+ responses: {
20
+ 204: {
21
+ headers: {
22
+ [name: string]: unknown;
23
+ };
24
+ content?: never;
25
+ };
26
+ 400: {
27
+ headers: {
28
+ [name: string]: unknown;
29
+ };
30
+ content?: never;
31
+ };
32
+ 500: {
33
+ headers: {
34
+ [name: string]: unknown;
35
+ };
36
+ content?: never;
37
+ };
38
+ };
39
+ };
40
+ delete?: never;
41
+ options?: never;
42
+ head?: never;
43
+ patch?: never;
44
+ trace?: never;
45
+ };
46
+ "/disable": {
47
+ parameters: {
48
+ query?: never;
49
+ header?: never;
50
+ path?: never;
51
+ cookie?: never;
52
+ };
53
+ get?: never;
54
+ put?: never;
55
+ post: {
56
+ parameters: {
57
+ query?: never;
58
+ header?: never;
59
+ path?: never;
60
+ cookie?: never;
61
+ };
62
+ requestBody?: never;
63
+ responses: {
64
+ 204: {
65
+ headers: {
66
+ [name: string]: unknown;
67
+ };
68
+ content?: never;
69
+ };
70
+ 400: {
71
+ headers: {
72
+ [name: string]: unknown;
73
+ };
74
+ content?: never;
75
+ };
76
+ 500: {
77
+ headers: {
78
+ [name: string]: unknown;
79
+ };
80
+ content?: never;
81
+ };
82
+ };
83
+ };
84
+ delete?: never;
85
+ options?: never;
86
+ head?: never;
87
+ patch?: never;
88
+ trace?: never;
89
+ };
90
+ }
91
+ export type webhooks = Record<string, never>;
92
+ export interface components {
93
+ schemas: {
94
+ InitialState: "enabled" | "disabled";
95
+ CmafConfig: {
96
+ id: string;
97
+ displayName: string;
98
+ name: string;
99
+ publishingGroup?: string;
100
+ destinations: components["schemas"]["AutoCmafDestination"][];
101
+ initialState: components["schemas"]["InitialState"];
102
+ notes?: string;
103
+ __global: Record<string, never>;
104
+ };
105
+ CmafOutputState: {
106
+ url?: string;
107
+ enabled: boolean;
108
+ };
109
+ AutoCmafAkamaiDestination: {
110
+ type: "akamai";
111
+ ingest: string;
112
+ playback: string;
113
+ includeAdInsertions: boolean;
114
+ };
115
+ AutoCmafS3Destination: {
116
+ type: "s3";
117
+ host: string;
118
+ prefix: string;
119
+ includeAdInsertions: boolean;
120
+ };
121
+ AutoCmafDestination: components["schemas"]["AutoCmafAkamaiDestination"] | components["schemas"]["AutoCmafS3Destination"];
122
+ };
123
+ responses: never;
124
+ parameters: never;
125
+ requestBodies: never;
126
+ headers: never;
127
+ pathItems: never;
128
+ }
129
+ export type $defs = Record<string, never>;
130
+ export type operations = Record<string, never>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/output.cmafMultiVariant/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,74 @@
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
+ - destinations
43
+ - initialState
44
+ - __global
45
+ properties:
46
+ id:
47
+ type: string
48
+ displayName:
49
+ type: string
50
+ name:
51
+ type: string
52
+ publishingGroup:
53
+ type: string
54
+ destinations:
55
+ type: array
56
+ items:
57
+ $ref: '../shared/types.yaml#/components/schemas/AutoCmafDestination'
58
+ initialState:
59
+ $ref: '#/components/schemas/InitialState'
60
+ notes:
61
+ type: string
62
+ __global:
63
+ type: object
64
+ additionalProperties: false
65
+
66
+ CmafOutputState:
67
+ type: object
68
+ required:
69
+ - enabled
70
+ properties:
71
+ url:
72
+ type: string
73
+ enabled:
74
+ type: boolean
@@ -0,0 +1,22 @@
1
+ import type { CmafPlaylistCommand, CmafPlaylistEvent } 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
+ }, CmafPlaylistCommand, CmafPlaylistEvent>;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const util_1 = require("@norskvideo/norsk-studio/lib/shared/util");
5
+ const FaHeadphones_1 = require("@react-icons/all-files/fa/FaHeadphones");
6
+ const cmaf_1 = require("../shared/cmaf");
7
+ function default_1(registration) {
8
+ const { defineComponent, validation, } = registration;
9
+ const { Z } = validation;
10
+ return defineComponent({
11
+ identifier: 'output.cmafPlaylist',
12
+ category: 'output',
13
+ name: "CMAF Media Playlist",
14
+ description: "This component creates, and optionally publishes, a cmaf media playlist for a single stream",
15
+ icon: FaHeadphones_1.FaHeadphones,
16
+ subscription: {
17
+ accepts: {
18
+ type: "simple-stream",
19
+ audio: true,
20
+ video: true,
21
+ ancillary: true,
22
+ subtitle: true,
23
+ makeProgram: false
24
+ },
25
+ produces: {
26
+ type: 'simple-stream',
27
+ playlist: true
28
+ }
29
+ },
30
+ extraValidation: (ctx) => {
31
+ const allStreams = ctx.subscriptions.flatMap((s) => s.expectedStreams);
32
+ const mediaStreams = allStreams.filter((a) => a.media == 'audio' || a.media == 'video');
33
+ if (mediaStreams.length > 1) {
34
+ ctx.addError("Cmaf playlist cannot accept more than one media stream");
35
+ }
36
+ },
37
+ display: (desc) => {
38
+ return {
39
+ name: desc.config.name
40
+ };
41
+ },
42
+ runtime: {
43
+ initialState: () => ({
44
+ enabled: true
45
+ }),
46
+ handleEvent(ev, state) {
47
+ const evType = ev.type;
48
+ switch (evType) {
49
+ case 'output-enabled':
50
+ state.enabled = true;
51
+ break;
52
+ case 'output-disabled':
53
+ state.enabled = false;
54
+ break;
55
+ default:
56
+ (0, util_1.assertUnreachable)(evType);
57
+ }
58
+ return { ...state };
59
+ },
60
+ },
61
+ configForm: {
62
+ form: {
63
+ name: {
64
+ help: "The name of the playlist",
65
+ advanced: true,
66
+ hint: {
67
+ type: 'text', optional: true, validation: Z.string().min(1).max(15).optional()
68
+ }
69
+ },
70
+ sessionId: {
71
+ help: "Generate a unique session id per run to avoid cache collisions",
72
+ hint: {
73
+ type: 'boolean',
74
+ defaultValue: false
75
+ }
76
+ },
77
+ publishingGroup: {
78
+ help: "Each playlist will be published within a 'group', change this if you need multiple playlists for the same stream",
79
+ advanced: true,
80
+ hint: {
81
+ type: 'text',
82
+ optional: true
83
+ }
84
+ },
85
+ segments: cmaf_1.SegmentFormEntry,
86
+ destinations: cmaf_1.DestinationsFormEntry,
87
+ initialState: {
88
+ help: "The publishing state of this endpoint by default on start-up",
89
+ advanced: true,
90
+ hint: {
91
+ type: 'select',
92
+ defaultValue: 'enabled',
93
+ envOverride: true,
94
+ options: [
95
+ {
96
+ display: "Enabled",
97
+ value: 'enabled',
98
+ },
99
+ {
100
+ display: "Disabled",
101
+ value: 'disabled',
102
+ },
103
+ ],
104
+ },
105
+ },
106
+ notes: {
107
+ help: "Additional notes about this component",
108
+ hint: { type: 'text', optional: true }
109
+ },
110
+ }
111
+ }
112
+ });
113
+ }
114
+ //# sourceMappingURL=info.js.map