[IMA SDK for HTML5]mediacontroller persists after destroy adDisplayContainer

107 views
Skip to first unread message

pineapplevine1

unread,
Jun 27, 2023, 1:16:10 AM6/27/23
to Interactive Media Ads SDK
Hello,

I have followed the instructions provided in the this link to implement the destroy function of the ima sdk.
https://groups.google.com/g/ima-sdk/c/YId2tlnRyto/m/zebKpbUNCAAJ

After running ads in the Android Chrome browser and executing the destroy function,
the ad is interrupted, but the mediacontroller persists.
If I omit the destroy function for adDisplayContainer, the mediacontroller gets removed.
My objective is to effectively destroy the adDisplayContainer and ensure the simultaneous removal of the mediacontroller.
Are there any recommended approaches or solutions to accomplish this?

Regards

webDisplay.pngmediaPlayerDisplay.png

IMA SDK

unread,
Jun 27, 2023, 5:41:20 AM6/27/23
to pineapp...@gmail.com, ima...@googlegroups.com

Hi, 

Thank you for reaching out to the IMA SDK Forum.

It appears that you have already followed the implementation in the forum thread you shared which should be the right approach. Please note that as per this documentation (https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdDisplayContainer) when an instance of Class: AdDisplayContainer is created, it creates an IFRAME in the containerElement and loads the SDK core. This IFRAME must be preserved in order for the SDK to function properly. Once all ads have been played and the SDK is no longer needed, use the destroy() method to unload the SDK. This method destroys internal state and previously created DOM elements. The IMA SDK will be unloaded and no further calls to any APIs should be made.

For us to further investigate and provide more appropriate guidance, could you share with us the following information?

  • sample app where issue is reproducible
  • screen recording of the behavior (mirroring the steps to replicate the issue)
  • VAST Ad Tag url used for testing

You may send the requested details privately via the "Reply To Author" button or with the below process.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002mXrmAQAS&entry.80707362=00186092

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

Reference Link:

This message is in relation to case "ref:_00D1U1174p._5004Q2mXrmA:ref"

Thanks,
 
Google Logo IMA SDK Team


Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

pineapplevine1

unread,
Jun 27, 2023, 9:54:57 PM6/27/23
to Interactive Media Ads SDK
Hello,

Thanks for reply.

For some reason I could not attach the zip to the reply, so I attached it to the Google Form.
Here are the instructions to run it:

1.Open the sample web page in the Android Chrome browser.
2.Click on the play button.
3.Click on the destroy button.
4.Verify the mediacontrol screen.

Please confirm

Regards.

IMA SDK

unread,
Jun 29, 2023, 3:42:58 AM6/29/23
to pineapp...@gmail.com, ima...@googlegroups.com
Hello,

Thank you for responding back. However, it appears that the files that you referring to were not uploaded successfully. Could you kindly provide the sample project once again using the steps below?


1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002mXrmAQAS&entry.80707362=00186092

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2mXrmA:ref"


Thanks,
 
Google Logo IMA SDK Team


applevine1 pine

unread,
Jul 5, 2023, 12:21:04 AM7/5/23
to IMA SDK, ima...@googlegroups.com
Hello.

Sorry, I uploaded the file again via Google Form.
Could you please check it?

Regards.

2023年6月29日(木) 16:42 IMA SDK <ima...@forumsupport.google>:

IMA SDK

unread,
Jul 5, 2023, 7:15:31 AM7/5/23
to pineapp...@gmail.com, ima...@googlegroups.com

Hi,

Thank you for providing the requested information.

As mentioned, once all ads have been played and the SDK is no longer needed, you can use the destroy() method to unload the SDK. You should also call the contentComplete() on your AdsLoader before destroying it. You can refer to the SDK architecture here: https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/architecture

However, please note that the IMA SDK can only control the ad player, if there is still content playing on your video player then the mediacontroller will persist, as also observed on our sample app that the mediacontroller disappears once the content has finished playing.

Let me know if you have any questions.
 

pineapplevine1

unread,
Jul 10, 2023, 2:24:34 AM7/10/23
to Interactive Media Ads SDK
Hello, 
Thank you for your response.

Fixed as below, but the problem still occurs.
==========
  if (this.adsLoader_) {
    this.adsLoader_.contentComplete();
    this.application_.log("content Complete");
    this.application_.log("adsLoader destroy");
    this.adsLoader_.destroy();
    this.adsLoader_ = null;
  }
==========

Even in our app, if we omit adDisplayContainer.destroy(), the mediacontroller will be deleted.
adDisplayContainer.destroy() does not exist in your sample app, doesn't it need to be called?

Regards.
2023年7月5日水曜日 20:15:31 UTC+9 IMA SDK:

IMA SDK

unread,
Jul 10, 2023, 7:42:09 AM7/10/23
to pineapp...@gmail.com, ima...@googlegroups.com
Hi pineapplevine1,

Thank you for responding back. Would you able to share to us your test project? This will greatly help us to provide precise guidance as it will enable us to have full visibility with your implementation. Kindly share it to us using the following steps below:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=5004Q00002mXrmAQAS&entry.80707362=00186092

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2mXrmA:ref"


Thanks,
 
Google Logo IMA SDK Team


pineapplevine1

unread,
Jul 10, 2023, 10:36:51 PM7/10/23
to Interactive Media Ads SDK
Hello IMA SDK Team,

Same as uploaded the other day, but uploaded again.

If playback and destroy without modifying the source code, the mediacontroller will persist.
But if you delete adDisplayContainer.destroy() in ads.js: 95-96, the mediacontroller will be removed.

Thanks.

2023年7月10日月曜日 20:42:09 UTC+9 IMA SDK:

IMA SDK

unread,
Jul 11, 2023, 3:59:34 AM7/11/23
to pineapp...@gmail.com, ima...@googlegroups.com
Hello,

Thank you for providing your sample app. I was able to check your app and can confirm that your implementation is fine. As mentioned on this thread, if there is still content playing on your video player then the mediacontroller will persist.

pineapplevine1

unread,
Jul 31, 2023, 3:02:51 AM7/31/23
to Interactive Media Ads SDK
Hello, 
Thank you for your reply.
want to do is destroy the video content using a modal,
through the use of the back button during ad playback.
When running the sample code, the media controller is not deleted when using adDisplayContainer#destroy.
In such a case, should I not use the destroy function of adDisplayContainer? 

Regards.
2023年7月11日火曜日 16:59:34 UTC+9 IMA SDK:

IMA SDK

unread,
Jul 31, 2023, 8:25:21 AM7/31/23
to pineapp...@gmail.com, ima...@googlegroups.com
Hello,

Yes, you're correct.
Reply all
Reply to author
Forward
0 new messages