diff options
| author | metamuffin <metamuffin@disroot.org> | 2022-10-05 19:58:57 +0200 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2022-10-05 19:58:57 +0200 |
| commit | 2449d977f1c0fe98bf022ce5608972ae3aef0bce (patch) | |
| tree | 7f0664c5aeba5d2a412ee73d83d3e8e730ae5172 | |
| parent | 3aa27ead6cf12b3677aef4e88bb3cdb0d4cc30a4 (diff) | |
| download | keks-meet-2449d977f1c0fe98bf022ce5608972ae3aef0bce.tar keks-meet-2449d977f1c0fe98bf022ce5608972ae3aef0bce.tar.bz2 keks-meet-2449d977f1c0fe98bf022ce5608972ae3aef0bce.tar.zst | |
update protocol.rs
| -rw-r--r-- | client-native-lib/src/protocol.rs | 10 | ||||
| -rw-r--r-- | common/packets.d.ts | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/client-native-lib/src/protocol.rs b/client-native-lib/src/protocol.rs index 9573f51..78a5a29 100644 --- a/client-native-lib/src/protocol.rs +++ b/client-native-lib/src/protocol.rs @@ -57,9 +57,17 @@ pub enum ChatMesssage { } #[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum TrackKind { + Audio, + Video, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct ProvideInfo { id: String, - kind: String, // TODO actually enum + kind: String, // not an enum so we dont fail if we dont support it + track_kind: Option<TrackKind>, label: Option<String>, size: Option<usize>, } diff --git a/common/packets.d.ts b/common/packets.d.ts index 7991e21..cd7fb02 100644 --- a/common/packets.d.ts +++ b/common/packets.d.ts @@ -40,10 +40,11 @@ export interface /* enum */ RelayMessage { } export interface ChatMessage { text?: string, image?: string } export type ResourceKind = "track" | "file" +export type TrackKind = "audio" | "video" export interface ProvideInfo { id: string, // for datachannels this is `label`, for tracks this will be the `id` of the only associated stream. kind: ResourceKind - track_kind?: "audio" | "video" + track_kind?: TrackKind label?: string size?: number } |