tvOS client side UI Elements?

194 views
Skip to first unread message

Tim Schmidt

unread,
Jun 11, 2019, 9:52:03 AM6/11/19
to Interactive Media Ads SDK
It looks like most of the other client-side SDKs have the option to tell the SDK to show an ad countdown via IMAAdsRenderingSettings but I'm not seeing it in tvOS:

Is there any way to do this other than hacking it in myself?

Thanks,
tim

IMA SDK

unread,
Jun 11, 2019, 2:30:36 PM6/11/19
to t...@schmidthole.com, ima...@googlegroups.com
Hi Tim,

Thank you for reaching out to us. The IMAAdsRenderingSettings class doesn't have any API method or field that would allow you to show/hide the ad countdown, none of the platforms (Android, iOS, HTML5, Roku, tvOS) have such feature, you have to implement it yourself. In IMA SDK for HTML5 documentation, we have the countdown timer guide that you can follow to implement your own ad countdown timer.

Regards,
Arnaud Casame
IMA SDK Team

ref:_00D1U1174p._5001UBmgk2:ref

Tim Schmidt

unread,
Jun 20, 2019, 10:20:31 AM6/20/19
to Interactive Media Ads SDK
Thanks for the response. I haven't dug too deeply into it but it wasn't immediately clear how to get at the view controller that the ad manager presents since I'm assuming I'll have to dynamically create a UILabel and add it. Has anyone gotten this to work successfully and can point me in the right direction?

IMA SDK

unread,
Jun 20, 2019, 2:17:51 PM6/20/19
to t...@schmidthole.com, ima...@googlegroups.com
Hi Tim,

We have an HTML5 tutorial that shows how to Create an Ad Countdown Timer, it will give you an idea of how you can implement it in your IMA SDK for iOS integration.

Tim Schmidt

unread,
Jun 20, 2019, 2:38:13 PM6/20/19
to Interactive Media Ads SDK
Riiiight... that's the same tutorial that was posted before. Just wondering about experience in a tvOS context, but I got it working.

Fernando Martínez

unread,
Sep 30, 2019, 7:24:49 AM9/30/19
to Interactive Media Ads SDK
Hi Tim,
I am trying to do the same for tvOS, how did u do to have the countdown timer?

thanks in advance
Regards
Nano

Tim Schmidt

unread,
Sep 30, 2019, 11:16:05 AM9/30/19
to Interactive Media Ads SDK
So first off, I created a top-level view in my storyboard for my countdown so I could visually style it.

Then, I ended up hooking into the IMAAdsManagerDelegate:adDidProgressToTime method to update the status. Here's the basic outline of my function:

// Check if we've already added the countdown view
if adCountdownView.superview == nil {
    adCountdownView
.frame.origin = CGPoint(x: view.safeAreaInsets.left, y: view.safeAreaInsets.top)
    adCountdownView
.circleProgressBar.setProgress(1, animated: false)
    view
.addSubview(adCountdownView)
}

// Update the progress
adCountdownView
.circleProgressBar.setProgress(1 - CGFloat(mediaTime / totalTime), animated: true)

If you're curious, I'm using the CircleProgressBar component.

Fernando Martínez

unread,
Sep 30, 2019, 11:30:14 AM9/30/19
to Interactive Media Ads SDK
Thank you!!!
Reply all
Reply to author
Forward
0 new messages