@stinkycomputing/sesame-api-client 1.4.1-alpha.2 → 1.4.1-alpha.3
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/dist/browser.cjs +7 -146
- package/dist/browser.cjs.map +2 -2
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.mjs +7 -146
- package/dist/browser.mjs.map +2 -2
- package/dist/command-list.d.ts +18 -140
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.cjs +7 -146
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +7 -146
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/browser.cjs
CHANGED
|
@@ -21244,145 +21244,6 @@ var CommandList = class {
|
|
|
21244
21244
|
get_command_list_msg() {
|
|
21245
21245
|
return this.cl;
|
|
21246
21246
|
}
|
|
21247
|
-
buildSourceConfig(cfg) {
|
|
21248
|
-
var _a;
|
|
21249
|
-
const config = {
|
|
21250
|
-
common: {
|
|
21251
|
-
userId: cfg.userId,
|
|
21252
|
-
useAsClock: cfg.useAsClock,
|
|
21253
|
-
audioOnly: cfg.audioOnly,
|
|
21254
|
-
audioChannels: cfg.audioChannels,
|
|
21255
|
-
loop: cfg.loop,
|
|
21256
|
-
playState: cfg.playState,
|
|
21257
|
-
mipMap: cfg.mipMap,
|
|
21258
|
-
textureSize: cfg.textureSize,
|
|
21259
|
-
decoderType: cfg.decoderType,
|
|
21260
|
-
deinterlace: cfg.deinterlace,
|
|
21261
|
-
videoProcessors: cfg.videoProcessors || []
|
|
21262
|
-
}
|
|
21263
|
-
};
|
|
21264
|
-
switch (cfg.sourceType) {
|
|
21265
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_FILE:
|
|
21266
|
-
config.file = { url: ((_a = cfg.fileConfig) == null ? void 0 : _a.filename) || cfg.url || "" };
|
|
21267
|
-
break;
|
|
21268
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_RECORDER:
|
|
21269
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder source config found");
|
|
21270
|
-
config.recorder = cfg.recorderConfig;
|
|
21271
|
-
break;
|
|
21272
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_BROWSER:
|
|
21273
|
-
if (!cfg.url) throw new Error("No browser URL found");
|
|
21274
|
-
config.browser = { url: cfg.url };
|
|
21275
|
-
break;
|
|
21276
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_RTT:
|
|
21277
|
-
if (cfg.rttConfig == null) throw new Error("No RTT config found");
|
|
21278
|
-
config.rtt = cfg.rttConfig;
|
|
21279
|
-
break;
|
|
21280
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_DECKLINK:
|
|
21281
|
-
if (cfg.decklinkConfig == null) throw new Error("No decklink source config found");
|
|
21282
|
-
config.decklink = cfg.decklinkConfig;
|
|
21283
|
-
break;
|
|
21284
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SIGNAL_GENERATOR:
|
|
21285
|
-
config.signalGenerator = {};
|
|
21286
|
-
break;
|
|
21287
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SYSTEM_AUDIO:
|
|
21288
|
-
config.systemAudio = { deviceName: cfg.url || "" };
|
|
21289
|
-
break;
|
|
21290
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SRT_STREAM:
|
|
21291
|
-
config.srtStream = cfg.srtConfig || (cfg.url ? { url: cfg.url } : void 0);
|
|
21292
|
-
if (config.srtStream == null) throw new Error("No SRT source config found");
|
|
21293
|
-
if (cfg.decodeBufferFrames) config.srtStream.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21294
|
-
break;
|
|
21295
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_WEBSOCKET:
|
|
21296
|
-
if (!cfg.url) throw new Error("No websocket channel found");
|
|
21297
|
-
config.websocket = { channel: cfg.url };
|
|
21298
|
-
if (cfg.decodeBufferFrames) config.websocket.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21299
|
-
break;
|
|
21300
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_MOQ:
|
|
21301
|
-
if (cfg.moqConfig == null) throw new Error("No MoQ source config found");
|
|
21302
|
-
config.moq = cfg.moqConfig;
|
|
21303
|
-
if (cfg.decodeBufferFrames) config.moq.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21304
|
-
break;
|
|
21305
|
-
default:
|
|
21306
|
-
throw new Error(`Unsupported source type: ${cfg.sourceType}`);
|
|
21307
|
-
}
|
|
21308
|
-
return config;
|
|
21309
|
-
}
|
|
21310
|
-
buildOutputEncodedConfig(cfg) {
|
|
21311
|
-
return {
|
|
21312
|
-
width: cfg.width,
|
|
21313
|
-
height: cfg.height,
|
|
21314
|
-
fps: cfg.fps,
|
|
21315
|
-
encoderConfig: cfg.encoderConfig
|
|
21316
|
-
};
|
|
21317
|
-
}
|
|
21318
|
-
buildOutputConfig(id, cfg) {
|
|
21319
|
-
var _a, _b;
|
|
21320
|
-
const outputConfig = {
|
|
21321
|
-
id,
|
|
21322
|
-
audioMixIds: cfg.audioMixIds,
|
|
21323
|
-
compositionId: cfg.compositionId,
|
|
21324
|
-
useAsClock: !!cfg.useAsClock
|
|
21325
|
-
};
|
|
21326
|
-
switch (cfg.outputType) {
|
|
21327
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_DECKLINK:
|
|
21328
|
-
if (cfg.decklinkConfig == null) throw new Error("No decklink config found");
|
|
21329
|
-
outputConfig.decklink = cfg.decklinkConfig;
|
|
21330
|
-
break;
|
|
21331
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_RECORDER:
|
|
21332
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder config found");
|
|
21333
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21334
|
-
outputConfig.recorder = {
|
|
21335
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21336
|
-
filename: cfg.recorderConfig.filename,
|
|
21337
|
-
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21338
|
-
groupId: cfg.recorderConfig.groupId,
|
|
21339
|
-
recorderType: cfg.recorderConfig.recorderType
|
|
21340
|
-
};
|
|
21341
|
-
break;
|
|
21342
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
|
|
21343
|
-
if (cfg.superSlowmoRecorderConfig == null) throw new Error("No super slowmo recorder config found");
|
|
21344
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21345
|
-
outputConfig.superSlowmoRecorder = {
|
|
21346
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21347
|
-
filename: cfg.superSlowmoRecorderConfig.filename,
|
|
21348
|
-
sizeGb: cfg.superSlowmoRecorderConfig.sizeGb,
|
|
21349
|
-
groupId: cfg.superSlowmoRecorderConfig.groupId,
|
|
21350
|
-
recorderType: cfg.superSlowmoRecorderConfig.recorderType,
|
|
21351
|
-
compositionIds: ((_a = cfg.superSlowmoRecorderConfig) == null ? void 0 : _a.compositionIds) || [],
|
|
21352
|
-
sourceIds: ((_b = cfg.superSlowmoRecorderConfig) == null ? void 0 : _b.sourceIds) || []
|
|
21353
|
-
};
|
|
21354
|
-
break;
|
|
21355
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
|
|
21356
|
-
if (cfg.systemAudioConfig == null) throw new Error("No system audio config found");
|
|
21357
|
-
outputConfig.systemAudio = cfg.systemAudioConfig;
|
|
21358
|
-
break;
|
|
21359
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SRT:
|
|
21360
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21361
|
-
outputConfig.srt = {
|
|
21362
|
-
url: cfg.encodedConfig.url,
|
|
21363
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21364
|
-
};
|
|
21365
|
-
break;
|
|
21366
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_WEBSOCKET:
|
|
21367
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21368
|
-
outputConfig.websocket = {
|
|
21369
|
-
channel: cfg.encodedConfig.url,
|
|
21370
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21371
|
-
};
|
|
21372
|
-
break;
|
|
21373
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_MOQ:
|
|
21374
|
-
if (cfg.moqConfig == null) throw new Error("No MoQ config found");
|
|
21375
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21376
|
-
outputConfig.moq = {
|
|
21377
|
-
...cfg.moqConfig,
|
|
21378
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21379
|
-
};
|
|
21380
|
-
break;
|
|
21381
|
-
default:
|
|
21382
|
-
throw new Error(`Unsupported output type: ${cfg.outputType}`);
|
|
21383
|
-
}
|
|
21384
|
-
return outputConfig;
|
|
21385
|
-
}
|
|
21386
21247
|
callback(event, data, timeOffsetMs) {
|
|
21387
21248
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21388
21249
|
item.callback = { event, data };
|
|
@@ -21405,7 +21266,7 @@ var CommandList = class {
|
|
|
21405
21266
|
}
|
|
21406
21267
|
add_source(id, cfg, timeOffsetMs) {
|
|
21407
21268
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21408
|
-
item.addSource = { id, config:
|
|
21269
|
+
item.addSource = { id, config: cfg };
|
|
21409
21270
|
return this.add(item, timeOffsetMs);
|
|
21410
21271
|
}
|
|
21411
21272
|
remove_source(id, timeOffsetMs) {
|
|
@@ -21444,11 +21305,11 @@ var CommandList = class {
|
|
|
21444
21305
|
items: playlist.clips.map((clip) => ({
|
|
21445
21306
|
id: clip.id,
|
|
21446
21307
|
recorderId: clip.recorderId,
|
|
21447
|
-
transitionTimeUs:
|
|
21308
|
+
transitionTimeUs: clip.transitionTimeUs,
|
|
21448
21309
|
speed: clip.speed || 1,
|
|
21449
21310
|
audioRouting: clip.audioRouting,
|
|
21450
|
-
startTimeUs: clip.
|
|
21451
|
-
endTimeUs: clip.
|
|
21311
|
+
startTimeUs: clip.startTimeUs,
|
|
21312
|
+
endTimeUs: clip.endTimeUs,
|
|
21452
21313
|
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21453
21314
|
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21454
21315
|
})),
|
|
@@ -21542,7 +21403,7 @@ var CommandList = class {
|
|
|
21542
21403
|
}
|
|
21543
21404
|
update_source(id, cfg, timeOffsetMs) {
|
|
21544
21405
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21545
|
-
item.updateSource = { id, config:
|
|
21406
|
+
item.updateSource = { id, config: cfg };
|
|
21546
21407
|
return this.add(item, timeOffsetMs);
|
|
21547
21408
|
}
|
|
21548
21409
|
update_source_metadata(id, metadata, timeOffsetMs) {
|
|
@@ -21561,12 +21422,12 @@ var CommandList = class {
|
|
|
21561
21422
|
}
|
|
21562
21423
|
add_output(id, cfg, timeOffsetMs) {
|
|
21563
21424
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21564
|
-
item.addOutput =
|
|
21425
|
+
item.addOutput = { id, ...cfg };
|
|
21565
21426
|
return this.add(item, timeOffsetMs);
|
|
21566
21427
|
}
|
|
21567
21428
|
update_output(id, cfg, timeOffsetMs) {
|
|
21568
21429
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21569
|
-
item.updateOutput =
|
|
21430
|
+
item.updateOutput = { id, ...cfg };
|
|
21570
21431
|
return this.add(item, timeOffsetMs);
|
|
21571
21432
|
}
|
|
21572
21433
|
remove_output(id, timeOffsetMs) {
|