Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b967465

Browse files
authored
Merge pull request #6563 from matrix-org/travis/voice-messages/stop-playing
Stop voice messages that are playing when starting a recording
2 parents 570c2b3 + 17a3dc5 commit b967465

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/views/rooms/VoiceRecordComposerTile.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import NotificationBadge from "./NotificationBadge";
3535
import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState";
3636
import { NotificationColor } from "../../../stores/notifications/NotificationColor";
3737
import InlineSpinner from "../elements/InlineSpinner";
38+
import { PlaybackManager } from "../../../audio/PlaybackManager";
3839

3940
interface IProps {
4041
room: Room;
@@ -177,6 +178,9 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
177178
}
178179

179180
try {
181+
// stop any noises which might be happening
182+
await PlaybackManager.instance.playOnly(null);
183+
180184
const recorder = VoiceRecordingStore.instance.startRecording();
181185
await recorder.start();
182186

0 commit comments

Comments
 (0)