TremorVideoCustomEvent (TVCE)

This supersedes requestInternal in future.

Each event typically has a:

  • kind
  • context
  • action

The constructed name will be ${kind}_${context}_${action} and emitted two times:

  • As ${kind}_${context}_${action}
  • As TremorVideoCustomEvent with params.name being ${kind}_${context}_${action}.

$b.emitGeneric(params, [willEngage=true])

Arguments

  • [params={}] (Object): The options object.
  • [params.name] (string): The full event name, this overwrites params.kind, params.context and params.action.
  • [params.kind] (string): Kind of event. It can be Navigate or MediaProgress.
  • [params.context] (string): Context of event. It can be Preroll in the case of Navigate_Preroll_Click
  • [params.action] (string): Action of event. It can be Click in the case of Navigate_Preroll_Click
  • [willEngage=true] (boolean): True if engagement should be set.

Examples

This emits a TremorVideoCustomEvent called Special_Bug_Touch:

$b.emitGeneric({ name: 'Special_Bug_Touch' })

This also emits a TremorVideoCustomEvent called Special_Bug_Touch.

$b.emitGeneric({ kind: 'Special', context: 'Bug', action: 'Touch' })

If you specify the name, the kind, context and action will be ignored.

$b.emitNavigate(params)

Arguments

  • [params={}] (Object): The options object.
  • [params.context] (string): Context of event. It can be Preroll in the case of Navigate_Preroll_Click
  • [params.action] (string): Action of event. It can be Click in the case of Navigate_Preroll_Click

Examples

This emits a TremorVideoCustomEvent called Navigate_Preroll_Click:

$b.emitNavigate({ context: 'Preroll', action: 'Click', one: 1, two: 2 })

To listen to the event, use:

$b.on('Navigate_Preroll_Click', function(params) { console.log(params.one) console.log(params.two) })