-
Notifications
You must be signed in to change notification settings - Fork 20
/
IVPAIDAdUnit.js
68 lines (61 loc) · 2.05 KB
/
IVPAIDAdUnit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
//simple representation of the API
export class IVPAIDAdUnit {
//all methods below
//are async methods
handshakeVersion(playerVPAIDVersion = '2.0', callback = undefined) {}
//creativeData is an object to be consistent with VPAIDHTML
initAd (width, height, viewMode, desiredBitrate, creativeData = {AdParameters:''}, environmentVars = {flashVars: ''}, callback = undefined) {}
resizeAd(width, height, viewMode, callback = undefined) {}
startAd(callback = undefined) {}
stopAd(callback = undefined) {}
pauseAd(callback = undefined) {}
resumeAd(callback = undefined) {}
expandAd(callback = undefined) {}
collapseAd(callback = undefined) {}
skipAd(callback = undefined) {}
//properties that will be treat as async methods
getAdLinear(callback) {}
getAdWidth(callback) {}
getAdHeight(callback) {}
getAdExpanded(callback) {}
getAdSkippableState(callback) {}
getAdRemainingTime(callback) {}
getAdDuration(callback) {}
setAdVolume(soundVolume, callback = undefined) {}
getAdVolume(callback) {}
getAdCompanions(callback) {}
getAdIcons(callback) {}
}
Object.defineProperty(IVPAIDAdUnit, 'EVENTS', {
writable: false,
configurable: false,
value: [
'AdLoaded',
'AdStarted',
'AdStopped',
'AdSkipped',
'AdSkippableStateChange', // VPAID 2.0 new event
'AdSizeChange', // VPAID 2.0 new event
'AdLinearChange',
'AdDurationChange', // VPAID 2.0 new event
'AdExpandedChange',
'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility
'AdVolumeChange',
'AdImpression',
'AdVideoStart',
'AdVideoFirstQuartile',
'AdVideoMidpoint',
'AdVideoThirdQuartile',
'AdVideoComplete',
'AdClickThru',
'AdInteraction', // VPAID 2.0 new event
'AdUserAcceptInvitation',
'AdUserMinimize',
'AdUserClose',
'AdPaused',
'AdPlaying',
'AdLog',
'AdError'
]
});