...
Send platform_id to getVideoInfo route.
Retrieve context or IAB categories from getVideoInfo,.
Send context or IAB categories in the pre-roll ad call for the initial video.
Sample formatting of the getVideoInfo request
...
Code Block |
---|
IrisContext.getVideoInfo('<platform_id of video here>', function(data) { // data is ready to be used // where data is an object of the form { context: [‘context-value’], categories: [‘iab-value’] } console.log(data.context); console.log(data.categories); }); |
Example of response for getVideoInfo
...
Code Block |
---|
{ platform_id: '6026440620001', iab: ["IAB17-26"], context: ["e883d22ce29c85f9e910281d2a410c5bad77a098"] } |
Recommended Videos: Using the getRecommendationInfo route to retrieve context or IAB data
Steps
...
Call
getRecommendationsInfo
route as a part of callbacks for IRIS.TV /watch and /next API routes.Store data returned from
getRecommendationsInfo
so it can be used to retrieve data each recommended video.On video load, query player for ID of the video and then query stored platform_id values for context or IAB categories.
Send context of IAB category data in the pre-roll ad call for the video.
Sample formatting of the getRecommendationInfo request (/watch call)
...
Code Block |
---|
window.addEventListener('iris_watch', function (e) { IrisContext.getRecommendationsInfo().then(function(data) { // <data> will contain the information in the form of: /* { <platform_id>: { context: <value>, iab: <vlaue> }, <platform_id>: { context: <value> }, } */ }); }); |
Sample formatting of the getRecommendationInfo request (/next call)
...
Code Block |
---|
window.addEventListener('iris_next', function (e) { IrisContext.getRecommendationsInfo().then(function(data) { // <data> will contain the information in the form of: /* { <platform_id>: { context: <value>, iab: <vlaue> }, <platform_id>: { context: <value> }, } */ }); }); |
...