What a Live Stream Is
A live stream is a real-time connection to your phones. It carries two things:- Video of each phone’s screen, as it changes.
- Live input going the other way: touch, typing and keys, sent the moment they happen.
When to use it
Connecting
Live streams use WebRTC through LiveKit, an open-source standard with client libraries for JavaScript, Python, Swift, Kotlin, Go, Rust and others.- Call Open Live Stream with the phones you want. It returns a
urland atoken. - Connect to the
urlwith thetokenusing a LiveKit client library. - Each phone appears in the connection as a participant whose identity is
phone:followed by the phone’sid.
Video
Each phone publishes one H.264 video track of its screen. Subscribe to a phone’s track to watch it; video for a phone is only sent while someone is subscribed.- Watching does not need a session. A phone without a session usually has its screen off, so there is little to see.
- A phone sends a new frame when its screen changes. A still screen sends nothing new, and the last frame stays current.
- Positions in the video map to screenshot pixels by scale: the video shows the whole screen, so a point halfway across the video is at half the phone’s
screen.width.
Live Input
Send input as data messages over the same connection. A message is a JSON object encoded as UTF-8, sent reliably, addressed to the phone it is for.in_use.
Messages
A
touch message has one of four phases:
x and y are screenshot pixels. Live touch is one finger, like Touch.
If the connection drops while a finger is down, the phone lifts it by itself.