Replace voice broadcast running with resumed (#9502)
This commit is contained in:
parent
238a2b77af
commit
625971acb5
11 changed files with 22 additions and 22 deletions
|
@ -68,7 +68,7 @@ export const useVoiceBroadcastRecording = (recording: VoiceBroadcastRecording) =
|
|||
const live = [
|
||||
VoiceBroadcastInfoState.Started,
|
||||
VoiceBroadcastInfoState.Paused,
|
||||
VoiceBroadcastInfoState.Running,
|
||||
VoiceBroadcastInfoState.Resumed,
|
||||
].includes(recordingState);
|
||||
|
||||
return {
|
||||
|
|
|
@ -49,7 +49,7 @@ export const VoiceBroadcastChunkEventType = "io.element.voice_broadcast_chunk";
|
|||
export enum VoiceBroadcastInfoState {
|
||||
Started = "started",
|
||||
Paused = "paused",
|
||||
Running = "running",
|
||||
Resumed = "resumed",
|
||||
Stopped = "stopped",
|
||||
}
|
||||
|
||||
|
|
|
@ -105,15 +105,15 @@ export class VoiceBroadcastRecording
|
|||
public async resume(): Promise<void> {
|
||||
if (this.state !== VoiceBroadcastInfoState.Paused) return;
|
||||
|
||||
this.setState(VoiceBroadcastInfoState.Running);
|
||||
this.setState(VoiceBroadcastInfoState.Resumed);
|
||||
await this.getRecorder().start();
|
||||
await this.sendInfoStateEvent(VoiceBroadcastInfoState.Running);
|
||||
await this.sendInfoStateEvent(VoiceBroadcastInfoState.Resumed);
|
||||
}
|
||||
|
||||
public toggle = async (): Promise<void> => {
|
||||
if (this.getState() === VoiceBroadcastInfoState.Paused) return this.resume();
|
||||
|
||||
if ([VoiceBroadcastInfoState.Started, VoiceBroadcastInfoState.Running].includes(this.getState())) {
|
||||
if ([VoiceBroadcastInfoState.Started, VoiceBroadcastInfoState.Resumed].includes(this.getState())) {
|
||||
return this.pause();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue