mirror of https://github.com/vector-im/riot-web
Pause voice broadcast on calls (#9623)
parent
ad190b1dcc
commit
e38c59c535
|
@ -283,8 +283,8 @@ export class StopGapWidget extends EventEmitter {
|
||||||
this.messaging.on("capabilitiesNotified", () => this.emit("capabilitiesNotified"));
|
this.messaging.on("capabilitiesNotified", () => this.emit("capabilitiesNotified"));
|
||||||
this.messaging.on(`action:${WidgetApiFromWidgetAction.OpenModalWidget}`, this.onOpenModal);
|
this.messaging.on(`action:${WidgetApiFromWidgetAction.OpenModalWidget}`, this.onOpenModal);
|
||||||
this.messaging.on(`action:${ElementWidgetActions.JoinCall}`, () => {
|
this.messaging.on(`action:${ElementWidgetActions.JoinCall}`, () => {
|
||||||
// stop voice broadcast recording when any widget sends a "join"
|
// pause voice broadcast recording when any widget sends a "join"
|
||||||
VoiceBroadcastRecordingsStore.instance().getCurrent()?.stop();
|
VoiceBroadcastRecordingsStore.instance().getCurrent()?.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Always attach a handler for ViewRoom, but permission check it internally
|
// Always attach a handler for ViewRoom, but permission check it internally
|
||||||
|
|
|
@ -222,8 +222,8 @@ export class VoiceBroadcastRecording
|
||||||
private onAction = (payload: ActionPayload) => {
|
private onAction = (payload: ActionPayload) => {
|
||||||
if (payload.action !== "call_state") return;
|
if (payload.action !== "call_state") return;
|
||||||
|
|
||||||
// stop on any call action
|
// pause on any call action
|
||||||
this.stop();
|
this.pause();
|
||||||
};
|
};
|
||||||
|
|
||||||
private setState(state: VoiceBroadcastInfoState): void {
|
private setState(state: VoiceBroadcastInfoState): void {
|
||||||
|
|
|
@ -89,7 +89,7 @@ describe("StopGapWidget", () => {
|
||||||
content: {},
|
content: {},
|
||||||
});
|
});
|
||||||
voiceBroadcastRecording = new VoiceBroadcastRecording(voiceBroadcastInfoEvent, client);
|
voiceBroadcastRecording = new VoiceBroadcastRecording(voiceBroadcastInfoEvent, client);
|
||||||
jest.spyOn(voiceBroadcastRecording, "stop");
|
jest.spyOn(voiceBroadcastRecording, "pause");
|
||||||
jest.spyOn(VoiceBroadcastRecordingsStore.instance(), "getCurrent").mockReturnValue(voiceBroadcastRecording);
|
jest.spyOn(VoiceBroadcastRecordingsStore.instance(), "getCurrent").mockReturnValue(voiceBroadcastRecording);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -105,8 +105,8 @@ describe("StopGapWidget", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should stop the current voice broadcast recording", () => {
|
it("should pause the current voice broadcast recording", () => {
|
||||||
expect(voiceBroadcastRecording.stop).toHaveBeenCalled();
|
expect(voiceBroadcastRecording.pause).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -296,7 +296,7 @@ describe("VoiceBroadcastRecording", () => {
|
||||||
}, true);
|
}, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
itShouldBeInState(VoiceBroadcastInfoState.Stopped);
|
itShouldBeInState(VoiceBroadcastInfoState.Paused);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("and a chunk time update occurs", () => {
|
describe("and a chunk time update occurs", () => {
|
||||||
|
|
Loading…
Reference in New Issue