Skip to main content

TVManager Scripting API

Methods/Events

The following is the list of events that any behavior may call to modify the TV's state (they ALL start with an underscore _):

  • _ChangeMedia
    • The main workhorse event that handles loading whatever media is needed to be loaded (either media swap or refreshing the current one)
    • Variables used for input data: IN_MAINURL, IN_ALTURL, IN_TITLE
    • If neither IN_MAINURL nor IN_ALTURL nor IN_TITLE are present, then the event will treat it as a local media refresh and won't take ownership.
    • If either urls are present, ownership will be taken unless enabled security measures are triggered.
    • If only IN_TITLE is present, it will simply update that data.
    • If the tv is locked and the user does not match the requisite permissions, the event will purge IN_MAINURL, IN_ALTURL and IN_TITLE, and simply treat the event call as a local refresh.
  • _ChangeMedia(VRCUrl, VRCUrl, string)
    • UdonSharp only equivalent of the combination of IN_MAINURL, IN_ALTURL, IN_TITLE and _ChangeMedia
    • To update just the title without modifying the urls, do _ChangeMedia(null, null, "My new title")
  • _ChangeVideoPlayer
    • This event handles the swapping of the video player configurations defined by the TV.
    • Variable used for input data: IN_VIDEOPLAYER
    • The variable is a 0-index array value (first entry is the value 0) representing a particular item in the TV's Video Managers list.
  • _ChangeVideoPlayer(int)
    • UdonSharp only equivalent of the combination of IN_VIDEOPLAYER and _ChangeVideoPlayer
  • _TogglePlay
    • Swaps between playing and pausing the media.
    • If the media is stopped, this event will trigger a media refresh to start it up.
  • _Play
    • This event causes the current media to either start or resume, depending on the TV's current state.
  • _Pause
    • This event causes the current media to suspend if there is one playing.
  • _Stop
    • This event halts any currently playing media.
  • _Skip
    • This event force triggers the current playing media to end.
    • This will trigger the _TvPause and _TvMediaEnd events.
  • _UseMainUrl
    • Force the local user to use the main url instead of the alternate one.
  • _UseAlternateUrl
    • Force the local user to use the alternate url instead of the main one.
  • _ToggleUrlMode
    • Swap the user between using the alternate and main urls.
  • _ChangeUrlMode(bool)
    • Explicitly specify which url mode to use (true is using alternate url)
  • _Mute
    • This event disables any audio output from the TV.
  • _UnMute
    • This event enables any audio output from the TV.
  • _ToggleMute
    • This event swaps the state of the audio outputs from the TV.
  • _ChangeMute(bool)
    • UdonSharp only method that updates the state of the audio outputs from the TV, based on the provided bool parameter.
  • _ChangeVolume
    • This event handles updating the volume of the TV.
    • Variable used for input data: IN_VOLUME
    • The variable is a float that expects a value between 0.0f and 1.0f (representing a percent of the max volume)
  • _ChangeVolume(float)
    • UdonSharp only equivalent of the combination of IN_VOLUME and _ChangeVolume
  • _ToggleVideoForce2d
    • This event swaps the flag that tells shaders whether they should be allowed to show 3D or only 2D content.
  • _AudioMode3d
    • This event switches any audio outputs from a stereo mode, to a positional audio mode.
  • _AudioMode2d
    • This event switches any audio outputs from a positional audio mode, to a stereo mode.
  • _ToggleAudioMode
    • This event swaps the audio output mode between positional and stereo, based on it's current value.
  • _ChangeAudioMode(bool)
    • UdonSharp only method that updates the mode of the audio outputs, based on the provided bool parameter.
    • If the bool is true, the audio is positional (3d). If false, the audio is stereo (2d).
  • _ReSync
    • This event makes the TV recalculate the local play time from the synced owner playtime.
    • Media (especially long-form) can some times drift from their synced time. This helps mitigate that issue.
  • _Sync
    • This event forces the TV to conform to any synchronized data changes.
    • When in this state, the TV will always attempt to adjust itself so that it stays in sync with the current TV owner.
  • _DeSync
    • This event forces the TV to ignore any synchronized data changes
    • This only applies to non-owners. It can allow viewers to watch the media at their own pace. For example if someone has to step away for a moment, they could de-sync and then pause the media. Then when they come back, they can choose to re-sync with the owner, or continue watching from where the left off.
  • _ToggleSync
    • This event swaps the sync flag to the opposite of its current state.
  • _ChangeSync(bool)
    • UdonSharp only method that updates the sync flag based on the provided bool parameter.
  • _LoopStart
    • This event enables the TV's media looping logic.
  • _LoopStop
    • This event disables the TV's media looping logic.
  • _ToggleLoop
    • This event swaps the media looping logic between enabled and disabled.
  • _ChangeLoop(bool)
    • UdonSharp only method that updates the enabled state of the media looping logic.
  • _ChangeSeekPercent
    • This event updates the current time of the actively playing media.
    • The variable is a float that expects a value between 0.0f and 1.0f (representing a percent of the total media duration)
    • Commonly updated via some sort of slider.
    • Variable used for input data: IN_SEEK
  • _ChangeSeekPercent(float)
    • UdonSharp only equivalent of the combination of IN_SEEK and _ChangeSeekPercent
  • _ChangeSeekTime
    • This event updates the current time of the actively playing media.
    • Expects a float representing the time in seconds to seek the media to.
    • Variable used for input data: IN_SEEK
  • _ChangeSeekTime(float)
    • UdonSharp only equivalent of the combination of IN_SEEK and _ChangeSeekTime
  • _ChangeSeekPercent
    • This event updates the current time of the actively playing media based on the percent value passed.
    • Variable used for input data: IN_SEEK
    • Expects a normalized 0 to 1 float value representing the point in the media to skip to.
    • This is primarily useful for UI sliders to control the seek position.
  • _ChangeSeekPercent(float)
    • UdonSharp only equivalent of the combination of IN_SEEK and _ChangeSeekPercent
  • _SeekForward
    • This event implicitly fast-forwards the seek time by 10 seconds.
  • _SeekBackward
    • This event implicitly rewinds the seek time by 10 seconds.
  • _ChangeSeekOffset
    • This event sets the local playback offset from the canonical playback time.
    • Positive value plays ahead (typically used for karaoke singers)
    • Negative value plays behind (like if a listener hears the karaoke singer too late and wants to correct for that)
    • This works even if you are the owner of the TV.
    • Variable used for input data: IN_SEEK
  • _ChangeSeekOffset(float)
    • UdonSharp only equivalent of the combination of IN_SEEK and _ChangeSeekOffset
  • _ChangePlaybackSpeed
    • This event sets the local playback speed of the selected video manager (engine).
    • Allows values between half-speed 0.5f and double-speed 2f.
    • Variable used for input data: IN_SPEED
  • _ChangePlaybackSpeed(float)
    • UdonSharp only equivalent of the combination of IN_SPEED and _ChangePlaybackSpeed
  • _ResetPlaybackSpeed
    • This event returns the playback speed to normal speed 1f.
  • _Lock
    • This event tells the TV to only allow the instance master to manage the sync data (media swapping/synced seeking)
    • This event implicitly assigns the instance master as the TV owner.
  • _UnLock
    • This event tells the TV to allow anyone to manage the sync data (media swapping/synced seeking)
  • _ToggleLock
    • This event swaps the locked state of the TV to the opposite of its current state.
    • This event will ignore any calls to it that aren't from the instance master.
  • _ChangeLock(bool)
    • UdonSharp only method that updates the locked state based on the bool parameter.
    • This method will ignore any calls to it that aren't from the instance master.
  • _EnableInteractions
    • This event will run through all its listeners and attempt to find all UIShapes' colliders and re-enable them.
    • This restores intractability with the given UI elements that the UIShapes are connected to.
  • _DisableInteractions
    • This event will run through all its listeners and attempt to find all UIShapes' colliders and disable them.
    • This halts intractability with the given UI elements that the UIShapes are connected to preventing the player from clicking on anything in them.
  • _ToggleInteractions
    • This event swaps back and forth between _EnableInteractions and _DisableInteractions.
    • Easy to use with a UI button or custom interact script.
  • _ChangeInteractions(bool)
    • UdonSharp only method that updates the interaction state for associated plugins.
  • _EnableVideoTexture
    • This event causes the TV to enable rendering the video engine texture to the rendering outputs.
    • This is on by default.
  • _DisableVideoTexture
    • This event causes the TV to skip rendering the video engine texture to the rendering outputs.
    • Will cause any fallback images to be displayed instead (if available).
  • _ToggleVideoTexture
    • This event swaps back and forth between _EnableVideoTexture and _DisableVideoTexture.
    • Easy to use with a UI button or custom interact script.
  • _EnableGlobalTexture
    • This event tells teh TV to render the _Udon_VideoTex texture reference to enable access from avatars.
    • This is typically enabled by default.
    • Global texture should only ever be active on one TV instance at a time.
  • _DisableGlobalTexture
    • This event tells the TV to stop rendering the _Udon_VideoTex texture reference to disable access from avatars.
  • _ToggleGlobalTexture
    • This event swaps back and forth between _EnableGlobalTexture and _DisableGlobalTexture.
    • Easy to use with a UI button or custom interact script.
  • _IsManagedSpeaker(AudioSource)
    • UdonSharp only helper method to know whether a given AudioSource is considered to be managed by the TV.
    • It will check against all connected VPManagers, regardless of state.

