Skip to main content

opentalk_roomserver_types_livekit/
command.rs

1// SPDX-FileCopyrightText: OpenTalk GmbH <mail@opentalk.eu>
2//
3// SPDX-License-Identifier: EUPL-1.2
4
5use std::collections::BTreeSet;
6
7use opentalk_roomserver_signaling::signaling_module::CreateReplica;
8use opentalk_types_signaling::ParticipantId;
9
10use crate::event::LiveKitEvent;
11
12/// The livekit command variants
13#[derive(Debug, PartialEq, serde::Deserialize, serde::Serialize)]
14#[serde(rename_all = "snake_case", tag = "action")]
15pub enum LiveKitCommand {
16    /// Indicates that a new Access Token is requested
17    CreateNewAccessToken,
18
19    /// Allows the specified participants to share their screens
20    GrantScreenSharePermission {
21        /// The participants that get granted screen sharing permissions
22        participants: BTreeSet<ParticipantId>,
23    },
24
25    /// Revokes the permission to share their screen
26    RevokeScreenSharePermission {
27        /// The participants
28        participants: BTreeSet<ParticipantId>,
29    },
30
31    /// Request a new livekit access token that cannot publish and is hidden to other participants
32    RequestPopoutStreamAccessToken,
33}
34
35impl CreateReplica<LiveKitEvent> for LiveKitCommand {
36    fn replicate(&self) -> Option<LiveKitEvent> {
37        None
38    }
39}