TVManager Scripting API
Methods/Events
The following is the list of events/U# Methods exposed by MediaControls that UI components can interact with (these events do NOT have an underscore _):
UpdateUrlInput- This event is designed to be used with the input fields UI event
On Value Changedand will be automatically assigned to the respective components on build/play. - This event checks for the content of each of the input fields and if anything has content, the
Send Inputscomponent will be enabled if present. - Does nothing while the TV is loading.
- This event is designed to be used with the input fields UI event
EndEditUrlInput- This event is designed to be used with the input fields UI event
On End Editand will be automatically assigned to the respective components on build/play. - This event has the following conditions:
- If there is only one input field connected to the component, upon finishing the input, it will automatically submit the data to the TV.
- If more than one input field is connected, finishing the input won't do anything UNLESS:
- The input field was finished by pressing the ENTER key via
ChangeMedia(see below for more details). - If the SHIFT key is also pressed, then
UpdateMediawill be used (see below for more details).
- The input field was finished by pressing the ENTER key via
- This event is designed to be used with the input fields UI event
ChangeMedia- This event will capture each input fields contents, validate either URLs present against the TV's domain whitelist as a pre-check, and then submits those values to the TV's
_ChangeMediaapi if the URLs pass the pre-check. - If ONLY a title is provided, it will trigger the TV to only update the title info without swapping the URL.
- This event will capture each input fields contents, validate either URLs present against the TV's domain whitelist as a pre-check, and then submits those values to the TV's
UpdateMedia- This event is similar to
ChangeMedia, with the difference being that if any of the input fields are left empty, they will be filled with the existing respective data from the TV.
- This event is similar to
The following events are button proxies that just call their respective TV APIs.
These are automatically assigned to their respective components connected in the inspector on build/play:
Play->tv._PlayPause->tv._PauseStop->tv._StopSkip->tv._SkipReSync->tv._ReSyncToggleSync->tv._ToggleSyncToggleLoop->tv._ToggleLoopRefreshMedia->tv._RefreshMediaToggleAudioMode->tv._ToggleAudioModeToggleColorCorrection->tv._ToggleColorCorrectionToggleMute->tv._ToggleMuteToggleLock->tv._ToggleLockToggleUrlMode->tv._UseMainUrlortv._UseAlternateUrldepending on the component's state.
These events do not have a corresponding inspector component:
SeekForward->tv._SeekForwardThis event implicitly seeks 10 seconds forward.SeekBackward->tv._SeekBackwardThis event implicitly seeks 10 seconds backwards.Toggle3DWidth->tv._Toggle3DWidthUseMainUrl->tv._UseMainUrlUseAlternateUrl->tv._UseAlternateUrl
The following events are data events for sliders/toggles/dropdowns:
ChangeSeek- This event is designed to be used with the slider UI event
On Value Changeand will be automatically assigned to the respective components on build/play. - This event calls the
_ChangeSeekTimeAPI once when the slider is grabbed and does not fire while moving the slider. It will fire once more upon release of the slider. - This helps mitigate spamming of the seek time change logic for performance.
- This event will only work for the TV Owner and those who are allowed to manipulate the active media.
- This event is designed to be used with the slider UI event
ChangeSeekOffset- This event is designed to be used with the slider UI event
On Value Changeand will be automatically assigned to the respective components on build/play. - This event calls the
_ChangeSeekOffsetAPI once when the slider is grabbed and does not fire while moving the slider. It will fire once more upon release of the slider. - This helps mitigate spamming of the seek time change logic for performance.
- This event is designed to be used with the slider UI event
ChangeVolume- This event is designed to be used with the slider UI event
On Value Changeand will be automatically assigned to the respective components on build/play. - This event calls the
_ChangeVolumeAPI once when the slider is grabbed. While moving the slider, it continues to call that API, but with a silence mode enabled. - This helps mitigate spamming of the seek time change logic for performance. It will fire once more with silence mode disabled upon release of the slider.
- This event is designed to be used with the slider UI event
ChangeVideoPlayer- This event is designed to be used with the dropdown UI event
On Value Changedand will be automatically assigned to the respective components on build/play. - This event calls the
_ChangeVideoPlayerAPI whenever the dropdown selection has been changed. - If for any reason the video player change fails, it will automatically revert to it's prior selected option.
- This event is designed to be used with the dropdown UI event
Change3DMode- This event is designed to be used with the dropdown UI event
On Value Changedand will be automatically assigned to the respective components on build/play. - This event calls the
_Change3DModeAPI whenever the dropdown selection has been changed.
- This event is designed to be used with the dropdown UI event
ChangePlaybackSpeed- This event is designed to be used with the slider UI event
On Value Changeand will be automatically assigned to the respective components on build/play. - This event calls the
_ChangePlaybackSpeedonce when the slider is grabbed and does not fire while moving the slider. It will fire once more upon release of the slider. - This helps mitigate spamming of the seek time change logic for performance.
- This event will only work for the TV Owner since it's modifying synced data on the TV.
- This event is designed to be used with the slider UI event
ResetPlaybackSpeed- This event will restore the playback speed to realtime (aka value of
1)
- This event will restore the playback speed to realtime (aka value of
Remaining miscellaneous events:
ToggleCurrentRemainingTime- This event swaps what kind of timestamp should be displayed in the currentTimeDisplay component.
- Swaps between the current timestamp (positive numbers) and the remaining time of the media (negative numbers).