mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
This adds: - [x] Keyboard and mouse handling on the frontend - [x] Video and audio streaming from the backend to the frontend - [x] Input server that works with Websockets Update - 17/11 - [ ] Master docker container to run this - [ ] Steam runtime - [ ] Entrypoint.sh --------- Co-authored-by: Kristian Ollikainen <14197772+DatCaptainHorse@users.noreply.github.com> Co-authored-by: Kristian Ollikainen <DatCaptainHorse@users.noreply.github.com>
30 lines
655 B
TypeScript
30 lines
655 B
TypeScript
import * as Hex from "../../common/hex"
|
|
import { type Track, decodeTrack } from "./track"
|
|
|
|
export interface Video {
|
|
track: Track
|
|
codec: string
|
|
description?: Uint8Array
|
|
bitrate?: number
|
|
frame_rate?: number
|
|
resolution: Dimensions
|
|
}
|
|
|
|
export interface Dimensions {
|
|
width: number
|
|
height: number
|
|
}
|
|
|
|
export function decodeVideo(o: unknown): o is Video {
|
|
if (typeof o !== "object" || o === null) return false
|
|
|
|
const obj = o as Partial<Video>
|
|
if (!decodeTrack(obj.track)) return false
|
|
if (typeof obj.codec !== "string") return false
|
|
if (typeof obj.description !== "string") return false
|
|
|
|
obj.description = Hex.decode(obj.description)
|
|
|
|
return true
|
|
}
|