Files
pistation/apps/kiosk-client/src-tauri/src/room/events.rs
T
SirBlob 7d0a973638 Add kiosk desktop app
Tauri app for the Pi. Media runs through the native LiveKit SDK because
WebKitGTK has no WebRTC, with frames encoded in Rust and drawn to a canvas
under the annotation overlay.
2026-08-09 17:09:16 -04:00

57 lines
1.2 KiB
Rust

use serde::Serialize;
pub const STATUS_EVENT: &str = "room://status";
pub const DATA_EVENT: &str = "room://data";
pub const VIDEO_EVENT: &str = "room://video";
pub const PARTICIPANTS_EVENT: &str = "room://participants";
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ParticipantView {
pub identity: String,
pub display_name: String,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ParticipantsPayload {
pub participants: Vec<ParticipantView>,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StatusPayload {
pub status: &'static str,
pub detail: Option<String>,
}
impl StatusPayload {
pub fn new(status: &'static str) -> Self {
Self {
status,
detail: None,
}
}
pub fn with_detail(status: &'static str, detail: String) -> Self {
Self {
status,
detail: Some(detail),
}
}
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct DataPayload {
pub envelope: String,
}
#[derive(Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct VideoPayload {
pub active: bool,
pub width: u32,
pub height: u32,
}