Stop voice messages that are playing when starting a recording

Fixes https://github.com/vector-im/element-web/issues/18410
pull/21833/head
Travis Ralston 2021-08-05 12:44:12 -06:00
parent 570c2b3292
commit 17a3dc5e6d
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import NotificationBadge from "./NotificationBadge";
import { StaticNotificationState } from "../../../stores/notifications/StaticNotificationState";
import { NotificationColor } from "../../../stores/notifications/NotificationColor";
import InlineSpinner from "../elements/InlineSpinner";
import { PlaybackManager } from "../../../audio/PlaybackManager";
interface IProps {
room: Room;
@ -177,6 +178,9 @@ export default class VoiceRecordComposerTile extends React.PureComponent<IProps,
}
try {
// stop any noises which might be happening
await PlaybackManager.instance.playOnly(null);
const recorder = VoiceRecordingStore.instance.startRecording();
await recorder.start();