-jio-start-block-type-2
-jio-style-title
Jio Ads SDK will be able to play Server Side Ad Inserted streams and fire the Ad trackers based on the stream playback progress. Application need to call the below APIs and callbacks for handling SSAI streams.
Complete GETTING STARTED section and INITIALIZE SDK section before starting this section.
-jio-style-title
App need to fetch Media URL and VAST URL from stream URL. Get Media URL API (View API) need to be initiated by Application which will return Media and Vast url in a onMediaURLReady
callback.
JioAds.ssaiGetMediaURL(streamURL, options)
-jio-tables
Input Args | Values |
---|---|
streamURL | SSAI Stream/Channel URL as string |
options | JSON data with meta data as key and value params which will be used for Ads targeting |
Below callback will be initiated by SDK in case of successful generation of media and vast URLs
JioAds.onMediaURLReady = function ( streamURL, mediaURL, clientSideTracking )
-jio-tables
Return Args | Values |
---|---|
streamURL | SSAI Stream/Channel URL as string |
mediaURL | Media URL which need to be given as input to video player for playing SSAI stream |
clientSideTracking | Client side tracking enabled or not (True/false) |
-jio-style-title
Below callback will be initiated by SDK in case of any failure to fetch media URL
JioAds.onMediaURLFailedToLoad = function (streamURL, options)
-jio-tables
Return Args | Values |
---|---|
streamURL | SSAI Stream/Channel URL as string |
options | JSON data which contains info about the error |
-jio-style-title
App need to call below SDK API to notify SDK for start tracking the media playback and fire trackers.
JioAds.ssaiStartTracking( mediaURL, urlType, videoTagId, playerName, playerInstance, {
clickButtonId: "clickme",
companionInfo: companionMetaObj,
} )
-jio-tables
Input Args | Values |
---|---|
mediaURL | Media URL which is given as input to video player for tracking |
urlType | StreamURL / DirectMediaURL Direct media url is supported only for HLS streams |
videoTagId | Video element ID |
playerName | hlsjs / shaka / dashjs / videojs |
playerInstance | Relevant player object instance |
options |
clickButtonId: Click CTA button ID companionInfo: Array of companion containers each having divID, adSlotID, width, height |
-jio-style-title
Spot Ads in stream, if any, will be detected via below callbacks in Application.
JioAds.onSpotAdStart = function (creativeId,campanion) {
console.info( 'CB: onSpotAdStart Ad is Started', creativeId , "with companion", campanion );
}
JioAds.onSpotAdEnd = function (creativeId) {
console.info('CB: onSpotAdEnd Ad is Ended!',creativeId);
}
-jio-style-title
SDK will notify the Ad playback status to Application by firing certain callbacks as below: adInfo in the below callbacks will have meta information about the Ad being played.
JioAds.onAdMediaStart = function (placementId, options) {
console.log("CB: onAdMediaStart", placementId, options.adInfo);
showAdInfo(options.adInfo, clickButtonId);
};
JioAds.onAdChange = function (placementId, options) {
console.log("CB: onAdChange", placementId, options.adInfo);
};
JioAds.onAdMediaEnd = function (placementId, reward, options) {
console.log("CB: onAdMediaEnd", placementId, options.adInfo);
clearAdInfo(clickButtonId);
};
-jio-style-title
Application can use the below API to destroy the SDK related objects.
JioAds.ssaiDestroy()
-jio-end-block-type-2