Class Core
The "Brain" of the VizVid video player.
public class Core : UdonSharpEventSender, IVizVidCompoonent
- Inheritance
-
Core
- Implements
Fields
author
The author of the video. This may be custom assigned or fetched from the video. Directly setting this value is unsupported, use SetTitle(string, string) instead.
[NonSerialized]
public string author
Field Value
description
Description of the video. This is fetched from the video. Directly setting this value is unsupported.
[NonSerialized]
public string description
Field Value
title
The title of the video. This may be custom assigned or fetched from the video. Directly setting this value is unsupported, use SetTitle(string, string) instead.
[NonSerialized]
public string title
Field Value
viewCount
View count of the video. This is fetched from the video. Directly setting this value is unsupported.
[NonSerialized]
public string viewCount
Field Value
Properties
ActivePlayer
The current active player backend.
public byte ActivePlayer { get; }
Property Value
Remarks
It is 1-based, 0 means no active player.
AltUrl
The URL for alternative platform. (Quest URL when on PC, vice versa)
public VRCUrl AltUrl { get; }
Property Value
- VRCUrl
AudioLink
The AudioLink component.
public UdonSharpBehaviour AudioLink { get; }
Property Value
- UdonSharpBehaviour
Duration
The duration of the video in seconds.
public float Duration { get; }
Property Value
Remarks
If it is a live stream, this value will be infinity.
IsAVPro
Is current backend an AVPro backend.
public bool IsAVPro { get; }
Property Value
Remarks
This indicates the video texture might be flipped.
IsLoading
Is the player currently loading a video.
public bool IsLoading { get; }
Property Value
IsPaused
Is the video currently paused.
public bool IsPaused { get; }
Property Value
IsPlaying
Is the video currently playing.
public bool IsPlaying { get; }
Property Value
IsReady
Is the video loaded and ready to play.
public bool IsReady { get; }
Property Value
IsStatic
Is the player showing a static image instead of a video.
public bool IsStatic { get; }
Property Value
IsSynced
Is the player synced in the instance.
public bool IsSynced { get; }
Property Value
IsTrusted
Is current loaded URL trusted by VRChat.
public bool IsTrusted { get; }
Property Value
Remarks
If it is false, it might need to notify the user to enable "Allow untrusted URLs" in the settings.
The list of trusted URLs will be updated upon building the world.
LastActivePlayer
The last active player backend.
public byte LastActivePlayer { get; }
Property Value
Remarks
It is 1-based, 0 means no active player.
LastAltUrl
The last URL for alternative platform. (Quest URL when on PC, vice versa)
public VRCUrl LastAltUrl { get; }
Property Value
- VRCUrl
LastError
The last error occurred.
public VideoError LastError { get; }
Property Value
- VideoError
LastUrl
The URL previously loaded.
public VRCUrl LastUrl { get; }
Property Value
- VRCUrl
Loop
Should the player repeat the video when it ends.
public bool Loop { get; set; }
Property Value
Muted
Whether the audio is muted.
public bool Muted { get; set; }
Property Value
Performer
Gets the performer of the video player playback.
public VRCPlayerApi Performer { get; }
Property Value
- VRCPlayerApi
PlayerNames
The video player backend names.
public string[] PlayerNames { get; }
Property Value
- string[]
Progress
The playback progress of the video, from 0 to 1.
public float Progress { get; set; }
Property Value
Remarks
If it is a live stream, this value will be zero, and setting this value will have no effect.
Speed
The playback speed of the video.
public float Speed { get; set; }
Property Value
Remarks
The value will be clamped between 0.1 and 2.
State
The player state.
public byte State { get; }
Property Value
Remarks
0: Idle, 1: Loading, 2: Error, 3: Ready, 4: Playing, 5: Paused
SupportSpeedAdjustment
Is current video player backend support speed adjustment.
public bool SupportSpeedAdjustment { get; }
Property Value
SyncOffset
The offset of the video time to other players, in seconds.
public float SyncOffset { get; set; }
Property Value
Time
The current time of the video in seconds.
public float Time { get; }
Property Value
Remarks
If it is a live stream, this value will be zero.
Url
The current loaded URL.
public VRCUrl Url { get; }
Property Value
- VRCUrl
VideoTexture
The texture of the video.
public Texture VideoTexture { get; }
Property Value
- Texture
Volume
The volume of the audio.
public float Volume { get; set; }
Property Value
Methods
GetScreenFloatExtra(int)
Get the shader property of the screen.
public float GetScreenFloatExtra(int id)
Parameters
idintThe ID of the property. This is obtained by VRCShader.PropertyToID(string)
Returns
- float
The value of the property.
GetSuitablePlayerType(VRCUrl)
Determine the suitable player backend for the given URL.
public byte GetSuitablePlayerType(VRCUrl url)
Parameters
urlVRCUrlThe URL to be checked.
Returns
- byte
The player backend index, 0 means no suitable player backend.
Remarks
This will not actually load the URL, it only checks the URL.
GlobalSync()
Force every client to reload the current URL. This is meant to be called by the user interaction.
public void GlobalSync()
LocalSync()
Reload the current URL. This is meant to be called by the user interaction.
public void LocalSync()
Remarks
When this method is invoked twice in a short time, it will request the owner to sync the player.
OnDeserialization(DeserializationResult)
Event entry point when the video player is synchronized from the owner. Internal use, do not invoke this.
public override void OnDeserialization(DeserializationResult result)
Parameters
resultDeserializationResult
OnOwnershipTransferred(VRCPlayerApi)
Event entry point on the ownership of the video player is transferred. Internal use only. Do not call this method.
public override void OnOwnershipTransferred(VRCPlayerApi player)
Parameters
playerVRCPlayerApi
OnPreSerialization()
Event entry point when the video player is about to synchronize. Internal use, do not invoke this.
public override void OnPreSerialization()
OnVideoEnd()
Event entry point from video backend when the video finishes. Internal use, do not invoke this.
public override void OnVideoEnd()
OnVideoError(VideoError)
Event entry point when the video backend encounters an error. Internal use, do not invoke this.
public override void OnVideoError(VideoError videoError)
Parameters
videoErrorVideoError
OnVideoLoop()
Event entry point from video backend when the video loops. Internal use, do not invoke this.
public override void OnVideoLoop()
OnVideoPause()
Event entry point from video backend when the video is paused. Internal use, do not invoke this.
public override void OnVideoPause()
OnVideoPlay()
Event entry point from video backend when the video starts playing. Internal use, do not invoke this.
public override void OnVideoPlay()
OnVideoReady()
Event entry point from video backend when the video is ready. Internal use, do not invoke this.
public override void OnVideoReady()
OnVideoStart()
Event entry point from video backend when the video is started. Internal use, do not invoke this.
public override void OnVideoStart()
Pause()
Pause the current video.
public void Pause()
Play()
Play the current video.
public void Play()
PlayUrl(VRCUrl, byte)
Play the given URL.
public void PlayUrl(VRCUrl url, byte playerType)
Parameters
urlVRCUrlThe URL to be played.
playerTypebyteThe player backend index, 0 means no suitable player backend.
PlayUrl(VRCUrl, VRCUrl, byte)
Play the given URL.
public void PlayUrl(VRCUrl pcUrl, VRCUrl questUrl, byte playerType)
Parameters
pcUrlVRCUrlThe URL for PC platform.
questUrlVRCUrlThe URL for Quest (mobile) platform.
playerTypebyteThe player backend index, 0 means no suitable player backend.
PlayUrlMP(VRCUrl, VRCUrl, byte)
[Obsolete("Use PlayUrl(VRCUrl, VRCUrl, byte) instead.")]
public void PlayUrlMP(VRCUrl pcUrl, VRCUrl questUrl, byte playerType)
Parameters
pcUrlVRCUrlquestUrlVRCUrlplayerTypebyte
SetOwnPerformer(bool)
Let current user be the performer of current video player playback. (Experimental)
public void SetOwnPerformer(bool enable)
Parameters
enableboolEnable or disable the performance mode.
Remarks
Video playback time will be auto adjusted to cancel-out the latency between the performer and audience (other users).
SetScreenFloatExtra(int, float)
Set the shader property of the screen.
public void SetScreenFloatExtra(int id, float value)
Parameters
idintThe ID of the property. This is obtained by VRCShader.PropertyToID(string)
valuefloatThe value of the property.
SetTitle(string, string)
Sets the title and author of the video to be displayed.
public void SetTitle(string title, string author)
Parameters
Stop()
Stop the current video.
public void Stop()
_PlayDefaultUrl()
Play the default URL.
public void _PlayDefaultUrl()
_ReloadUrl()
Reload the current URL.
public void _ReloadUrl()
_RequestOwnerSync()
Request the owner to synchronize the video player state.
public void _RequestOwnerSync()
Remarks
If synchronization is disabled, this method will have no effect.
_ResetTitle()
Clears the custom displayed title and author of the video.
public void _ResetTitle()