Google.Cast.RemoteDisplay.CastRemoteDisplayManager

Entry point to the Google Cast Remote Display API for Unity.

Summary

Add only one of these to your scene as a top level game object.

Inheritance

Inherits from: MonoBehaviour

Public attributes

CastDevicesUpdatedEvent
Fired when the list of available cast devices has been updated.
CastVolumeUpdatedEvent
Fired when the cast device's volume has been updated.
RemoteDisplayErrorEvent
Fired when the remote display session encounters an error.
RemoteDisplaySessionEndEvent
Fired when the remote display session ends.
RemoteDisplaySessionStartEvent
Fired when the remote display session starts.

Properties

CastAppId
string
The remote display application ID.
Configuration
The configuration used to set up a remote display session when a cast device is selected.
RemoteAudioListener
AudioListener
Used to play audio on the remote display.
RemoteDisplayCamera
Camera
Used to render graphics on the remote display.
RemoteDisplayPausedTexture
Texture
Used to render graphics on the remote display when the application is paused or backgrounded.
RemoteDisplayTexture
Texture
Used to render graphics on the remote display.

Public static functions

GetInstance()
There should only be one DisplayManager in the scene at a time, this instance enforces that.

Public functions

GetCastDevices()
IList< CastDevice >
Returns the list of available cast devices for remote display.
GetCastVolume()
float
Returns the current volume on the Cast device, from 0.0 to 1.0, or -1.0 if an error has occurred.
GetLastError()
Returns the last error encountered by the Cast Remote Display Plugin, or null if no error has occurred.
GetSelectedCastDevice()
Returns the CastDevice selected for remote display.
IsCasting()
bool
Returns whether there is an active cast session.
SelectCastDevice(string deviceId)
void
Selects a cast device for remote display.
SetCastVolume(float volume)
void
Sets the current volume on the Cast device, from 0.0 to 1.0.
StopRemoteDisplaySession()
void
Stops the current remote display session.

Public attributes

CastDevicesUpdatedEvent

CastRemoteDisplayEvent CastDevicesUpdatedEvent

Fired when the list of available cast devices has been updated.

Call GetCastDevices() on the CastRemoteDisplayManager to get the actual list.

CastVolumeUpdatedEvent

CastRemoteDisplayVolumeEvent CastVolumeUpdatedEvent

Fired when the cast device's volume has been updated.

Takes two parameters, the CastRemoteDisplayManager , and the new volume, from 0.0 to 1.0.

RemoteDisplayErrorEvent

CastRemoteDisplayEvent RemoteDisplayErrorEvent

Fired when the remote display session encounters an error.

When this event is fired, the game object that owns this component will be disabled. Call GetLastError() to get information about the error that was fired.

RemoteDisplaySessionEndEvent

CastRemoteDisplayEvent RemoteDisplaySessionEndEvent

Fired when the remote display session ends.

RemoteDisplaySessionStartEvent

CastRemoteDisplayEvent RemoteDisplaySessionStartEvent

Fired when the remote display session starts.

Call GetSelectedDevice() on the CastRemoteDisplayManager to get the name of the selected cast device.

Properties

CastAppId

string CastAppId

The remote display application ID.

Configuration

CastRemoteDisplayConfiguration Configuration

The configuration used to set up a remote display session when a cast device is selected.

See SelectCastDevice() .

RemoteAudioListener

AudioListener RemoteAudioListener

Used to play audio on the remote display.

RemoteDisplayCamera

Camera RemoteDisplayCamera

Used to render graphics on the remote display.

Only used if RemoteDisplayTexture is not set.

RemoteDisplayPausedTexture

Texture RemoteDisplayPausedTexture

Used to render graphics on the remote display when the application is paused or backgrounded.

RemoteDisplayTexture

Texture RemoteDisplayTexture

Used to render graphics on the remote display.

If this is set, RemoteDisplayCamera will not be used.

Public static functions

GetInstance

CastRemoteDisplayManager GetInstance()

There should only be one DisplayManager in the scene at a time, this instance enforces that.

Public functions

GetCastDevices

IList< CastDevice > GetCastDevices()

Returns the list of available cast devices for remote display.

GetCastVolume

float GetCastVolume()

Returns the current volume on the Cast device, from 0.0 to 1.0, or -1.0 if an error has occurred.

GetLastError

CastError GetLastError()

Returns the last error encountered by the Cast Remote Display Plugin, or null if no error has occurred.

GetSelectedCastDevice

CastDevice GetSelectedCastDevice()

Returns the CastDevice selected for remote display.

IsCasting

bool IsCasting()

Returns whether there is an active cast session.

This will be set to true from the moment the RemoteDisplaySessionStartEvent() fires and until the session ends.

SelectCastDevice

void SelectCastDevice(
  string deviceId
)

Selects a cast device for remote display.

SetCastVolume

void SetCastVolume(
  float volume
)

Sets the current volume on the Cast device, from 0.0 to 1.0.

StopRemoteDisplaySession

void StopRemoteDisplaySession()

Stops the current remote display session.

This can be used in the middle of the game to let the user stop and disconnect and later select another Cast device.