Client side preroll for DAI stream using Chromecast CAF

186 views
Skip to first unread message

SergeyM

unread,
Nov 4, 2022, 3:45:50 AM11/4/22
to Interactive Media Ads SDK
Hello!

We are going to show client-side preroll on the Chromecast CAF receiver before DAI stream starts. as I understand from the documentation that is was possible using IMA SDK for Cast SDK v2 but we are using the latest version of CAF and I was not able to implement that. Moreover we can find this message on the Cast SDK v2 page - Warning: The IMA SDK for Cast SDK v2 has been officially deprecated, as of November 17th, 2021. All existing users are urged to migrate to CAF native Ad Breaks. I am not sure can we use CAF native Ad Breaks to play client side preroll on DAI stream. 

So my question is - how can I implement custom preroll using ad tag url on Chromecast CAF for DAI stream? 

Thank you
Sergey

IMA SDK

unread,
Nov 4, 2022, 5:48:47 AM11/4/22
to s.s...@gmail.com, ima...@googlegroups.com

Hello Sergey,

 

Michael here from IMA SDK support team. Thank you for reaching out to us.

 

I believe that DAI stream implementation uses asset key for LIVE stream or CMS ID + Video ID for VOD instead of ad tag url. Ad tag urls are used for client side integration. Additionally, it is highly recommended to use the CAF DAI SDK for your integration as IMA SDK for CAST is already deprecated. Publishers who are currently using the IMA SDK for CAST to implement client-side advertisements are encouraged to migrate to using CAF native ad breaks. Publishers who are currently using the IMA SDK for CAST to implement DAI advertisements are encouraged to migrate to the new CAF DAI SDK.

More of this information can be found on this blog.

Let us know should you have further questions.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2g06pw:ref

SergeyM

unread,
Nov 4, 2022, 8:15:47 AM11/4/22
to Interactive Media Ads SDK
Hello Michael! 

I think you didn't understand me. Currently we are working on a solution together with Google to play client-side preroll using ad tag url before DAI stream started across all platforms (Web, iOS, Android, OTT). Guys recommended us this approach - https://www.google.com/url?sa=D&q=https%3A%2F%2Fgithub.com%2Fgoogleads%2Fgoogleads-ima-html5-dai%2Ftree%2Fmaster%2Fdai_preroll 

But as I understand this approach is only possible using IMA SDK for Cast SDK v2. In this example code you can find how to play client side preroll before DAI stream started on Chromecast device. 

So my question again - is it possible to make the same on Chromecast Receiver v3 aka CAF? 

Best regards,
Sergey

пятница, 4 ноября 2022 г. в 15:48:47 UTC+6, imasdk:

IMA SDK

unread,
Nov 4, 2022, 1:39:32 PM11/4/22
to s.s...@gmail.com, ima...@googlegroups.com

Hello Sergey,

 

Thank you for clarification of your use case. As this is not clearly documented on our end, allow me to raise this concern to the rest of our team to get more insights if your use case would be possible to implement on DAI SDK for CAF. One of them should be able to provide a more definitive solution to your concern. Kindly wait patiently for their response.

Regards,

IMA SDK

unread,
Nov 7, 2022, 8:59:22 AM11/7/22
to ima...@googlegroups.com, s.s...@gmail.com
Hi Sergey,

Unfortunately, the CAFv3's native Ad breaks don't yet have built in support for DAI streams with VAST prerolls, but it is fairly easy to replicate the effect with some custom logic on the part of the receiver.

I've prepared a sample implementation that should demonstrate the process. It isn't fully debugged, but should be enough to demonstrate the concept.

The trick is to send a very short (around 0.5 seconds) blank video clip in your request, along with your VMAP ad tag and DAI Asset Key. Then, in your Load Interceptor you ONLY load the DAI stream if there is no attached VMAP tag. This ensures that the VMAP and blank clip play as-is. Then add a listener for MEDIA_FINISHED that grabs the current clip's details, and clones them to a new clip, without passing on the VMAP tag.

if you are not loading a VMAP tag for your preroll, and instead have only a bare VAST tag, you may need to modify the approach slightly to watch for and strip the breakClips parameter, instead of vmapAdsRequest.

Let me know if this is enough information for you to move ahead with implementation.

Thanks,

Greg Schoppe

SergeyM

unread,
Nov 8, 2022, 2:01:17 AM11/8/22
to Interactive Media Ads SDK
Hi Greg! 

I like you approach, it looks promising. I even was able to run a short video with a preroll but the problem with the MEDIA_FINISHED event in your code. 

const queueItem = queueManager.getCurrentItem();
const media = queueItem.media;

The problem is queueItem is always null. I tried different approaches and I tried to send a queue request from a device (not a regular LOAD request) - result is always the same - queueManager is always empty when Media_Finished called. I tried to request getItems() - it's always = 0 when Media_Finished called. 

Best 
Sergey

понедельник, 7 ноября 2022 г. в 19:59:22 UTC+6, imasdk:

IMA SDK

unread,
Nov 8, 2022, 11:25:22 AM11/8/22
to s.s...@gmail.com, ima...@googlegroups.com
Hi Sergey,

I'm sorry to have given you an incorrect event to attach to... the issue is likely that MEDIA_FINISHED fires after the current item is cleared from the queue. Thinking about other potential events to attach to, you might actually have the best user experience if you attach the queue manipulation code that was in MEDIA_FINISHED to `cast.framework.events.EventType.BREAK_ENDED` instead. That should serve to shorten the gap between pre-roll and content, by skipping playing the "filler" video entirely.

Let me know if you still have trouble accessing the current queue item in that event's listener, and I can investigate more deeply.

ref:_00D1U1174p._5004Q2g06pw:ref

SergeyM

unread,
Nov 9, 2022, 12:51:06 AM11/9/22
to Interactive Media Ads SDK
Hi Greg! 

I still was not able to do that but you led me to conclude that we could use client-side created queue for that without altering receiver to much. So I just implemented this on iOS. I created a queue item with this blank video and preroll ad tag url, and another queue item with DAI stream. And I sent them both to Chromecast and it works perfectly! Do you think any edge cases could potentially appear with this solution? 

Thank you so much for your help. It was brilliant!

Best regards,
Sergey

вторник, 8 ноября 2022 г. в 22:25:22 UTC+6, imasdk:

IMA SDK

unread,
Nov 14, 2022, 2:26:06 PM11/14/22
to s.s...@gmail.com, ima...@googlegroups.com
Hi Sergey,

This sounds like a fine solution. It shouldn't be possible to skip to the DAI stream while the VMAP stream is playing, so this should be pretty foolproof. The only thing to keep in mind is that the preroll will not replay if you navigate back to that event in the queue.
Reply all
Reply to author
Forward
0 new messages