Fix ongoing broadcast recording after connection error (#9974)
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
This commit is contained in:
parent
533b250bb6
commit
7df973d569
3 changed files with 25 additions and 5 deletions
|
@ -333,7 +333,7 @@ export class VoiceBroadcastRecording
|
|||
* It sets the connection error state and stops the recorder.
|
||||
*/
|
||||
private async onConnectionError(): Promise<void> {
|
||||
await this.stopRecorder();
|
||||
await this.stopRecorder(false);
|
||||
this.setState("connection_error");
|
||||
}
|
||||
|
||||
|
@ -418,14 +418,14 @@ export class VoiceBroadcastRecording
|
|||
}
|
||||
}
|
||||
|
||||
private async stopRecorder(): Promise<void> {
|
||||
private async stopRecorder(emit = true): Promise<void> {
|
||||
if (!this.recorder) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const lastChunk = await this.recorder.stop();
|
||||
if (lastChunk) {
|
||||
if (lastChunk && emit) {
|
||||
await this.onChunkRecorded(lastChunk);
|
||||
}
|
||||
} catch (err) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue