Skip to content

Commit bfe7ce3

Browse files
committed
fix: stop autoplaying audio when seeking
1 parent ba2bde1 commit bfe7ce3

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

package/src/components/Attachment/Audio/AudioAttachment.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
168168
const dragEnd = async (currentProgress: number) => {
169169
const positionInSeconds = (currentProgress * duration) / ONE_SECOND_IN_MILLISECONDS;
170170
await audioPlayer.seek(positionInSeconds);
171-
audioPlayer.play();
172171
};
173172

174173
const onSpeedChangeHandler = async () => {

package/src/components/MessageInput/components/AudioRecorder/AudioRecordingPreview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export const AudioRecordingPreview = () => {
108108
const dragEnd = useStableCallback(async (currentProgress: number) => {
109109
const positionInSeconds = (currentProgress * duration) / ONE_SECOND_IN_MILLISECONDS;
110110
await audioPlayer.seek(positionInSeconds);
111-
audioPlayer.play();
112111
});
113112

114113
return (

package/src/components/MessageInput/hooks/useAudioRecorder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const useAudioRecorder = ({
114114
console.log('Error uploading voice recording: ', error);
115115
}
116116
},
117-
[audioRecorderManager, attachmentManager, stopVoiceRecording],
117+
[audioRecorderManager, attachmentManager, sendMessage, stopVoiceRecording],
118118
);
119119

120120
return {

0 commit comments

Comments
 (0)