STLiveStream
class StageTime.SDK.STLiveStream
Shows a live stream (picture and sound) to everyone in the room, for live events. For now only StageTime Event Hosts can start, change or stop a live stream; for everyone else it stays idle, and the controls do nothing. When an Event Host starts one, everyone in the room sees and hears it, and players who join later see it too. The picture goes to targetRenderer and/or targetTexture; the sound plays from audioSource. Scripts on the same GameObject get OnLiveStreamStart, OnLiveStreamEnd and OnLiveStreamError. Live streams only play inside StageTime, not in the Unity Editor.
Add it with Add Component → StageTime/ST Live Stream.
Fields
MaxNameLength
const int MaxNameLength
Longest stream name, in characters.
defaultStream
string defaultStream
The stream name Play() uses (letters, digits, - and _, up to 64). StageTime gives Event Hosts their stream name. Nothing plays until a StageTime Event Host starts it: for now only Event Hosts can start a live stream.
targetRenderer
Renderer targetRenderer
Show the live picture on this renderer (optional). Its material is not copied.
textureProperty
string textureProperty
The texture property of Target Renderer's material to set. Empty: the material's main texture.
targetTexture
RenderTexture targetTexture
Also copy the live picture into this Render Texture (optional).
audioSource
AudioSource audioSource
Plays the stream's sound. Empty: StageTime adds a 2D Audio Source (heard at the same level everywhere).
Properties
isLive
bool isLive
True while the live picture and sound are playing on this device; false until a StageTime Event Host starts a stream.
isConnecting
bool isConnecting
True while this device is connecting to the stream, or waiting for it to go live.
currentStream
string currentStream
The name of the stream an Event Host started, or "" when no stream is on.
requester
StageTimePlayer requester
The Event Host who started or last changed the stream, or null (also once they have left the room).
canControl
bool canControl
True if the local player may start, change and stop this live stream (for now, StageTime Event Hosts only).
texture
Texture texture
The live picture while the stream is live, or null.
error
string error
Why the stream could not play on this device ("" if it can).
Methods
Play
void Play()
Starts defaultStream for everyone. Does nothing if Default Stream is empty. Only works for StageTime Event Hosts for now.
Play
void Play(string streamName)
Starts the stream called streamName for everyone, replacing the one playing. Only works for StageTime Event Hosts for now; for anyone else it does nothing.
Stop
void Stop()
Stops the live stream for everyone. Only works for StageTime Event Hosts for now.