Video¶
Drive Video Players from a script with the Video.* API. You address a player by its Video Name, and control routes through the same server‑authoritative path as a button or a no‑code Video Control action — so when your script loads or seeks a video, everyone stays in sync.
Synced by default — scripts run on the server
Video.* runs on the server and updates the shared video state, which is broadcast to every player. That's exactly what you want for a watch‑party screen. (A video with Synced unchecked is local‑only and isn't driven by Video.*.)
Control a video¶
class Cinema : NexusBehaviour
{
public void StartShow()
{
Video.Load("lobbyScreen", "https://youtu.be/dQw4w9WgXcQ"); // resolves + plays for all
}
public void Intermission()
{
Video.Pause("lobbyScreen");
Video.Seek("lobbyScreen", 0); // back to the start
}
}
| Call | What it does |
|---|---|
Video.Load(name, url) |
Load a new URL (direct file or a YouTube/Twitch link — resolved per‑player) and play it |
Video.Play(name) · Video.Pause(name) · Video.Stop(name) |
Transport (Stop rewinds to 0) |
Video.TogglePlay(name) · Video.Restart(name) |
Toggle play/pause · restart from 0 |
Video.Seek(name, seconds) |
Jump to a position |
Video.SetVolume(name, v) |
Master volume 0..1 |
Video.SetRate(name, r) |
Playback speed (1 = normal) |
Video.SetMuted(name, b) · Video.Mute(name) · Video.Unmute(name) |
Mute control |
Read the state¶
if (Video.IsPlaying("lobbyScreen"))
{
float t = Video.GetTime("lobbyScreen"); // current playhead, seconds (approx)
Debug.Log("playing at " + t);
}
| Call | Returns |
|---|---|
Video.IsPlaying(name) |
bool — is it playing? |
Video.GetTime(name) |
float — the playhead in seconds (the server's estimate) |
What the server can't tell you
The server never decodes the video, so Video.GetTime is an estimate, and the exact duration and current frame aren't readable from a script — those live on each player's machine. For an in‑world progress bar or time label, drive UI directly from the player's UI output events (On Progress, On Time Text, …) instead — see Video Players ▸ Showing playback. Script callbacks for "video finished" are a planned addition.
Reacting to a video¶
Until script callbacks land, react to a video the no‑code way: the player raises custom signals "<videoName>:finished", ":started", ":bufferingstart", … which an On Custom trigger handles. A common pattern — a script‑driven playlist — pairs that signal with Video.Load:
On custom "lobbyScreen:finished"→ run a script method that callsVideo.Load("lobbyScreen", nextUrl).
See Video Players ▸ Reacting to video events.
Quick reference¶
| Group | Calls |
|---|---|
| Transport | Video.Play · Pause · Stop · TogglePlay · Restart |
| Load / seek | Video.Load(name,url) · Video.Seek(name,sec) |
| Audio | Video.SetVolume(name,v) · Video.SetRate(name,r) · Video.SetMuted(name,b) · Mute · Unmute |
| Read | Video.IsPlaying(name) · Video.GetTime(name) |
→ The full feature (screens, speakers, UI wiring, events): Video Players. For shared session values across scripts & no‑code: Storage & shared state.