@stinkycomputing/sesame-api-client 1.5.9 → 1.5.10

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/index.cjs CHANGED
@@ -25555,6 +25555,20 @@ var sesame = $root.sesame = (() => {
25555
25555
  })();
25556
25556
 
25557
25557
  // src/command-list.ts
25558
+ function playlistItems(playlist) {
25559
+ return playlist.clips.map((clip) => ({
25560
+ id: clip.id,
25561
+ recorderId: clip.recorderId,
25562
+ transitionTimeUs: clip.transitionTimeUs,
25563
+ speed: clip.speed ?? 1,
25564
+ audioRouting: clip.audioRouting,
25565
+ audioLevels: clip.audioLevels,
25566
+ startTimeUs: clip.startTimeUs,
25567
+ endTimeUs: clip.endTimeUs,
25568
+ transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
25569
+ transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
25570
+ }));
25571
+ }
25558
25572
  var CommandList = class {
25559
25573
  constructor() {
25560
25574
  this.cl = new sesame.v1.commands.CommandList();
@@ -25662,17 +25676,7 @@ var CommandList = class {
25662
25676
  playlistLoad(sourceId, playlist, startTimeUs, startIndex, materialPosUs, timeOffsetMs) {
25663
25677
  const item = new sesame.v1.commands.CommandListItem();
25664
25678
  const loadPlaylistCmd = {
25665
- items: playlist.clips.map((clip) => ({
25666
- id: clip.id,
25667
- recorderId: clip.recorderId,
25668
- transitionTimeUs: clip.transitionTimeUs,
25669
- speed: clip.speed || 1,
25670
- audioRouting: clip.audioRouting,
25671
- startTimeUs: clip.startTimeUs,
25672
- endTimeUs: clip.endTimeUs,
25673
- transitionType: clip.transitionType ?? sesame.v1.recorder.TransitionType.TRANSITION_TYPE_MIX,
25674
- transitionFadeColor: clip.transitionFadeColor ?? { x: 0, y: 0, z: 0, w: 0 }
25675
- })),
25679
+ items: playlistItems(playlist),
25676
25680
  sourceId,
25677
25681
  userPlaylistId: playlist.id,
25678
25682
  startTimeUs,
@@ -25682,6 +25686,21 @@ var CommandList = class {
25682
25686
  item.loadPlaylist = loadPlaylistCmd;
25683
25687
  return this.add(item, timeOffsetMs ?? 0);
25684
25688
  }
25689
+ playlistTake(sourceId, playlist, options = {}) {
25690
+ const item = new sesame.v1.commands.CommandListItem();
25691
+ const takePlaylistCmd = {
25692
+ items: playlistItems(playlist),
25693
+ sourceId,
25694
+ userPlaylistId: playlist.id,
25695
+ startTimeUs: options.startTimeUs,
25696
+ startIndex: options.startIndex,
25697
+ materialPosUs: options.materialPosUs,
25698
+ transitionTimeUs: options.transitionTimeUs,
25699
+ playbackSpeed: options.playbackSpeed
25700
+ };
25701
+ item.takePlaylist = takePlaylistCmd;
25702
+ return this.add(item, options.timeOffsetMs ?? 0, options);
25703
+ }
25685
25704
  playlistEject(sourceId) {
25686
25705
  const item = new sesame.v1.commands.CommandListItem();
25687
25706
  const ejectPlaylistCmd = { sourceId };