2022-09-19 09:42:29 +03:00
|
|
|
/*
|
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-09-26 16:29:38 +03:00
|
|
|
/**
|
|
|
|
* Voice Broadcast module
|
|
|
|
* {@link https://github.com/vector-im/element-meta/discussions/632}
|
|
|
|
*/
|
|
|
|
|
|
|
|
import { RelationType } from "matrix-js-sdk/src/matrix";
|
|
|
|
|
2022-10-14 07:13:17 +03:00
|
|
|
export * from "./models/VoiceBroadcastPlayback";
|
2022-11-10 11:38:48 +03:00
|
|
|
export * from "./models/VoiceBroadcastPreRecording";
|
2022-10-14 07:13:17 +03:00
|
|
|
export * from "./models/VoiceBroadcastRecording";
|
2022-10-12 01:31:28 +03:00
|
|
|
export * from "./audio/VoiceBroadcastRecorder";
|
|
|
|
export * from "./components/VoiceBroadcastBody";
|
|
|
|
export * from "./components/atoms/LiveBadge";
|
2022-10-20 11:04:14 +03:00
|
|
|
export * from "./components/atoms/VoiceBroadcastControl";
|
2022-10-12 17:00:37 +03:00
|
|
|
export * from "./components/atoms/VoiceBroadcastHeader";
|
2022-10-14 07:13:17 +03:00
|
|
|
export * from "./components/molecules/VoiceBroadcastPlaybackBody";
|
2022-11-10 11:38:48 +03:00
|
|
|
export * from "./components/molecules/VoiceBroadcastPreRecordingPip";
|
2022-10-12 01:31:28 +03:00
|
|
|
export * from "./components/molecules/VoiceBroadcastRecordingBody";
|
2022-10-14 21:12:26 +03:00
|
|
|
export * from "./components/molecules/VoiceBroadcastRecordingPip";
|
2022-11-10 11:38:48 +03:00
|
|
|
export * from "./hooks/useCurrentVoiceBroadcastPreRecording";
|
|
|
|
export * from "./hooks/useCurrentVoiceBroadcastRecording";
|
2022-10-14 21:12:26 +03:00
|
|
|
export * from "./hooks/useVoiceBroadcastRecording";
|
2022-10-14 07:13:17 +03:00
|
|
|
export * from "./stores/VoiceBroadcastPlaybacksStore";
|
2022-11-10 11:38:48 +03:00
|
|
|
export * from "./stores/VoiceBroadcastPreRecordingStore";
|
2022-10-12 01:31:28 +03:00
|
|
|
export * from "./stores/VoiceBroadcastRecordingsStore";
|
2022-11-10 11:38:48 +03:00
|
|
|
export * from "./utils/checkVoiceBroadcastPreConditions";
|
2022-10-20 16:41:10 +03:00
|
|
|
export * from "./utils/getChunkLength";
|
2022-11-10 13:53:49 +03:00
|
|
|
export * from "./utils/getMaxBroadcastLength";
|
2022-10-19 16:01:14 +03:00
|
|
|
export * from "./utils/hasRoomLiveVoiceBroadcast";
|
2022-10-21 10:30:02 +03:00
|
|
|
export * from "./utils/findRoomLiveVoiceBroadcastFromUserAndDevice";
|
2022-10-14 07:13:17 +03:00
|
|
|
export * from "./utils/shouldDisplayAsVoiceBroadcastRecordingTile";
|
2022-10-12 01:31:28 +03:00
|
|
|
export * from "./utils/shouldDisplayAsVoiceBroadcastTile";
|
|
|
|
export * from "./utils/startNewVoiceBroadcastRecording";
|
2022-10-21 10:30:02 +03:00
|
|
|
export * from "./utils/VoiceBroadcastResumer";
|
2022-09-26 16:29:38 +03:00
|
|
|
|
2022-09-19 09:42:29 +03:00
|
|
|
export const VoiceBroadcastInfoEventType = "io.element.voice_broadcast_info";
|
2022-10-12 18:58:57 +03:00
|
|
|
export const VoiceBroadcastChunkEventType = "io.element.voice_broadcast_chunk";
|
2022-09-26 16:29:38 +03:00
|
|
|
|
|
|
|
export enum VoiceBroadcastInfoState {
|
|
|
|
Started = "started",
|
|
|
|
Paused = "paused",
|
2022-10-26 15:54:44 +03:00
|
|
|
Resumed = "resumed",
|
2022-09-26 16:29:38 +03:00
|
|
|
Stopped = "stopped",
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface VoiceBroadcastInfoEventContent {
|
2022-10-12 14:24:30 +03:00
|
|
|
device_id: string;
|
2022-09-26 16:29:38 +03:00
|
|
|
state: VoiceBroadcastInfoState;
|
2022-09-28 11:22:50 +03:00
|
|
|
chunk_length?: number;
|
2022-10-27 17:24:03 +03:00
|
|
|
last_chunk_sequence?: number;
|
2022-09-26 16:29:38 +03:00
|
|
|
["m.relates_to"]?: {
|
|
|
|
rel_type: RelationType;
|
|
|
|
event_id: string;
|
|
|
|
};
|
|
|
|
}
|