@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 +7 -143
- 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 -143
- package/dist/browser.mjs.map +2 -2
- package/dist/command-list.d.ts +18 -135
- package/dist/command-list.d.ts.map +1 -1
- package/dist/index.cjs +7 -143
- 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 -143
- package/dist/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ type IEvent = sesame.v1.rpc.IEvent;
|
|
|
17
17
|
export { sesame, Message, Request, Response, Event };
|
|
18
18
|
export type { IMessage, IRequest, IResponse, IEvent };
|
|
19
19
|
export { CommandList } from './command-list';
|
|
20
|
-
export type { CompositorID, ReplayID, AudioMixerID, INodeConfig, IEncoderConfig, IRecorderOutputConfig, IOutputConfig, IEncoderOutputConfig, IDecklinkOutputConfig,
|
|
20
|
+
export type { CompositorID, ReplayID, AudioMixerID, INodeConfig, IEncoderConfig, IRecorderOutputConfig, ISuperSlowmoRecorderOutputConfig, IOutputConfig, IEncoderOutputConfig, IDecklinkOutputConfig, IAudioMixerChannel, IAudioMixerConfig, ISourceConfig, IRecorderSourceConfig, ISourceTransportConfig, ITransportCommand, IPlaylistClip, IPlaylist, ITransactionOptions, keyframe } from './command-list';
|
|
21
21
|
export { RPCClient, IClientOptions, IProtobufType } from './rpc-client';
|
|
22
22
|
export { SesameConnection, IConnectionOptions, VideoCallback, AudioCallback, waitForEvent } from './sesame-connection';
|
|
23
23
|
export { SesameBinaryProtocol, PacketType, CodecType } from './sesame-binary-protocol';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AACxC,QAAA,MAAM,KAAK,4BAAsB,CAAC;AAElC,KAAK,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvC,KAAK,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvC,KAAK,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC;AACzC,KAAK,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACrD,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,OAAO,8BAAwB,CAAC;AACtC,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AACxC,QAAA,MAAM,KAAK,4BAAsB,CA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ED
|
@@ -21200,142 +21200,6 @@ var CommandList = class {
|
|
|
21200
21200
|
get_command_list_msg() {
|
|
21201
21201
|
return this.cl;
|
|
21202
21202
|
}
|
|
21203
|
-
buildSourceConfig(cfg) {
|
|
21204
|
-
var _a;
|
|
21205
|
-
const config = {
|
|
21206
|
-
common: {
|
|
21207
|
-
userId: cfg.userId,
|
|
21208
|
-
useAsClock: cfg.useAsClock,
|
|
21209
|
-
audioOnly: cfg.audioOnly,
|
|
21210
|
-
audioChannels: cfg.audioChannels,
|
|
21211
|
-
loop: cfg.loop,
|
|
21212
|
-
playState: cfg.playState,
|
|
21213
|
-
mipMap: cfg.mipMap,
|
|
21214
|
-
textureSize: cfg.textureSize,
|
|
21215
|
-
decoderType: cfg.decoderType,
|
|
21216
|
-
deinterlace: cfg.deinterlace,
|
|
21217
|
-
videoProcessors: cfg.videoProcessors || []
|
|
21218
|
-
}
|
|
21219
|
-
};
|
|
21220
|
-
switch (cfg.sourceType) {
|
|
21221
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_FILE:
|
|
21222
|
-
config.file = { url: ((_a = cfg.fileConfig) == null ? void 0 : _a.filename) || cfg.url || "" };
|
|
21223
|
-
break;
|
|
21224
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_RECORDER:
|
|
21225
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder source config found");
|
|
21226
|
-
config.recorder = cfg.recorderConfig;
|
|
21227
|
-
break;
|
|
21228
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_BROWSER:
|
|
21229
|
-
if (!cfg.url) throw new Error("No browser URL found");
|
|
21230
|
-
config.browser = { url: cfg.url };
|
|
21231
|
-
break;
|
|
21232
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_RTT:
|
|
21233
|
-
if (cfg.rttConfig == null) throw new Error("No RTT config found");
|
|
21234
|
-
config.rtt = cfg.rttConfig;
|
|
21235
|
-
break;
|
|
21236
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_DECKLINK:
|
|
21237
|
-
if (cfg.decklinkConfig == null) throw new Error("No decklink source config found");
|
|
21238
|
-
config.decklink = cfg.decklinkConfig;
|
|
21239
|
-
break;
|
|
21240
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SIGNAL_GENERATOR:
|
|
21241
|
-
config.signalGenerator = {};
|
|
21242
|
-
break;
|
|
21243
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SYSTEM_AUDIO:
|
|
21244
|
-
config.systemAudio = { deviceName: cfg.url || "" };
|
|
21245
|
-
break;
|
|
21246
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_SRT_STREAM:
|
|
21247
|
-
config.srtStream = cfg.srtConfig || (cfg.url ? { url: cfg.url } : void 0);
|
|
21248
|
-
if (config.srtStream == null) throw new Error("No SRT source config found");
|
|
21249
|
-
if (cfg.decodeBufferFrames) config.srtStream.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21250
|
-
break;
|
|
21251
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_WEBSOCKET:
|
|
21252
|
-
if (!cfg.url) throw new Error("No websocket channel found");
|
|
21253
|
-
config.websocket = { channel: cfg.url };
|
|
21254
|
-
if (cfg.decodeBufferFrames) config.websocket.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21255
|
-
break;
|
|
21256
|
-
case sesame.v1.sources.SourceType.SOURCE_TYPE_MOQ:
|
|
21257
|
-
if (cfg.moqConfig == null) throw new Error("No MoQ source config found");
|
|
21258
|
-
config.moq = cfg.moqConfig;
|
|
21259
|
-
if (cfg.decodeBufferFrames) config.moq.decodeBufferFrames = cfg.decodeBufferFrames;
|
|
21260
|
-
break;
|
|
21261
|
-
default:
|
|
21262
|
-
throw new Error(`Unsupported source type: ${cfg.sourceType}`);
|
|
21263
|
-
}
|
|
21264
|
-
return config;
|
|
21265
|
-
}
|
|
21266
|
-
buildOutputEncodedConfig(cfg) {
|
|
21267
|
-
return {
|
|
21268
|
-
width: cfg.width,
|
|
21269
|
-
height: cfg.height,
|
|
21270
|
-
fps: cfg.fps,
|
|
21271
|
-
encoderConfig: cfg.encoderConfig
|
|
21272
|
-
};
|
|
21273
|
-
}
|
|
21274
|
-
buildOutputConfig(id, cfg) {
|
|
21275
|
-
const outputConfig = {
|
|
21276
|
-
id,
|
|
21277
|
-
audioMixIds: cfg.audioMixIds,
|
|
21278
|
-
compositionId: cfg.compositionId,
|
|
21279
|
-
useAsClock: !!cfg.useAsClock
|
|
21280
|
-
};
|
|
21281
|
-
switch (cfg.outputType) {
|
|
21282
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_DECKLINK:
|
|
21283
|
-
if (cfg.decklinkConfig == null) throw new Error("No decklink config found");
|
|
21284
|
-
outputConfig.decklink = cfg.decklinkConfig;
|
|
21285
|
-
break;
|
|
21286
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_RECORDER:
|
|
21287
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder config found");
|
|
21288
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21289
|
-
outputConfig.recorder = {
|
|
21290
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21291
|
-
filename: cfg.recorderConfig.filename,
|
|
21292
|
-
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21293
|
-
groupId: cfg.recorderConfig.groupId,
|
|
21294
|
-
recorderType: cfg.recorderConfig.type
|
|
21295
|
-
};
|
|
21296
|
-
break;
|
|
21297
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
|
|
21298
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder config found");
|
|
21299
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21300
|
-
outputConfig.superSlowmoRecorder = {
|
|
21301
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21302
|
-
filename: cfg.recorderConfig.filename,
|
|
21303
|
-
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21304
|
-
groupId: cfg.recorderConfig.groupId,
|
|
21305
|
-
recorderType: cfg.recorderConfig.type
|
|
21306
|
-
};
|
|
21307
|
-
break;
|
|
21308
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
|
|
21309
|
-
if (cfg.systemAudioConfig == null) throw new Error("No system audio config found");
|
|
21310
|
-
outputConfig.systemAudio = cfg.systemAudioConfig;
|
|
21311
|
-
break;
|
|
21312
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SRT:
|
|
21313
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21314
|
-
outputConfig.srt = {
|
|
21315
|
-
url: cfg.encodedConfig.url,
|
|
21316
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21317
|
-
};
|
|
21318
|
-
break;
|
|
21319
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_WEBSOCKET:
|
|
21320
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21321
|
-
outputConfig.websocket = {
|
|
21322
|
-
channel: cfg.encodedConfig.url,
|
|
21323
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21324
|
-
};
|
|
21325
|
-
break;
|
|
21326
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_MOQ:
|
|
21327
|
-
if (cfg.moqConfig == null) throw new Error("No MoQ config found");
|
|
21328
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21329
|
-
outputConfig.moq = {
|
|
21330
|
-
...cfg.moqConfig,
|
|
21331
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21332
|
-
};
|
|
21333
|
-
break;
|
|
21334
|
-
default:
|
|
21335
|
-
throw new Error(`Unsupported output type: ${cfg.outputType}`);
|
|
21336
|
-
}
|
|
21337
|
-
return outputConfig;
|
|
21338
|
-
}
|
|
21339
21203
|
callback(event, data, timeOffsetMs) {
|
|
21340
21204
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21341
21205
|
item.callback = { event, data };
|
|
@@ -21358,7 +21222,7 @@ var CommandList = class {
|
|
|
21358
21222
|
}
|
|
21359
21223
|
add_source(id, cfg, timeOffsetMs) {
|
|
21360
21224
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21361
|
-
item.addSource = { id, config:
|
|
21225
|
+
item.addSource = { id, config: cfg };
|
|
21362
21226
|
return this.add(item, timeOffsetMs);
|
|
21363
21227
|
}
|
|
21364
21228
|
remove_source(id, timeOffsetMs) {
|
|
@@ -21397,11 +21261,11 @@ var CommandList = class {
|
|
|
21397
21261
|
items: playlist.clips.map((clip) => ({
|
|
21398
21262
|
id: clip.id,
|
|
21399
21263
|
recorderId: clip.recorderId,
|
|
21400
|
-
transitionTimeUs:
|
|
21264
|
+
transitionTimeUs: clip.transitionTimeUs,
|
|
21401
21265
|
speed: clip.speed || 1,
|
|
21402
21266
|
audioRouting: clip.audioRouting,
|
|
21403
|
-
startTimeUs: clip.
|
|
21404
|
-
endTimeUs: clip.
|
|
21267
|
+
startTimeUs: clip.startTimeUs,
|
|
21268
|
+
endTimeUs: clip.endTimeUs,
|
|
21405
21269
|
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21406
21270
|
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21407
21271
|
})),
|
|
@@ -21495,7 +21359,7 @@ var CommandList = class {
|
|
|
21495
21359
|
}
|
|
21496
21360
|
update_source(id, cfg, timeOffsetMs) {
|
|
21497
21361
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21498
|
-
item.updateSource = { id, config:
|
|
21362
|
+
item.updateSource = { id, config: cfg };
|
|
21499
21363
|
return this.add(item, timeOffsetMs);
|
|
21500
21364
|
}
|
|
21501
21365
|
update_source_metadata(id, metadata, timeOffsetMs) {
|
|
@@ -21514,12 +21378,12 @@ var CommandList = class {
|
|
|
21514
21378
|
}
|
|
21515
21379
|
add_output(id, cfg, timeOffsetMs) {
|
|
21516
21380
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21517
|
-
item.addOutput =
|
|
21381
|
+
item.addOutput = { id, ...cfg };
|
|
21518
21382
|
return this.add(item, timeOffsetMs);
|
|
21519
21383
|
}
|
|
21520
21384
|
update_output(id, cfg, timeOffsetMs) {
|
|
21521
21385
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21522
|
-
item.updateOutput =
|
|
21386
|
+
item.updateOutput = { id, ...cfg };
|
|
21523
21387
|
return this.add(item, timeOffsetMs);
|
|
21524
21388
|
}
|
|
21525
21389
|
remove_output(id, timeOffsetMs) {
|