@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.js CHANGED
@@ -47968,7 +47968,8 @@ var useMessageAudio = function(_ref) {
47968
47968
  checkForCompletion
47969
47969
  ]);
47970
47970
  useEffect10(function() {
47971
- if (isPlaying) return;
47971
+ var allowParallel = Boolean(providedPlaySegments);
47972
+ if (!allowParallel && (isPlaying || audioPlayer.playing)) return;
47972
47973
  if (pickLockRef.current) return;
47973
47974
  if (audioQueue.length === 0) return;
47974
47975
  var candidate = null;
@@ -47989,11 +47990,11 @@ var useMessageAudio = function(_ref) {
47989
47990
  }
47990
47991
  if (!candidate || candidate.segments.length === 0) return;
47991
47992
  pickLockRef.current = true;
47992
- setIsPlaying(true);
47993
+ if (!allowParallel) setIsPlaying(true);
47993
47994
  setAudioQueue(function(prev_0) {
47994
47995
  return prev_0.map(function(m_14) {
47995
47996
  return m_14.id === candidate.messageId ? _objectSpread47(_objectSpread47({}, m_14), {}, {
47996
- nextIndex: m_14.segments.length
47997
+ nextIndex: candidate.startIndex + candidate.segments.length
47997
47998
  }) : m_14;
47998
47999
  });
47999
48000
  });
@@ -48056,6 +48057,9 @@ var useMessageAudio = function(_ref) {
48056
48057
  }
48057
48058
  };
48058
48059
  runPlayback();
48060
+ if (allowParallel) {
48061
+ pickLockRef.current = false;
48062
+ }
48059
48063
  }, [
48060
48064
  audioQueue,
48061
48065
  isPlaying,
@@ -48063,7 +48067,9 @@ var useMessageAudio = function(_ref) {
48063
48067
  playInternal,
48064
48068
  handleStop,
48065
48069
  handleSegmentEnd,
48066
- checkForCompletion
48070
+ checkForCompletion,
48071
+ providedPlaySegments,
48072
+ audioPlayer.playing
48067
48073
  ]);
48068
48074
  useEffect10(function() {
48069
48075
  if (isHtmlAudioSupported) {