Last active
April 30, 2018 02:10
-
-
Save afuggini/6c5da80a1ffd50b3f1ed392785758df0 to your computer and use it in GitHub Desktop.
VPAID container class template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VPAIDContainer { | |
constructor () { | |
// The slot is the div element on the main page that the ad is supposed to occupy | |
this._slot = null | |
// The video slot is the video object that the creative can use to render and video element it might have. | |
this._videoSlot = null | |
} | |
initAd (width, height, viewMode, desiredBitrate, creativeData, environmentVars) { | |
// slot and videoSlot are passed as part of the environmentVars | |
this._slot = environmentVars.slot | |
this._videoSlot = environmentVars.videoSlot | |
console.log('initAd') | |
} | |
startAd () { | |
console.log('startAd') | |
} | |
stopAd () { | |
} | |
setAdVolume (value) { | |
} | |
getAdVolume () { | |
} | |
resizeAd (width, height, viewMode) { | |
} | |
pauseAd () { | |
} | |
resumeAd () { | |
} | |
expandAd () { | |
} | |
getAdExpanded (value) { | |
} | |
getAdSkippableState (value) { | |
} | |
collapseAd () { | |
} | |
skipAd () { | |
} | |
subscribe (callback, eventName, context) { | |
} | |
unsubscribe (eventName) { | |
} | |
getAdIcons () { | |
} | |
getAdDuration () { | |
} | |
getAdHeight () { | |
} | |
getAdWidth () { | |
} | |
getAdLinear () { | |
} | |
getAdRemainingTime () { | |
} | |
handshakeVersion () { | |
return '2.0' | |
} | |
} | |
global.getVPAIDAd = function () { | |
return new VPAIDContainer() | |
} | |
export default VPAIDContainer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment