/
Reference

Reference

Methods

MethodDescription
TouchCastPlayerAPI.embed()This method will allow you to embed players into any webpage.
TouchCastPlayerAPI.doAction()This method will allow you to control the player.
TouchCastPlayerAPI.Event.subscribe()This method will allow you to subscribe to a Player Api event, which will fire on different types of actions.
TouchCastPlayerAPI.Event.unsubscribe()This method will allow you to unsubscribe from any Player Api event you have previously subscribed.

Event Types

Click here to get more info about each event.

Event TypeDescription
TouchCastPlayerAPI.events.TOGGLE_SEARCH

The event is dispatched only in viewer mode. It dispatches when clicking on the search button in the player, when pressing the key combination COMMAND + F on a Mac or CTRL + F on a Win, calling the TOGGLE_SEARCH action. Use this to open/close a search popup in the article viewer.


TouchCastPlayerAPI.events.EMBED_PLAYER_ADDED_TO_DOMThis event is dispatched when an embed player was added to the DOM, but not yet fully initialized.
TouchCastPlayerAPI.events.EMBED_PLAYER_FULLY_READYThis event is dispatched when an embed player is fully initialized and ready to be used. At this stage is safe to use the TouchCastPlayerAPI.doAction() method.
TouchCastPlayerAPI.events.PLAYER_TIME_UPDATEThis event is dispatched during playback of an embed player. Use this to track playback time.
TouchCastPlayerAPI.events.PLAYER_VIDEO_ENDEDThis event is dispatched when an embed player has finised playback and reached video end.
TouchCastPlayerAPI.events.PLAYER_VIDEO_PLAYEDThis event is dispatched when an embed player has started playback, even if it's for the very first time or just a simple resume.
TouchCastPlayerAPI.events.PLAYER_VIDEO_PAUSEDThis event is dispatched when an embed player has finished playback and reached video end.
TouchCastPlayerAPI.events.INTERACTIVE_EVENT

This event is dispatched after interactive event in an embed player.

Has next field:

event: [string] name of interactive event

  possible values: one of  TouchCastPlayerAPI.interactiveType

  • TouchCastPlayerAPI.interactiveType.OPEN  Will dispatch whenever we click on a vApp.
  • TouchCastPlayerAPI.interactiveType.CLOSE  Will dispatch whenever we close a vApp (get out of PIP mode, TC inside TC or close a live vApp).
  • TouchCastPlayerAPI.interactiveType.FAIL  Will dispatch whenever we click on video area that has no vApp


mode: [string | null] open/close mode of interactive event

  possible values: one of TouchCastPlayerAPI.interactiveMode or null 

  • TouchCastPlayerAPI.interactiveMode.TCINTC
  • TouchCastPlayerAPI.interactiveMode.PIP
  • TouchCastPlayerAPI.interactiveMode.LIVE
  • TouchCastPlayerAPI.interactiveMode.NEWTAB
  • TouchCastPlayerAPI.interactiveMode.DOWNLOAD
  • TouchCastPlayerAPI.interactiveMode.FLOW
  • TouchCastPlayerAPI.interactiveMode.LIVE_AUTO

info: [Object | null] additional data about vapp

  possible values: Object or null 


TouchCastPlayerAPI.events.CONTROLS_EVENT

This event is dispatched after control event in an embed player.

Has next field:

event: [string] name of control event

  possible values: one of  TouchCastPlayerAPI.controlsType

  • TouchCastPlayerAPI.controlsType.SUBTITLES  Will dispatch whenever language in subtitles was changed by user.
    value: [boolean|string] the value of controls event
  • TouchCastPlayerAPI.controlsType.FULLSCREEN  Will dispatch whenever after click to fullScreen button in player.
    value: [boolean] the value of controls event
  • TouchCastPlayerAPI.controlsType.VOLUME  Will dispatch whenever after change volume or mute/unmute.
    volume: [number] the value of volume(0-10)
    isMute: [boolean] flag
  • TouchCastPlayerAPI.controlsType.PLAYBACK_SPEED  Will dispatch whenever after change playback speed.
    value: [number] current rate of playback

  • TouchCastPlayerAPI.controlsType.SEEK_VIDEO  Will dispatch whenever after seek video by user(progressBar or hotKey).


TouchCastPlayerAPI.events.CURRENT_SUBTITLES

This event is dispatched after load or change video(Tc in Tc), returned current all available values of language.

Has next field:

allLangs: [Array of {"label": string, "value": string} | null] 

on first position always off and on second position always default language

TouchCastPlayerAPI.events.ANALYTICS_READYThis event is dispatched after load and init fabric analytics.
TouchCastPlayerAPI.events.HLS_QUALITY_LIST

This event is dispatched after parsed manifest of HLS, returned all available values of quality.

Has next field:

levels: [Array of {"label": string, "value": number} | null] 

TouchCastPlayerAPI.events.AUTO_PLAY_STARTEDThis event is dispatched after successful start play if flag autoPlay is present in config.
TouchCastPlayerAPI.events.AUTO_PLAY_FAILEDThis event is dispatched after failed start play if flag autoPlay is present in config.
TouchCastPlayerAPI.events.PLAYER_WAS_CLICKEDThis event is dispatched after each click on player area.
TouchCastPlayerAPI.events.TOKEN_WAS_REFRESHEDThis event is dispatched after refresh token

Related content

.doAction()
.doAction()
More like this
Player API
Player API
More like this
.embed()
.embed()
More like this
Home Developers
Home Developers
More like this
Tutorial 01 - Programmatically Embed a TouchCast Player and Control it
Tutorial 01 - Programmatically Embed a TouchCast Player and Control it
More like this
Tutorial 02 - Connect to an Embedded TouchCast Player
Tutorial 02 - Connect to an Embedded TouchCast Player
More like this