Streaming Manager
The Streaming Manager is one half of the core Beam Streaming logic, tied closely to the Streaming Camera. Everything to do with authentication, starting and stopping streams, and controlling recordings happens through the manager.
You can easily hook into events in the Beam lifecycle by using our Beam Unity Events component, which is pre-attached to the Streaming Manager.
You will need to obtain a Experience Key and Secret from the Beam Developer Portal before you attempt to start any streams. Instructions can be found here.
Accessing the Streaming Manager
The streaming manager is available directly in your scene via standard Unity find commands, or by using the BeamStreamingManager.Instance
call.
It will automatically be moved to the DontDestoryOnLoad
section of your Unity scene when play mode begins.
Authentication
You will need to authenticate before starting any streams. This process is normally started automatically when leaving the Authenticate On Awake
checkbox active. Otherwise you will have to call Authenticate
and wait for the process to complete.
Streaming and Recording
Streaming is as simple as calling StartStreaming
, and stopping is just the same by calling StopStreaming
. Note that you will not be able to start or stop streaming unless you have
You can start and stop recording by calling StartRecording
and StopRecording
respectively. Note that you will not be able to start or stop recording unless you are already streaming.
Streaming To Other Platforms
For more information please see our Streaming Platforms docs
Beam Unity Events
The Beam Unity Events component makes it easy to monitor when authentication and streaming events happen. These events update as your sessions change, making it significantly easier to deal with new streams.
It is recommended that you attach your logic to these events, rather than constantly requesting the information from the streaming manager.
Most of the events are self explanatory, such as OnStreamStarted, but a few are worth noting.
Platform Status Changed
This fires out a StreamPlatform
object that you can use to see which external platforms the user has started or stopped streaming to. This is only fired when the StartSocialStream
or StopSocialStream
functions are called. It will not be called when initially starting a fresh stream, you will need to access the SessionState.StreamPlatforms
variable.
Authentication Changed Event
This fires when you are initially trying to login to an experience and an account.
When you initially start it will be NotAuthenticated
.
If you try to authenticate but there are no experience key or secret set, or the user fails to login, then it will change to Error
.
Authenticating
is when the user is trying to login but has not yet done so. The user code will be available to show.
Authenticated
is when the user has successfully logged in and is ready to start streaming.