I have created a basic CAF receiver and trying to play ads on chromecast using "vmapAdsRequest" of mediaInformation. Ads are getting played but I am not able to pause, resume or change volume for ads. while I am able to do so if I play Vpaid Ads using same sender app.
/**
* @param {!cast.framework.messages.MediaInformation} mediaInformation
*/
function addBreakToMedia(mediaInformation) {
// VMAP Ads -
mediaInformation.vmapAdsRequest = {
adTagUrl: 'https://pulse-demo.videoplaza.tv/proxy/distributor/v2?rt=vmap_1.0&t=standard-linears,allSupportedAds&bp=10,30&xpb=1&rnd=' + Math.floor(Math.random() * 10000)
}
}
// acquiring a reference to CastReceiverContext, your primary entry point to the whole Receiver SDK
var context = cast.framework.CastReceiverContext.getInstance();
//storing a reference to the PlayerManager, the object handling playback and providing you with all the hooks you need to plug-in your own custom logic
var playerManager = context.getPlayerManager();
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD,
loadRequestData => {
addBreakToMedia(loadRequestData.media);
return loadRequestData;
}
);
//Initializing the SDK by calling start() on CastReceiverContext
context.start();