-jio-start-block-type-2
-jio-style-title
Video Multiple Ad Playlists (VMAP) are used to return multiple video ads to be played during a video. It offers content owners control over the placement and timing of ads, especially when they lack control or ownership of the player.
We support 2 types of VMAP.
1.VMAP URL
2.VMAP for VOD
Complete GETTING STARTED section and INITIALIZE SDK section before starting this section
-jio-end-block-type-2
-jio-start-block-type-2
Giving VMAP URL from SDK to publisher which gives VMAP xml and then rest all will be managed by publisher through IMA extension.
-jio-style-title
The IAB Video Multiple Ad Playlist (VMAP) specification is an XML template that video content owners can use to describe the structure for Ad inventory insertion. In order to effectively monetize video content with in-stream insertion advertising, Video content owners must carefully manage the structure and use of Ad inventory opportunities available within their content.
With VMAP, video content creators can define the following:
-jio-bullet-type-1
-jio-bullet-type-1
-jio-bullet-type-1
VMAP was designed to be used in conjunction with VAST and is well-suited for video content creators who have no control over the video player, but want to control the ad experience within the videos. This method of ad scheduling is supported via VAST and Google IMA plugins
-jio-style-title
Use the below code snippet to fetch VMAP URL
private fun loadVmap(vmapId: String, packageNAme: String) {
val jioAdsLoader = JioAdsLoader(vmapId, this
//context,object
: JioAdsLoaderListener {
override fun onAdsUrlLoaded(vmapUrl: String) {
e("onAdsUrlLoaded:: " + vmapUrl) initializePlayer(vmapUrl)
}
override fun onAdsLoadingError(jioAdError: JioAdError ? ) {}
}) jioAdsLoader.contentVideoLength = 100 val cuePoints = ArrayList < Long > () cuePoints.add(10) cuePoints.add(20) cuePoints.add(40) cuePoints.add(60) jioAdsLoader.contentVideoCuePoints = cuePoints jioAdsLoader.getVmap()
}
-jio-end-block-type-2
-jio-start-block-type-2
Giving VMAP URL from SDK to publisher which gives VMAP xml and then rest all will be manged by publisher through IMA extension.
VOD VMAP is developed for JioTv,JioTv+ and SonyLiv JioSTB
Follow the below steps to integrate VMAP for vod implementation.
-jio-style-title
Create an instance of JioVmapAdsLoader
with all the details that are needed as below
Create instance of VMAPInfo
with all required data
JioVmapAdsLoader.VMAPInfo(<metadata for targetting>,
<threshold for preparation>,
<adcontainer>,
<vmap url>,
<preroll cid>,
<midroll cid>,
<postroll cid>)
-jio-style-title
Create an instance of JioVmapListener
JioVmapAdsLoader.JioVmapListener {
override fun onJioVmapAdsLoaded() {
//Callback will be given when vmap is loaded for current content
}
override fun onJioVmapEvent( event: JioAdEvent,
extraData: HashMap<String, String>? ) {
//Events given for ad playback
AD_BREAK_READY -> {} CONTENT_PAUSE_REQUESTED -> {
//App has to pause the content player and call play ads.
pauseContentPlayerAndPlayAds()
jiovmapAdsLoader.playAds()
}
AD_BREAK_STARTED -> {}
AD_BREAK_ERROR -> {}
STARTED -> {}
FIRST_QUARTILE -> {}
MIDPOINT -> {}
THIRD_QUARTILE -> {}
AD_PROGRESS -> {}
PAUSED -> {}
RESUMED -> {}
SKIPPED -> {}
CLICKED -> {}
COMPLETED -> {}
AD_BREAK_ENDED -> {}
CONTENT_RESUME_REQUESTED -> {
playContentPlayerAndHideAdContainer
}
ALL_ADS_COMPLETED -> {}
}
override fun notifyPlayerTime() {
//Observer for content player. Call the below API in this callback
jiovmapAdsLoader!!.setCurrentPlayerTime( player.currentPosition,
player.duration )
}
override fun onJioVmapError(error: JioAdError) {
}
}
-jio-style-title
Create instance of JioAdsLoader with above 2 objects.
Call request on jiovmapadsloader.
jiovmapAdsLoader!!.request()
-jio-style-title
Whenever there is seek happening, missedcue point should be checked and for that following api can be called.
jiovmapAdsLoader.notifyCuePointMissed(player.currentPosition)
-jio-style-title
To Control Ad Break Manually
To determine whether a particular ad break should be played, Call below API to notify the SDK accordingly.
jiovmapAdsLoader.setAutoPlayAdBreaks(false)
false – If publisher wants to control ad break.
true - If publisher does not want to control ad break.
The above API must be called before invoking the request() function of AdsLoader. When this API is called, the publisher can determine whether to call playAd() inside the CONTENT_PAUSE_REQUESTED callback or not. If playAd() is not called, SDK will not play the particular ad break.
-jio-style-title
Get current playing CuePoint Information
To retrieve the current cue point information, use extraData: HashMap<String, String>
provided in the onJioVmapEvent()
callback. Cue point information will only be available when the ad is in one of the following states: AD_BREAK_READY, CONTENT_PAUSE_REQUESTED, or AD_BREAK_ERROR
.
-jio-style-title
CuePoint format
{adType=preroll} //In case of preroll
{adType=midroll, cuePoint=00:10:00.000} // Only for mid roll. For preroll/postroll cuePoint will be null
{adType=postroll} //In case of postroll
-jio-style-title
How to extract data from given Map
Val adType = extraData?.get("adType")
Val cuePoints = extraData?.get("cuePoint")
-jio-style-title
Following are the utility methods that are supported for VMAP.
-jio-tables
Method | Action |
---|---|
onJioVmapAdsLoaded(cuePoints: MutableList<String>) | To get list of all the configured cuePoints.(callback of JioVmapListener) |
pauseAd() | to pause playing ad |
resumeAd() | to resume paused ad |
setCustomLayout(layout:Int) | to set customized layout for vmap ad |
showSkip() | to show skip button |
hideSkip() | to hide skip button |
-jio-style-title
Following are the APIs that are supported to set metadata targeting for VMAP.
-jio-tables
APIs | Description |
---|---|
setChannelId(channelId:String?) | Sets the Channel ID |
setChannelName(channelName:String?) | Sets the Channel Name |
setShowName(showName:String?) | Sets the Show Name |
setPageCategory(pageCategory:String?) | Sets the Page Category |
setSectionCategory(sectionCategory:String?) | Sets the Section Category |
setLanguageOfArticle(languageOfArticle:String?) | Sets the Language of the Article |
setLanguage(language:String?) | Sets the Language |
setContentId(contentId:String?) | Sets the Content ID |
setContentTitle(contentTitle:String?) | Sets the Content Title |
setContentType(contentType:String?) | Sets the Content Type |
setVendor(vendor:String?) | Sets the Vendor Name |
setActor(actor:String?) | Sets the Actor Name |
setObjects(objects:String?) | Sets the objects |
setIsKidsProtected(isKidsProtected:Constants.KIDS_PROTECTED?) | Sets the Flag for Kids Protection |
setGender(gender:Constants.GENDER?) | Sets the Gender |
setAppVersion(appVersion:String?) | Sets the App Version |
setGenre(genre:String?) | Sets the Genre |
setState(state:String?) | Sets the State |
setCity(city:String?) | Sets the City |
setAge(age:String?) | Sets the age |
setCountry(country:String?) | Sets the country |
setPincode(pincode:String?) | Sets the PIN code of the location |
setKeywords(keywords:String?) | Sets the Keywords |
setPlacementName(placementName:String?) | Sets the Placement Name |
setCustomMetadata(customMetadata:Map<String,String?>?) | Sets the custom meta data |
-jio-end-block-type-2