Constructors

Methods

  • This method allows the gadget to communicate with player scripting. If the appropriate scripting is in place in the currently running template, calling this method will initiate a callback which can be acted upon in player script.

    Parameters

    • Rest...args: any[]

      variable number of arguments

    Returns void

    client.callback('test', 'this');
    
  • Indicate to the player that this app has finished it's visualization. This allows the player to proceed with the next item in a playlist if applicable.

    Returns void

  • Returns a map of commands currently active for this device.

    Returns Promise<null | string>

    Map of commands currently active for this device.

  • Returns the device details associated with the player running the gadget or web app.

    Returns Promise<null | IDevice>

    Device details.

  • Returns the unique Revel Digital device key associated with the device.

    Returns Promise<null | string>

    Device key

  • Returns the current device time in ISO8601 format. Current device time is determined by the device timezone assigned to the device in the CMS.

    Parameters

    • Optionaldate: Date

      Optional. If supplied will translate the supplied date/time to device time based on respective timezones.

    Returns Promise<null | string>

    Date/time in ISO8601 format

  • Returns the timezone ID currently assigned to the device.

    Returns Promise<null | string>

    Timezone ID

  • Returns the timezone name currently assigned to the device.

    Returns Promise<null | string>

    Timezone Name

  • Returns the numerical offset from GMT of the timezone currently assigned to the device.

    Returns Promise<null | number>

    Timezone offset

  • Returns the duration of the currently playing source. (only applicable when associated with a playlist)

    Returns Promise<null | number>

    Duration of the current item in milliseconds

  • Returns the height of the visualization area.

    Returns Promise<null | number>

    Height of the visualization area

  • Returns the language code of the language currently assigned to the device.

    Returns Promise<null | string>

    Language code

  • Accessor method for the user preferences interface exposed by the Gadgets API.

    See https://developers.google.com/gadgets/docs/basic for more details on the Gadgets API.

    Returns undefined | Prefs

    Gadget API Prefs object

    constructor(public client: PlayerClientService) {
    let prefs = client.getPrefs();
    let myString = prefs.getString('myStringPref');
    }
  • Returns the root folder utilized by this player device.

    Returns Promise<null | string>

    Path to the root folder

  • Returns the current SDK version.

    Returns Promise<string>

    SDK version

  • Returns the width of the visualization area.

    Returns Promise<null | number>

    Width of the visualization area

  • Check is the gadget is running in preview mode. Preview mode is enabled when the gadget is being edited in the CMS, or otherwise not running in a normal player environment.

    Returns Promise<boolean>

    True if the gadget is running in preview mode, false otherwise.

  • A session is a way of grouping events together. Each event has an associated session ID. Session ID's are randomly generated and reset by subsequent calls to newEventSession().

    Each call to track() will utilize the same session ID, until another call to newEventSession().

    Parameters

    • Optionalid: string

      Optional. User supplied session ID. If not supplied a random session ID will be generated.

    Returns void

  • Remove an event listener for the specified player event.

    Parameters

    • eventType: EventType

      type of event to listen for

    Returns void

  • Add an event listener for the specified player event.

    Parameters

    • eventType: EventType

      type of event to listen for

    • callback: ((data: any) => void)

      function to call when the event is triggered

        • (data): void
        • Parameters

          • data: any

          Returns void

    Returns void

  • Send a command to the player device.

    Parameters

    • name: string

      Command name

    • arg: string

      Command argument

    Returns void

  • Send a command to any remote player with the supplied device key(s). Note: Remote commands can only be delivered to devices within the same account as the sender device.

    Parameters

    • deviceKeys: string[]

      Array of remote device keys

    • name: string

      Command name

    • arg: string

      Command arg

    Returns void

  • Method for initiating a timed event. Timed events are useful for tracking the duration of an event and must be proceeded with a call to track().

    Parameters

    • eventName: string

      Unique name for this event

    Returns void

    client.timeEvent('testEvent');
    client.track("test", { "a": "b" });
  • Log an event for use with AdHawk analytics. Events are used for tracking various metrics including usage statistics, player condition, state changes, etc.

    Parameters

    • eventName: string

      Unique name for this event

    • Optionalproperties: IEventProperties

      A map of user defined properties to associate with this event

    Returns void