@stinkycomputing/sesame-api-client 1.4.1-alpha.1 → 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 CHANGED
@@ -21244,142 +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
- const outputConfig = {
21320
- id,
21321
- audioMixIds: cfg.audioMixIds,
21322
- compositionId: cfg.compositionId,
21323
- useAsClock: !!cfg.useAsClock
21324
- };
21325
- switch (cfg.outputType) {
21326
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_DECKLINK:
21327
- if (cfg.decklinkConfig == null) throw new Error("No decklink config found");
21328
- outputConfig.decklink = cfg.decklinkConfig;
21329
- break;
21330
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_RECORDER:
21331
- if (cfg.recorderConfig == null) throw new Error("No recorder config found");
21332
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21333
- outputConfig.recorder = {
21334
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
21335
- filename: cfg.recorderConfig.filename,
21336
- sizeGb: cfg.recorderConfig.sizeGb,
21337
- groupId: cfg.recorderConfig.groupId,
21338
- recorderType: cfg.recorderConfig.type
21339
- };
21340
- break;
21341
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
21342
- if (cfg.recorderConfig == null) throw new Error("No recorder config found");
21343
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21344
- outputConfig.superSlowmoRecorder = {
21345
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
21346
- filename: cfg.recorderConfig.filename,
21347
- sizeGb: cfg.recorderConfig.sizeGb,
21348
- groupId: cfg.recorderConfig.groupId,
21349
- recorderType: cfg.recorderConfig.type
21350
- };
21351
- break;
21352
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
21353
- if (cfg.systemAudioConfig == null) throw new Error("No system audio config found");
21354
- outputConfig.systemAudio = cfg.systemAudioConfig;
21355
- break;
21356
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SRT:
21357
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21358
- outputConfig.srt = {
21359
- url: cfg.encodedConfig.url,
21360
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21361
- };
21362
- break;
21363
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_WEBSOCKET:
21364
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21365
- outputConfig.websocket = {
21366
- channel: cfg.encodedConfig.url,
21367
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21368
- };
21369
- break;
21370
- case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_MOQ:
21371
- if (cfg.moqConfig == null) throw new Error("No MoQ config found");
21372
- if (cfg.encodedConfig == null) throw new Error("No output config found");
21373
- outputConfig.moq = {
21374
- ...cfg.moqConfig,
21375
- encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
21376
- };
21377
- break;
21378
- default:
21379
- throw new Error(`Unsupported output type: ${cfg.outputType}`);
21380
- }
21381
- return outputConfig;
21382
- }
21383
21247
  callback(event, data, timeOffsetMs) {
21384
21248
  let item = new sesame.v1.commands.CommandListItem();
21385
21249
  item.callback = { event, data };
@@ -21402,7 +21266,7 @@ var CommandList = class {
21402
21266
  }
21403
21267
  add_source(id, cfg, timeOffsetMs) {
21404
21268
  let item = new sesame.v1.commands.CommandListItem();
21405
- item.addSource = { id, config: this.buildSourceConfig(cfg) };
21269
+ item.addSource = { id, config: cfg };
21406
21270
  return this.add(item, timeOffsetMs);
21407
21271
  }
21408
21272
  remove_source(id, timeOffsetMs) {
@@ -21441,11 +21305,11 @@ var CommandList = class {
21441
21305
  items: playlist.clips.map((clip) => ({
21442
21306
  id: clip.id,
21443
21307
  recorderId: clip.recorderId,
21444
- transitionTimeUs: (clip.transitionTime || 0) * 1e3,
21308
+ transitionTimeUs: clip.transitionTimeUs,
21445
21309
  speed: clip.speed || 1,
21446
21310
  audioRouting: clip.audioRouting,
21447
- startTimeUs: clip.startTime,
21448
- endTimeUs: clip.endTime,
21311
+ startTimeUs: clip.startTimeUs,
21312
+ endTimeUs: clip.endTimeUs,
21449
21313
  transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
21450
21314
  transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
21451
21315
  })),
@@ -21539,7 +21403,7 @@ var CommandList = class {
21539
21403
  }
21540
21404
  update_source(id, cfg, timeOffsetMs) {
21541
21405
  let item = new sesame.v1.commands.CommandListItem();
21542
- item.updateSource = { id, config: this.buildSourceConfig(cfg) };
21406
+ item.updateSource = { id, config: cfg };
21543
21407
  return this.add(item, timeOffsetMs);
21544
21408
  }
21545
21409
  update_source_metadata(id, metadata, timeOffsetMs) {
@@ -21558,12 +21422,12 @@ var CommandList = class {
21558
21422
  }
21559
21423
  add_output(id, cfg, timeOffsetMs) {
21560
21424
  let item = new sesame.v1.commands.CommandListItem();
21561
- item.addOutput = this.buildOutputConfig(id, cfg);
21425
+ item.addOutput = { id, ...cfg };
21562
21426
  return this.add(item, timeOffsetMs);
21563
21427
  }
21564
21428
  update_output(id, cfg, timeOffsetMs) {
21565
21429
  let item = new sesame.v1.commands.CommandListItem();
21566
- item.updateOutput = this.buildOutputConfig(id, cfg);
21430
+ item.updateOutput = { id, ...cfg };
21567
21431
  return this.add(item, timeOffsetMs);
21568
21432
  }
21569
21433
  remove_output(id, timeOffsetMs) {