Constructor
new InterstitialTracker(getEvents, sendBeacon, firedopt, non-null)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
getEvents |
function | Returns the current events, which may change once deferred data is resolved. | |
sendBeacon |
function | ||
fired |
Set<shaka.ads.InterstitialTracker.Event> |
<optional> |
Events already sent, which may be shared with other trackers (e.g. the slots of a pod). |
- Implements:
- Source:
Members
NAMES_ :Map<string, string>
Maps ad events to tracking event names.
Type:
- Map<string, string>
- Source:
REPEATED_ :Set<string>
Tracking events that describe an action, so they are sent every time.
Type:
- Set<string>
- Source:
getEvents_ :function(): !Array<shaka.ads.InterstitialTracker.Event>
Type:
- function(): !Array<shaka.ads.InterstitialTracker.Event>
- Source:
sendBeacon_ :function(string)
Type:
- function(string)
- Source:
Methods
fromTracking(trackingnullable) → {Array<shaka.ads.InterstitialTracker.Event>}
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
tracking |
shaka.extern.AdTrackingEvent |
<nullable> |
- Source:
Returns:
- Type
- Array<shaka.ads.InterstitialTracker.Event>
getName(type) → {string}
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string | An ad event type, or a VAST tracking event name. |
- Source:
Returns:
The VAST tracking event name.
- Type
- string
isRepeated(name) → {boolean}
Whether the event describes an action, which is reported every time it
happens, rather than a state, which is reported once.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string |
- Source:
Returns:
- Type
- boolean
fire(name)
Sends the beacons of the given event type. Events that describe a state
are sent once; events that describe an action are sent every time.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string |
- Source:
onEvent(type)
Called for every ad event of the interstitial. May be called again with
the same event when deferred data is resolved.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string |
- Implements:
- Source:
onProgress(previous, position)
Called when media between two positions (relative to the start of the
interstitial) was played at normal speed.
Parameters:
| Name | Type | Description |
|---|---|---|
previous |
number | |
position |
number |
- Implements:
- Source:
release()
Request that this object release all internal references.
- Inherited From:
- Implements:
- Source:
resolve() → {Promise}
Resolves data required for measurement that is not available yet.
- Implements:
- Source:
Returns:
- Type
- Promise
Type Definitions
Event
Type:
- {type: string, offset: (number|undefined), urls: !Array<string>}
Properties:
| Name | Type | Description |
|---|---|---|
type |
string | The VAST tracking event name. |
offset |
number | undefined | The position, in seconds, of a progress event. |
urls |
Array<string> | The beacon URLs, which may contain VAST macros. |
- Source: