@superinterface/react 5.3.0-beta.14 → 5.3.0-beta.16

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
@@ -48117,7 +48117,8 @@ var useMessageAudio = function(_ref) {
48117
48117
  checkForCompletion
48118
48118
  ]);
48119
48119
  (0, import_react67.useEffect)(function() {
48120
- if (isPlaying) return;
48120
+ var allowParallel = Boolean(providedPlaySegments);
48121
+ if (!allowParallel && (isPlaying || audioPlayer.playing)) return;
48121
48122
  if (pickLockRef.current) return;
48122
48123
  if (audioQueue.length === 0) return;
48123
48124
  var candidate = null;
@@ -48138,11 +48139,11 @@ var useMessageAudio = function(_ref) {
48138
48139
  }
48139
48140
  if (!candidate || candidate.segments.length === 0) return;
48140
48141
  pickLockRef.current = true;
48141
- setIsPlaying(true);
48142
+ if (!allowParallel) setIsPlaying(true);
48142
48143
  setAudioQueue(function(prev_0) {
48143
48144
  return prev_0.map(function(m_14) {
48144
48145
  return m_14.id === candidate.messageId ? _objectSpread47(_objectSpread47({}, m_14), {}, {
48145
- nextIndex: m_14.segments.length
48146
+ nextIndex: candidate.startIndex + candidate.segments.length
48146
48147
  }) : m_14;
48147
48148
  });
48148
48149
  });
@@ -48205,6 +48206,9 @@ var useMessageAudio = function(_ref) {
48205
48206
  }
48206
48207
  };
48207
48208
  runPlayback();
48209
+ if (allowParallel) {
48210
+ pickLockRef.current = false;
48211
+ }
48208
48212
  }, [
48209
48213
  audioQueue,
48210
48214
  isPlaying,
@@ -48212,7 +48216,9 @@ var useMessageAudio = function(_ref) {
48212
48216
  playInternal,
48213
48217
  handleStop,
48214
48218
  handleSegmentEnd,
48215
- checkForCompletion
48219
+ checkForCompletion,
48220
+ providedPlaySegments,
48221
+ audioPlayer.playing
48216
48222
  ]);
48217
48223
  (0, import_react67.useEffect)(function() {
48218
48224
  if (isHtmlAudioSupported) {