What is the best way to dispose/destroy of IMA (HTML SDK)

64 views
Skip to first unread message

Hamish Howley-Rouse

unread,
Mar 5, 2018, 8:17:41 PM3/5/18
to Interactive Media Ads SDK
I am trying to keep the memory resources to a minimum and free up resources when the ad is no longer necessary.

What i would like to do is, once an ad has been fired the event for either ad finished or ad error, to remove all instances of the Ad component.

Will the following remove all instances of that ad on the page or is there a better approach:

adDisplayContainer.destroy()
adsLoader.destroy()
adsManager.destroy()

Cheers

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

unread,
Mar 6, 2018, 1:22:40 AM3/6/18
to ima...@googlegroups.com
Hi Hamish,

What you provided should be sufficient enough. However, kindly note that you would have to call contentComplete() on your AdsLoader before destroying it to signal the SDK accordingly to play any post-rolls.

Regards,
Joshua Lagonera
IMA SDK Team

--
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+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.
Message has been deleted

Hamish Howley-Rouse

unread,
Mar 7, 2018, 9:59:17 PM3/7/18
to Interactive Media Ads SDK
Awesome - thanks for the tip

Reply all
Reply to author
Forward
0 new messages