Skip to content

API References

kteem edited this page Apr 15, 2018 · 1 revision

Only MonoBehaviour component you have to add to your scene. Attached to the Unity's main VR camera, it instantiates all fundamental components including input device handlers and onAirVR audio source.

Fields On Inspector

Enable Audio : bool
  • If true, instantiates a 2D stereo audio source which plays audio data from onAirVR Server.
Audio Mixer Group : UnityEngine.Audio.AudioMixerGroup
  • Routes audio data of the onAirVR audio source which is created when Enable Audio is true, to a Unity's audio mixer group.
Arm Model : GvrArmModel
  • Must set the arm model component of Google VR controller in the scene so that onAirVR calculates its pose.

Fundamental component responsible for onAirVR client startup/shutdown and session connection/playback.

Static Variables

AirVRClient.EventHandler Delegate
  • Instance of interface through which events are notified

bool connected
  • True if the onAirVR client session is being connected.

bool playing
  • True if the onAirVR client session is receiving video/audio streaming from onAirVR Server.
Static Functions

void Connect(string address, int port, string userID = "")
  • Requests to connect to an onAirVR Server content program.
  • Parameters
    • address : IP Address of the PC where the onAirVR Server program is running
    • port : Port number of the onAirVR Server program
    • userID : identification data onAirVR Server can refer. See Best Practices of onAirVR Server documentation to know how to use in detail.

void Play()
  • Requests to start video/audio streaming from the connected onAirVR Server.

void Stop()
  • Requests to stop video/audio streaming from the connected onAirVR Server.

void Disconnect()
  • Requests to disconnect the current onAirVR client session.

Interface through which AirVRClient events are notified. You might implement this interface and set to AirVRClient.Delegate to do something for events on client errors or connection/playback states. The below figure describes which events are occurred when in AirVRClient.

Figure 6.

Public Functions

void AirVRClientFailed(string reason)
  • Called when onAirVR Client fails to startup
  • Parameters
    • reason : reason why startup is failed

void AirVRClientConnected()

void AirVRClientPlaybackStarted()
  • Called when starting video/audio streaming from onAirVR Server is successfully requested. Occurs after AirVRClient.Play().

void AirVRClientPlaybackStopped()
  • Called when stopping video/audio streaming from onAirVR Server is successfully requested. Occurs after AirVRClient.Stop().

void AirVRClientDisconnected()
  • Called when onAirVR client session is disconnected.