Latest Chromecast CAF and IMA SDK not works togeather

248 views
Skip to first unread message

Stas Che

unread,
Nov 30, 2018, 6:28:08 AM11/30/18
to Interactive Media Ads SDK
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.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);
    }
}
...

Error reproduced on this line: adsLoader.requestAds(adsRequest); Uncaught TypeError: a.g.canPlayType is not a function

ima-sdk-adv...@google.com

unread,
Nov 30, 2018, 3:19:25 PM11/30/18
to 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 Uragayala
IMA SDK Team

stress tn

unread,
Nov 30, 2018, 3:50:04 PM11/30/18
to ima...@googlegroups.com
Ok, it’s very strange because google cast documentation wants users to use the latest api, but you advice the second version. Please answer on my question: is latest Chromecast CAF API can not work togeather with IMA SDK, am I right? Yes / No


Отправлено из Yahoo Почты на iPhone

Пользователь пятница, ноября 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 Uragayala
IMA 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.

ima-sdk-adv...@google.com

unread,
Dec 3, 2018, 3:24:16 PM12/3/18
to ima...@googlegroups.com
Hi there,

The IMA SDK and Google Cast Documentation recommends to use the latest API (V3). However, the latest API (V3) can only be integrated with the CAF player. In your Google Cast integration, you mixed V3 with V2 implementation by using the CAF/CAST receiver, the <cast-media-player> tag with the simple IMA SDK implementation for V2. It is not recommended to implement the CAF API with the simple IMA SDK, as mentioned previously, you should use the V2 integration that you can find in the Getting Started Guide.

Regards,
Deepika Uragayala
IMA SDK Team
Reply all
Reply to author
Forward
0 new messages