@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/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,145 +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
|
-
var _a, _b;
|
|
21276
|
-
const outputConfig = {
|
|
21277
|
-
id,
|
|
21278
|
-
audioMixIds: cfg.audioMixIds,
|
|
21279
|
-
compositionId: cfg.compositionId,
|
|
21280
|
-
useAsClock: !!cfg.useAsClock
|
|
21281
|
-
};
|
|
21282
|
-
switch (cfg.outputType) {
|
|
21283
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_DECKLINK:
|
|
21284
|
-
if (cfg.decklinkConfig == null) throw new Error("No decklink config found");
|
|
21285
|
-
outputConfig.decklink = cfg.decklinkConfig;
|
|
21286
|
-
break;
|
|
21287
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_RECORDER:
|
|
21288
|
-
if (cfg.recorderConfig == null) throw new Error("No recorder config found");
|
|
21289
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21290
|
-
outputConfig.recorder = {
|
|
21291
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21292
|
-
filename: cfg.recorderConfig.filename,
|
|
21293
|
-
sizeGb: cfg.recorderConfig.sizeGb,
|
|
21294
|
-
groupId: cfg.recorderConfig.groupId,
|
|
21295
|
-
recorderType: cfg.recorderConfig.recorderType
|
|
21296
|
-
};
|
|
21297
|
-
break;
|
|
21298
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SUPER_SLOWMO_RECORDER:
|
|
21299
|
-
if (cfg.superSlowmoRecorderConfig == null) throw new Error("No super slowmo recorder config found");
|
|
21300
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21301
|
-
outputConfig.superSlowmoRecorder = {
|
|
21302
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig),
|
|
21303
|
-
filename: cfg.superSlowmoRecorderConfig.filename,
|
|
21304
|
-
sizeGb: cfg.superSlowmoRecorderConfig.sizeGb,
|
|
21305
|
-
groupId: cfg.superSlowmoRecorderConfig.groupId,
|
|
21306
|
-
recorderType: cfg.superSlowmoRecorderConfig.recorderType,
|
|
21307
|
-
compositionIds: ((_a = cfg.superSlowmoRecorderConfig) == null ? void 0 : _a.compositionIds) || [],
|
|
21308
|
-
sourceIds: ((_b = cfg.superSlowmoRecorderConfig) == null ? void 0 : _b.sourceIds) || []
|
|
21309
|
-
};
|
|
21310
|
-
break;
|
|
21311
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_SYSTEM_AUDIO:
|
|
21312
|
-
if (cfg.systemAudioConfig == null) throw new Error("No system audio config found");
|
|
21313
|
-
outputConfig.systemAudio = cfg.systemAudioConfig;
|
|
21314
|
-
break;
|
|
21315
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_SRT:
|
|
21316
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21317
|
-
outputConfig.srt = {
|
|
21318
|
-
url: cfg.encodedConfig.url,
|
|
21319
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21320
|
-
};
|
|
21321
|
-
break;
|
|
21322
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_WEBSOCKET:
|
|
21323
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21324
|
-
outputConfig.websocket = {
|
|
21325
|
-
channel: cfg.encodedConfig.url,
|
|
21326
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21327
|
-
};
|
|
21328
|
-
break;
|
|
21329
|
-
case sesame.v1.outputs.OutputType.OUTPUT_TYPE_ENCODED_MOQ:
|
|
21330
|
-
if (cfg.moqConfig == null) throw new Error("No MoQ config found");
|
|
21331
|
-
if (cfg.encodedConfig == null) throw new Error("No output config found");
|
|
21332
|
-
outputConfig.moq = {
|
|
21333
|
-
...cfg.moqConfig,
|
|
21334
|
-
encoded: this.buildOutputEncodedConfig(cfg.encodedConfig)
|
|
21335
|
-
};
|
|
21336
|
-
break;
|
|
21337
|
-
default:
|
|
21338
|
-
throw new Error(`Unsupported output type: ${cfg.outputType}`);
|
|
21339
|
-
}
|
|
21340
|
-
return outputConfig;
|
|
21341
|
-
}
|
|
21342
21203
|
callback(event, data, timeOffsetMs) {
|
|
21343
21204
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21344
21205
|
item.callback = { event, data };
|
|
@@ -21361,7 +21222,7 @@ var CommandList = class {
|
|
|
21361
21222
|
}
|
|
21362
21223
|
add_source(id, cfg, timeOffsetMs) {
|
|
21363
21224
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21364
|
-
item.addSource = { id, config:
|
|
21225
|
+
item.addSource = { id, config: cfg };
|
|
21365
21226
|
return this.add(item, timeOffsetMs);
|
|
21366
21227
|
}
|
|
21367
21228
|
remove_source(id, timeOffsetMs) {
|
|
@@ -21400,11 +21261,11 @@ var CommandList = class {
|
|
|
21400
21261
|
items: playlist.clips.map((clip) => ({
|
|
21401
21262
|
id: clip.id,
|
|
21402
21263
|
recorderId: clip.recorderId,
|
|
21403
|
-
transitionTimeUs:
|
|
21264
|
+
transitionTimeUs: clip.transitionTimeUs,
|
|
21404
21265
|
speed: clip.speed || 1,
|
|
21405
21266
|
audioRouting: clip.audioRouting,
|
|
21406
|
-
startTimeUs: clip.
|
|
21407
|
-
endTimeUs: clip.
|
|
21267
|
+
startTimeUs: clip.startTimeUs,
|
|
21268
|
+
endTimeUs: clip.endTimeUs,
|
|
21408
21269
|
transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
|
|
21409
21270
|
transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
|
|
21410
21271
|
})),
|
|
@@ -21498,7 +21359,7 @@ var CommandList = class {
|
|
|
21498
21359
|
}
|
|
21499
21360
|
update_source(id, cfg, timeOffsetMs) {
|
|
21500
21361
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21501
|
-
item.updateSource = { id, config:
|
|
21362
|
+
item.updateSource = { id, config: cfg };
|
|
21502
21363
|
return this.add(item, timeOffsetMs);
|
|
21503
21364
|
}
|
|
21504
21365
|
update_source_metadata(id, metadata, timeOffsetMs) {
|
|
@@ -21517,12 +21378,12 @@ var CommandList = class {
|
|
|
21517
21378
|
}
|
|
21518
21379
|
add_output(id, cfg, timeOffsetMs) {
|
|
21519
21380
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21520
|
-
item.addOutput =
|
|
21381
|
+
item.addOutput = { id, ...cfg };
|
|
21521
21382
|
return this.add(item, timeOffsetMs);
|
|
21522
21383
|
}
|
|
21523
21384
|
update_output(id, cfg, timeOffsetMs) {
|
|
21524
21385
|
let item = new sesame.v1.commands.CommandListItem();
|
|
21525
|
-
item.updateOutput =
|
|
21386
|
+
item.updateOutput = { id, ...cfg };
|
|
21526
21387
|
return this.add(item, timeOffsetMs);
|
|
21527
21388
|
}
|
|
21528
21389
|
remove_output(id, timeOffsetMs) {
|