Hi I'm Marco's coworker, I've tested the Cast Ad Break solution. Preroll doesn't work but VMAP midroll does. In this case, almost at the end of the midroll, the main manifest is downloaded again, so in case of tokenized url this is a problem.
Here you can find a video recording of my screen where I show the behavior.
Thanks a lot for your support
Domenico
Our load function in sender:
// pre
// VMAP pre + mid
function load() {
var castSession = castContext.getCurrentSession();
var mediaInfo = new chrome.cast.media.MediaInfo(videoManifest, 'application/vnd.apple.mpegurl');
mediaInfo.breakClips = [
{
id: 'bc1',
vastAdsRequest: {
adTagUrl: adTag
}
}];
mediaInfo.vmapAdsRequest = {
adTagUrl: adTagVMAP
};
var request = new chrome.cast.media.LoadRequest(mediaInfo);
castSession.loadMedia(request).then(
function () {
console.log('Load succeed');
},
function (errorCode) {
console.log('Error code: ' + errorCode);
});