Resume voice broadcast on load (#9475)
This commit is contained in:
parent
493ee425b7
commit
5f59ce182e
16 changed files with 554 additions and 22 deletions
|
@ -67,11 +67,17 @@ describe("VoiceBroadcastBody", () => {
|
|||
if (getRoomId === roomId) return room;
|
||||
});
|
||||
|
||||
infoEvent = mkVoiceBroadcastInfoStateEvent(roomId, VoiceBroadcastInfoState.Started, client.getUserId());
|
||||
infoEvent = mkVoiceBroadcastInfoStateEvent(
|
||||
roomId,
|
||||
VoiceBroadcastInfoState.Started,
|
||||
client.getUserId(),
|
||||
client.getDeviceId(),
|
||||
);
|
||||
stoppedEvent = mkVoiceBroadcastInfoStateEvent(
|
||||
roomId,
|
||||
VoiceBroadcastInfoState.Stopped,
|
||||
client.getUserId(),
|
||||
client.getDeviceId(),
|
||||
infoEvent,
|
||||
);
|
||||
room.addEventsToTimeline([infoEvent], true, room.getLiveTimeline());
|
||||
|
|
|
@ -20,6 +20,7 @@ import { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
|||
|
||||
import {
|
||||
VoiceBroadcastInfoEventType,
|
||||
VoiceBroadcastInfoState,
|
||||
VoiceBroadcastRecording,
|
||||
VoiceBroadcastRecordingBody,
|
||||
} from "../../../../src/voice-broadcast";
|
||||
|
@ -49,7 +50,7 @@ describe("VoiceBroadcastRecordingBody", () => {
|
|||
room: roomId,
|
||||
user: userId,
|
||||
});
|
||||
recording = new VoiceBroadcastRecording(infoEvent, client);
|
||||
recording = new VoiceBroadcastRecording(infoEvent, client, VoiceBroadcastInfoState.Running);
|
||||
});
|
||||
|
||||
describe("when rendering a live broadcast", () => {
|
||||
|
|
|
@ -47,13 +47,13 @@ describe("VoiceBroadcastRecordingPip", () => {
|
|||
let renderResult: RenderResult;
|
||||
|
||||
const renderPip = (state: VoiceBroadcastInfoState) => {
|
||||
infoEvent = mkVoiceBroadcastInfoStateEvent(roomId, state, client.getUserId());
|
||||
recording = new VoiceBroadcastRecording(infoEvent, client);
|
||||
|
||||
if (state === VoiceBroadcastInfoState.Paused) {
|
||||
recording.pause();
|
||||
}
|
||||
|
||||
infoEvent = mkVoiceBroadcastInfoStateEvent(
|
||||
roomId,
|
||||
state,
|
||||
client.getUserId(),
|
||||
client.getDeviceId(),
|
||||
);
|
||||
recording = new VoiceBroadcastRecording(infoEvent, client, state);
|
||||
renderResult = render(<VoiceBroadcastRecordingPip recording={recording} />);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue