Setup Streaming Package
Head over to our GitHub to obtain the latest version of the BeamXR Streaming package.
This is our core package, designed to have minimal impact on your project. It has very few special requirements and should quite happily sit alongside your current work.
Installing the Package
You can either install the package as an embedded package or by adding the package from disk via the Unity Package Manager.
Embedded Install
Simply extract the latest BeamXR Streaming package zip file into the Packages folder of your Unity project.
Unity will automatically find the package and install it as necessary.
Package From Disk Install
- Open the Unity Package Manager (
Window > Package Manager
) - Click the plus in the top left and select
Add package from disk...
- Locate the BeamXR Streaming package on your drive and click the package.json file
- Press open and wait as Unity imports the package
You can reference the package with a relative path by modifying the manifest.json
file within your project's Packages
folder.
Adding Scene Prefabs
When the package is installed, you will see a new BeamXR
menu in your Unity window.
You can quickly add the required prefabs to your scene by navigating to BeamXR > Prefabs > Core > Add Streaming Prefab
This will add both the BeamXR Streaming Manager
and BeamXR Streaming Camera
to your scene. Both of these are the bare minimum required for using BeamXR.
Streaming Manager Setup
The Streaming Manager is the heart of the BeamXR system. It controls everything from starting streams, to reporting statuses, to account authentication.
You will need to add your Experience Key
and Experience Secret
, from the account setup process, to your manager before you can start streaming.
The Streaming Manager is bundled alongside a BeamUnityEvents
script, which should provide every type of event you should need within your game. It is highly recommended to subscribe to these events, instead of repeatedly polling the manager.
For a more detailed overview and explanation of the Streaming Manager, please refer to it's dedicated page. SDK Guides > Core > Streaming Manager
Streaming Camera Setup
The Streaming Camera controls the rendering and output of your project. It is unlikely that you will need to change many of the options on this, however, you may like to modify the field of view, or other settings, to your taste.
Assigning a transform to follow will cause the camera to, unsurprisingly, follow said transform.
The streaming camera only renders when requested for performance reasons, and will render at the frame rate specified in the Streaming Manager.
For a more detailed overview and explanation of the Streaming Camera, please refer to it's dedicated page. SDK Guides > Core > Streaming Camera
Camera Controller
It is highly recommended to make use of the Camera Controller
that can pair with the Streaming Camera. It can be added to your scene via the BeamXR menu, at BeamXR > Prefabs > Core > Add Camera Controller
. It will automatically take control of your Streaming Camera when placed within your scene.
The Camera Controller provides multiple, easy ways of creating complex and intricate camera controls. It provides functionality such as: preset camera angles, camera smoothing, player following, player targeting, height adjustments, and many more!
For a more detailed overview and explanation of the Camera Controller, please refer to it's dedicated page. SDK Guides > Core > Camera Controller
Your First Stream
Now that you've got everything else sorted, you're ready to hop into play mode and try streaming!
The first time you enter play mode, you will be asked to sign into your BeamXR account. To do this you can simply follow the instructions in the inspector to open your browser window. This is done per device/player and the details are stored between play modes.
The same authorisation steps are required by your players. You can provide a quick access URL that works with the headset's built in web browser by accessing the BeamStreamingManager.Instance.DeviceFlowCode.VerificationUrlComplete
Once you are logged in, you can simply press the Start Streaming
button to start your stream!
...and it's as simple as that! If you're looking for a more feature rich experience, continue on to the next page to learn about the Director Kit!