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
withparams.name
being${kind}_${context}_${action}
.
$b.emitGeneric(params, [willEngage=true])
Arguments
[params={}] (Object)
: The options object.[params.name] (string)
: The full event name, this overwritesparams.kind
,params.context
andparams.action
.[params.kind] (string)
: Kind of event. It can beNavigate
orMediaProgress
.[params.context] (string)
: Context of event. It can bePreroll
in the case ofNavigate_Preroll_Click
[params.action] (string)
: Action of event. It can beClick
in the case ofNavigate_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 bePreroll
in the case ofNavigate_Preroll_Click
[params.action] (string)
: Action of event. It can beClick
in the case ofNavigate_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)
})