Stop broadcasts on logout (#9978)
Co-authored-by: Andy Balaam <andy.balaam@matrix.org>
This commit is contained in:
parent
0b1fcd208e
commit
29c193210f
5 changed files with 134 additions and 5 deletions
|
@ -15,8 +15,14 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import { Optional } from "matrix-events-sdk";
|
||||
import { EventType, MatrixEvent, MsgType, RelationType } from "matrix-js-sdk/src/matrix";
|
||||
import { EventType, MatrixEvent, MsgType, RelationType, Room, RoomMember } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { SdkContextClass } from "../../../src/contexts/SDKContext";
|
||||
import {
|
||||
VoiceBroadcastPlayback,
|
||||
VoiceBroadcastPreRecording,
|
||||
VoiceBroadcastRecording,
|
||||
} from "../../../src/voice-broadcast";
|
||||
import {
|
||||
VoiceBroadcastChunkEventType,
|
||||
VoiceBroadcastInfoEventType,
|
||||
|
@ -97,3 +103,37 @@ export const mkVoiceBroadcastChunkEvent = (
|
|||
ts: timestamp,
|
||||
});
|
||||
};
|
||||
|
||||
export const mkVoiceBroadcastPlayback = (stores: SdkContextClass): VoiceBroadcastPlayback => {
|
||||
const infoEvent = mkVoiceBroadcastInfoStateEvent(
|
||||
"!room:example.com",
|
||||
VoiceBroadcastInfoState.Started,
|
||||
"@user:example.com",
|
||||
"ASD123",
|
||||
);
|
||||
return new VoiceBroadcastPlayback(infoEvent, stores.client!, stores.voiceBroadcastRecordingsStore);
|
||||
};
|
||||
|
||||
export const mkVoiceBroadcastRecording = (stores: SdkContextClass): VoiceBroadcastRecording => {
|
||||
const infoEvent = mkVoiceBroadcastInfoStateEvent(
|
||||
"!room:example.com",
|
||||
VoiceBroadcastInfoState.Started,
|
||||
"@user:example.com",
|
||||
"ASD123",
|
||||
);
|
||||
return new VoiceBroadcastRecording(infoEvent, stores.client!);
|
||||
};
|
||||
|
||||
export const mkVoiceBroadcastPreRecording = (stores: SdkContextClass): VoiceBroadcastPreRecording => {
|
||||
const roomId = "!room:example.com";
|
||||
const userId = "@user:example.com";
|
||||
const room = new Room(roomId, stores.client!, userId);
|
||||
const roomMember = new RoomMember(roomId, userId);
|
||||
return new VoiceBroadcastPreRecording(
|
||||
room,
|
||||
roomMember,
|
||||
stores.client!,
|
||||
stores.voiceBroadcastPlaybacksStore,
|
||||
stores.voiceBroadcastRecordingsStore,
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue