<head> <script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script> <script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script> </head> <body> <div id="adContainer"> <cast-media-player id="player"></cast-media-player> </div> ...
playerManager.setMessageInterceptor(
cast.framework.messages.MessageType.LOAD, loadRequestData => {
Utils.initIMA();
setTimeout(()=>{
playerManager.stop();
Utils.requestAd('https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=12345678');
}, 15000);
return loadRequestData;
});
var Utils = {
requestAd: (adTagUrl) => {
let adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = adTagUrl;
adsRequest.linearAdSlotWidth = mediaElement.width;
adsRequest.linearAdSlotHeight = mediaElement.height;
adsRequest.nonLinearAdSlotWidth = mediaElement.width;
adsRequest.nonLinearAdSlotHeight = mediaElement.height / 3;
adsLoader.requestAds(adsRequest);
},
initIMA : () => {
let adDisplayContainer = new google.ima.AdDisplayContainer(document.getElementById('adContainer'), mediaElement);
adDisplayContainer.initialize();
adsLoader = new google.ima.AdsLoader(adDisplayContainer);
adsLoader.getSettings().setPlayerType('cast/client-side');
adsLoader.addEventListener(
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
Utils.onAdsManagerLoaded, false);
adsLoader.addEventListener(
google.ima.AdErrorEvent.Type.AD_ERROR, Utils.onAdError, false);
adsLoader.addEventListener(
google.ima.AdEvent.Type.ALL_ADS_COMPLETED, Utils.onAllAdsCompleted, false);
}
}...Пользователь пятница, ноября 30, 2018, 10:19 ПП написал ima-sdk-advisor+support via Interactive Media Ads SDK <ima...@googlegroups.com>:
Hi there,
Thank you for reaching out to support. The issue with your implementation is that you're loading the Cast Receiver Framework V3 designed to be used with the CAF receiver. As using the CAF receiver is not an option for you, we would recommend you to load the Cast Receiver V2 instead (//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js) and take a look at the Getting Started Guide documentation for IMA SDK and Google Cast.Regards,Deepika UragayalaIMA SDK Team
On 11/30/18 06:28:08 stre...@gmail.com wrote:
The latest Google Chromecast API has native ads functionality it supports VAST and VMAP formats, but we have found that if XML manifest file has type="aplication *" so the ads not work, chomecast ads functionality ignore this. Google cast issue Any idea of this? Ok, alterative solution was to use IMA sdk instead of standard CAF ads functionality. But I cannot start to play ads, there are always an error. I have used example of this code: google ima sdk example after media loads I have added timeout for 15 seconds and than load an ad, like this:
<head> <script type="text/javascript" src="//www.gstatic.com/cast/ sdk/libs/caf_receiver/v3/cast_ receiver_framework.js"></ script> <script type="text/javascript" src="//imasdk.googleapis.com/ js/sdkloader/ima3.js"></ script> </head> <body> <div id="adContainer"> <cast-media-player id="player"></cast-media- player> </div> ...
playerManager.setMessageInterc eptor( cast.framework.messages.Messag eType.LOAD, loadRequestData => { Utils.initIMA(); setTimeout(()=>{ playerManager.stop(); Utils.requestAd('https:// pubads.g.doubleclick.net/ gampad/ads?sz=640x480&iu=/ 124319096/external/single_ad_ samples&ciu_szs=300x250&impl= s&gdfp_req=1&env=vp&output= vast&unviewed_position_start= 1&cust_params=deployment% 3Ddevsite%26sample_ct% 3Dlinear&correlator=12345678') ;
}, 15000); return loadRequestData; }); var Utils = { requestAd: (adTagUrl) => { let adsRequest = new google.ima.AdsRequest(); adsRequest.adTagUrl = adTagUrl;
--
You received this message because you are subscribed to the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ima-sdk+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.