This event type is raised by the ad as a notification when the ad state changes and when
users interact with the ad. For example, when the ad starts playing, is clicked on, and
more. You can register for the various state changed events on AdsManager.
Properties | |
---|---|
current
|
Inherited from
|
target
|
Inherited from
|
type
|
Inherited from
|
Methods | |
---|---|
get
|
Get the current ad that is playing or just played. |
get
|
Allows extra data to be passed from the ad. |
prevent
|
Inherited from
|
stop
|
Inherited from
|
Properties
Optional
currentTarget
currentTarget?: null | object
Optional
target
target?: null | object
type
type: string
Methods
getAd
getAdData
getAdData(): null | object
Allows extra data to be passed from the ad.
Example:
Example:
if (event.type == google.ima.AdEvent.Type.LOG) { let adData = event.getAdData(); if (adData['adError']) { console.log('Non-fatal error occurred: ' + adData['adError'].getMessage()); } }
Returns | |
---|---|
null | object
|
Extra data for the event. Log events raised for error carry object of type 'google.ima.AdError' which can be accessed using 'adError' key. |
preventDefault
preventDefault(): void
stopPropagation
stopPropagation(): void