Inherited from ArchiTech.SDK

  • _RegisterListener
    • This event assigns a given behavior as a listener of the TV.
    • Variables used for input data: IN_LISTENER and IN_PRIORITY
    • This event should be called during the Start event phase of a behavior and should simply assign the behavior's own reference to the IN_LISTENER variable along with optionally setting the IN_PRIORITY variable to a number between -128 and 127 inclusively, where -128 is the highest priority. 0 is the default.
    • An example is available in the Plugins Documentation page.
  • _RegisterListener(UdonSharpBehaviour)
    • UdonSharp only equivalent of the combination of IN_LISTENER and _RegisterListener
    • This is generally done like this: tv._RegisterListener(this);
    • The method itself will convert it to a standard UdonBehavior, so don't worry about that.
    • The priority defaults to 0 when using this method.
  • _RegisterListener(UdonSharpBehaviour, sbyte)
    • UdonSharp only equivalent of the combination of IN_LISTENER, IN_PRIORITY and _RegisterListener
    • This is generally done like this: tv._RegisterListener(this, 10);
    • The method itself will convert it to a standard UdonBehavior, so don't worry about that.
    • The priority is a number between -128 and 127 inclusively, with 127 being the highest priority.
  • _UnregisterListener
    • This event directly removes the UdonBehaviour from the registered listeners.
    • Variables used for input data: IN_LISTENER
    • The behaviour will no longer receive events and must be re-registered to restore event reception.
  • _UnregisterListener(UdonSharpBehaviour)
    • UdonSharp only equivalent of the combination of IN_LISTENER and _UnregisterListener
  • _DisableListener
    • This event flags a specific registered behaviour as to be muted, ie. it will not receive any events from the TV.
    • This keeps the listener as connected to the tv, but ignores the events.
    • Variables used for input data: IN_LISTENER
  • _DisableListener(UdonSharpBehaviour)
    • UdonSharp only equivalent of the combination of IN_LISTENER and _DisableListener
  • _EnableListener
    • This event flags a specific registered behaviour as to be un-muted, ie. it will resume receiving the events from the TV.
    • Variables used for input data: IN_LISTENER
  • _EnableListener(UdonSharpBehaviour)
    • UdonSharp only equivalent of the combination of IN_LISTENER and _EnableListener