Document of Viscovery AD SDK
Viscovery aims to help our video publishers to monetize their video content with content-relative ads. The whole adTech includes the integration of Viscovery’s FITAMOS computer vision recognition technology.
ViscoverySDK need to be import to your html file
<script type="text/javascript" src="{host}/visSDK.2.0.js"></script>
Developer must fulfill following requests
<div id="container">
<div id="content">
<video id="content-player" class="player-layout" preload="metadata" width="854" height="480" playsinline controls>
<source src="https://your.video.path"></source>
</video>
</div>
<div id="adContainer"></div>
<div id="outstream"></div>
</div>
*playsinline: you can refer Mobile Fullscreen Hacking section to understand why you should add playsinline
attribute.
#container {
position: relative;
}
#adContainer {
position: absolute;
top: 0px;
left: 0px;
}
<script type="text/javascript">
window.onload = function () {
viscoveryAd.init({
contentPlayer: '#content-player',
adContainer: '#adContainer',
outStreamContainer: '#outstream',
apiKey: 'your-api-key',
videoUrl: "https://your.video.path",
videoId: 'video-id',
playerControl: {
// play: '',
// pause: '',
// getSeeking: '',
// getCurrentTime: '',
// getPaused: '',
},
bottomOffset: 30,
mobileFullscreenHacking: true,
});
}
</script>
init(args)
initialize Viscovery AD SDK
contentPlayer
(string): css selectors of content playeradContainer
(string): css selectors of instream ad containeroutStreamContainer
(string): css selectors of outstream ad containerapi_key
(string): api keyvideo_url
(string): content video url*1video_id
(string): content video id*1[bottomOffset]
(number) default 35: nonlinear instream ads offset from bottom providing you to avoid overlay on player control bar[mobileFullscreenHacking]
(boolean) default true: determine if you allow Viscovery Ad SDK replace your mobile native screen with our definitionplayerControl
*2playerControl.play
(function): play function for content playerplayerControl.pause
(function): pause function for content playerplayerControl.getSeeking
(function): seeking getter of content playerplayerControl.getCurrentTime
(function): current time getter of content playerplayerControl.getPaused
(function): paused state of content player*1 You can only give video url or video id. You will not get right ads if you give them both but they don’t match.
*2 if play
, pause
, seeking
, currentTime
or paused
of your player don’t match native html5 video player property name, you should give SDK these by yourself.
Due to limitation of mobile browser, Viscovery Ad SDK could not implement ad displaying on mobile browser. However, if mobileFullscreenHacking
is true
, Viscovery Ad SDK will achieve the fullscreen mode by implementing following specs.
Besides turning mobileFullscreenHacking
into true
, developer should add playsinline
attribute to video tag.