Class VisionOSVideoComponent
A custom component to provide video capabilities to a target platform.
Inherited Members
Namespace: Unity.PolySpatial
Assembly: Unity.PolySpatial.dll
Syntax
[DisallowMultipleComponent]
public class VisionOSVideoComponent : MonoBehaviour
Properties
Clip
The video asset to play.
Declaration
public VideoClip Clip { get; set; }
Property Value
Type | Description |
---|---|
VideoClip |
IsLooping
Whether the video should repeat when playback reaches the end of the clip.
Declaration
public bool IsLooping { get; set; }
Property Value
Type | Description |
---|---|
bool |
PlayOnAwake
Whether video clip should play on awake.
Declaration
public bool PlayOnAwake { get; set; }
Property Value
Type | Description |
---|---|
bool |
TargetMaterialRenderer
The mesh renderer on which the video should render. Overwrites the current material on the renderer.
Declaration
public MeshRenderer TargetMaterialRenderer { get; set; }
Property Value
Type | Description |
---|---|
MeshRenderer |
Methods
GetDirectAudioMute(ushort)
Gets the mute status of first track on the video clip.
Declaration
public bool GetDirectAudioMute(ushort trackIndex)
Parameters
Type | Name | Description |
---|---|---|
ushort | trackIndex | The track index (indices greater than 0 not supported). |
Returns
Type | Description |
---|---|
bool | The mute status of first track on the video clip. |
GetDirectAudioVolume(ushort)
Gets the volume of the first track on the video clip.
Declaration
public float GetDirectAudioVolume(ushort trackIndex)
Parameters
Type | Name | Description |
---|---|---|
ushort | trackIndex | The track index (indices greater than 0 not supported). |
Returns
Type | Description |
---|---|
float | The volume between 0.0 and 1.0 |
GetState()
Obtain the current play state of the video player.
Declaration
public VisionOSVideoComponent.PlayerState GetState()
Returns
Type | Description |
---|---|
VisionOSVideoComponent.PlayerState | The player state. |
Pause()
Pauses the playback of the video.
Declaration
public void Pause()
Play()
Starts playback of the video.
Declaration
public void Play()
SetDirectAudioMute(ushort, bool)
Sets the mute state of the first track on the video clip.
Declaration
public void SetDirectAudioMute(ushort trackIndex, bool mute)
Parameters
Type | Name | Description |
---|---|---|
ushort | trackIndex | The track index (indices greater than 0 not supported). |
bool | mute | The mute state to set. |
SetDirectAudioVolume(ushort, float)
Sets the volume of the first track on the video clip.
Declaration
public void SetDirectAudioVolume(ushort trackIndex, float volume)
Parameters
Type | Name | Description |
---|---|---|
ushort | trackIndex | The track index (indices greater than 0 not supported). |
float | volume | The volume to set between 0.0 and 1.0. |
Stop()
Stops the playback of the video.
Declaration
public void Stop()