0

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();
  • The note stated in the [Google Cast documentation](https://developers.google.com/cast/docs/ads#ads_overview) could be the reason why you were not able to implement that. "*Note: The Cast receiver and sender SDKs **don’t** currently have native support for ads metadata inside the media status updates. This will be supported in a future update.*" – MαπμQμαπkγVπ.0 May 01 '19 at 08:00
  • Thanks for your reply. Actually that doesn't seem to be the reason as we are sending ads metadata in receiver application. – priti verma May 14 '19 at 18:55

0 Answers0