Using the IMA SDK for Google Cast for HLS Content and Ads

557 views
Skip to first unread message

Jason Brunken

unread,
Apr 3, 2017, 2:40:48 PM4/3/17
to Interactive Media Ads SDK
Hello,

I am working on a project where we need to create a Chromecast receiver app that plays HLS content and delivers HLS ads via the IMA SDK for Google Cast.

I have been able to get the HLS ads to play in a simple receiver app using the supplied sample code.

I've also been able to get HLS content to play with no issues using the Cast reference player located here: https://github.com/googlecast/CastReferencePlayer

However, when I try and merge the two into one app that will play both HLS ads and HLS content, I'm not having much luck.   It started with a Playback/104 error.   I managed to get that resolved, but now I'm having trouble getting the content to resume smoothly.

Is this scenario even possible/supported with the current SDKs?  If so, is there some reference code somewhere?

Thanks!

Jason Brunken

unread,
Apr 3, 2017, 2:43:53 PM4/3/17
to Interactive Media Ads SDK
Correction.   The ads are not HLS (I had myself confused).   I  just need to be able to play normal ads with HLS VOD content.

Chris Feldman (IMA SDK Team)

unread,
Apr 3, 2017, 4:04:56 PM4/3/17
to Interactive Media Ads SDK
Hi Jason,

I see no reason that you shouldn't be able to get this working. I need some more information about your implementation. For example, what are you using as your sender? We have Android and iOS samples that should allow you to stream content to our simple receiver app. Are you getting any specific errors, or console output?

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Jason Brunken

unread,
Apr 4, 2017, 12:04:22 PM4/4/17
to ima...@googlegroups.com
Hi Chris,

I'm using a very simple chrome app for the sender based on this code:  https://github.com/googlecast/CastVideos-chrome-samples/tree/master/events_sample

I'm not really getting any errors at this point.   It just doesn't want to resume playback smoothly like it does with a normal mp4 content file.   It just comes back in a paused state (even though .play() is being called in the seem method) and eventually the player quits because of an idle timeout.

There is a lot of stuff going on in the Reference Receiver code that I don't entirely understand yet (preloading, idle timers, etc).   I think that some of it is not playing nice when using the IMA SDK and HLS content.    I've been playing around with it for quite a while now and I just can't seem to find any solution that works reliably.



--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/76vLXH3XNw8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+unsubscribe@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.

Chris Feldman (IMA SDK Team)

unread,
Apr 4, 2017, 1:41:48 PM4/4/17
to Interactive Media Ads SDK
Hi Jason,

We don't have any samples for creating a cast sender in HTML5. However, our samples for native iOS and Android should serve as a good guide. Like in the iOS and Android samples, you need to send messages to the cast receiver at the appropriate times. This page details the implementation for the Android sample. You'll need to make sure you're sending the appropriate information to request that content resume.

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Jason Brunken

unread,
Apr 4, 2017, 2:22:10 PM4/4/17
to ima...@googlegroups.com
I'm not sure what part of the sender that I need to look at.   I already have a working sender and I'm able to send and receive messages via the message bus.   Right now, I have most of the stuff hard coded in the receiver app as a proof of concept, so I'm really just using the HTML5 sender to do the initial load into the cast receiver.

For example, I'm currently loading in an adTagUrl that has a hard coded playlist that consists of a preroll and a midroll with 2 ads.   The IMA SDK does stop the content at the appropriate time and the ads do play properly, but when the ad break is done, the cast receiver app does not resume HLS content playback in the same way it does for MP4 content.

I probably need to re-ask this question in the cast group, but it would help if I understood what the IMA SDK is doing on the receiver when it completes an ad break.

Chris Feldman (IMA SDK Team)

unread,
Apr 4, 2017, 4:36:22 PM4/4/17
to Interactive Media Ads SDK
Hi Jason,

I think I missed that you have this working for MP4 content. If that's the case, it sounds like your implementation is okay. Would you be able to share a link to the HLS content that you're trying to play? I'd like to investigate further because the issue may be content related. At the same time, I'd suggest reaching out to the Chromecast team because it's possible the problem is on their end as well.

Regards,
Chris Feldman
IMA SDK Team

Chris Feldman (IMA SDK Team)

unread,
Apr 5, 2017, 3:16:34 PM4/5/17
to Interactive Media Ads SDK
Hi Jason,

I've figured out why you haven't been able to get this working. To play HLS content on the Chromecast, you need to use the Media Player Library. The CastReferencePlayer uses the Media Player Library, while our sample does not. That's where the discrepancy is occurring.  If you need more support while implementing the library, you'll have to reach out to the Chromecast team. For any IMA SDK related issues, please let me know if you have any further questions.

Regards,
Chris Feldman
IMA SDK Team

Jason Brunken

unread,
Apr 5, 2017, 3:25:46 PM4/5/17
to ima...@googlegroups.com
Yes, that's why I originally moved from the simpler example to the CastReferencePlayer example.    Unfortunately, it does a lot of extra stuff that I believe may be messing things up.

I'll take the question up with the Chromecast team.

Thanks for all your assistance with this.
Reply all
Reply to author
Forward
0 new messages