Skip to main content

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 Changed and 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 Inputs component will be enabled if present.
    • Does nothing while the TV is loading.
  • EndEditUrlInput

    • This event is designed to be used with the input fields UI event On End Edit and 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 UpdateMedia will be used (see below for more details).
  • 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 _ChangeMedia api 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.
  • 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.

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._Play
  • Pause -> tv._Pause
  • Stop -> tv._Stop
  • Skip -> tv._Skip
  • ReSync -> tv._ReSync
  • ToggleSync -> tv._ToggleSync
  • ToggleLoop -> tv._ToggleLoop
  • RefreshMedia -> tv._RefreshMedia
  • ToggleAudioMode -> tv._ToggleAudioMode
  • ToggleColorCorrection -> tv._ToggleColorCorrection
  • ToggleMute -> tv._ToggleMute
  • ToggleLock -> tv._ToggleLock
  • ToggleUrlMode -> tv._UseMainUrl or tv._UseAlternateUrl depending on the component's state.

These events do not have a corresponding inspector component:

  • SeekForward -> tv._SeekForward This event implicitly seeks 10 seconds forward.
  • SeekBackward -> tv._SeekBackward This event implicitly seeks 10 seconds backwards.
  • Toggle3DWidth -> tv._Toggle3DWidth
  • UseMainUrl -> tv._UseMainUrl
  • UseAlternateUrl -> 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 Change and will be automatically assigned to the respective components on build/play.
    • This event calls the _ChangeSeekTime API 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.
  • ChangeSeekOffset

    • This event is designed to be used with the slider UI event On Value Change and will be automatically assigned to the respective components on build/play.
    • This event calls the _ChangeSeekOffset API 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.
  • ChangeVolume

    • This event is designed to be used with the slider UI event On Value Change and will be automatically assigned to the respective components on build/play.
    • This event calls the _ChangeVolume API 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.
  • ChangeVideoPlayer

    • This event is designed to be used with the dropdown UI event On Value Changed and will be automatically assigned to the respective components on build/play.
    • This event calls the _ChangeVideoPlayer API 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.
  • Change3DMode

    • This event is designed to be used with the dropdown UI event On Value Changed and will be automatically assigned to the respective components on build/play.
    • This event calls the _Change3DMode API whenever the dropdown selection has been changed.
  • ChangePlaybackSpeed

    • This event is designed to be used with the slider UI event On Value Change and will be automatically assigned to the respective components on build/play.
    • This event calls the _ChangePlaybackSpeed 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 since it's modifying synced data on the TV.
  • ResetPlaybackSpeed

    • This event will restore the playback speed to realtime (aka value of 1)

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).