Hyperbeam.cs
The top level object for the Hyperbeam API. This is responsible for calling into the Hyperbeam JSLib and controlling the browser. It is not recommended to instantiate this directly, instead it is preferable to call HyperbeamController.StartHyperbeamStream and then access these methods using it’s Instance property.
Properties
Sets the stream’s volume in a range of [0, 1]
Methods
GetHyperbeamTexture
IEnumerator GetHyperbeamTexture(Action<Texture2D> callback)
A coroutine to be invoked by MonoBehaviour.StartCoroutine
it will check once
every frame for a texture to be available. When one is found, or if one already exists, calls callback
Method Params
GetTexttureWidth
int GetTextureWidth()
Gets the virtual browser’s width in pixels.
GetTextureHeight
int GetTextureHeight()
Gets the virtual browser’s height in pixels.
SendKeyDown
void SendKeyDown(char Key, bool Ctrl, bool Meta)
Sends a keydown event to the virtual browser.
Method Params
SendKeyUp
void SendKeyUp(char Key, bool Ctrl, bool Meta)
Sends a keyup event to the virtual browser.
Method Params
SendMouseDown
void SendMouseDown(float X, float Y, PointerEventData.InputButton button)
Sends a mousedown event to the virtual browser.
Method Params
SendMouseUp
void SendMouseUp(float X, float Y, PointerEventData.InputButton button)
Sends a mouseup event to the virtual browser.
Method Params
SendMouseMove
void SendMouseMove(float X, float Y)
Sends a mousemove event to the virtual browser.
Method Params
SendWheel
void SendWheel(float DeltaY)
Sends a mouse wheel event to the virtual browser.
Method Params
SetVideoPause
void SetVideoPause(bool pause)
Pauses or unpauses the video stream. While the video stream is paused it is not sending any data, saving on CPU and Bandwidth. Prefer to use HyperbeamController.Paused where you can as it can be queried easier.
Method Params
GiveHyperbeamControl
void GiveHyperbeamControl(string closeKey, bool ctrl, bool meta, bool alt, bool shift)
This will inform hyperbeam it has ‘control’ of the browser and make it register event listeners for keypresses. Prefer to use HyperbeamController.PassControlToBrowser because it first tells unity to stop listening and will avoid registering multiple listeners.
Method Parameters
TakeBackControl
void TakeBackControl()
Forcibly takes control back from the browser and unregisters any event listeners that may have been registered by Hyperbeam.