diff options
-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 } |