IMA SDK ANDROID : How to dispose of ContentProgressProvider ?

427 views
Skip to first unread message

Juan Carlos Ospina Gonzalez

unread,
Oct 15, 2015, 12:19:40 PM10/15/15
to Interactive Media Ads SDK
Hello,

I have implemented the IMA SDK for Android and i have some mid rolls setup and they are working well. 

However i notice that when the Activity finished, the ContentProgressProvider object that i have set, it still firing events (I can see this in  logcat) and i am afraid that this is causing my Activity to leak.

I have tried the following to no avail in the onDestroy() method of my Activity

//clean up ads manager
if(mAdsManager != null){
   
mAdsManager.destroy();
}

if(mAdRequest != null) {
   
mAdRequest.setContentProgressProvider(null);
    mAdRequest = null;
    mContentProgressProvider = null;
}

This is the instance

// create a ContentProgrestestsProvider
ContentProgressProvider mContentProgressProvider = new ContentProgressProvider() {
   
@Override
    public VideoProgressUpdate getContentProgress() {
       
Log.d(TAG, "contentProgressProvide.getContentProgress()");
        if(mVideoPlayer == null){
           
Log.d(TAG, "VideoProgressUpdate.VIDEO_TIME_NOT_READY");
            return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
        }
       
if(mIsAdPlayerActive || mVideoPlayer.getDuration() <= 0){
           
Log.d(TAG, "VideoProgressUpdate.VIDEO_TIME_NOT_READY");
            return VideoProgressUpdate.VIDEO_TIME_NOT_READY;
        }
       
VideoProgressUpdate update = new VideoProgressUpdate(mVideoPlayer.getCurrentPosition(), mVideoPlayer.getDuration());
        Log.d(TAG, "VideoProgressUpdate: "+update);
        return update;
    }
};

How do i get this object to stop getting called?

Tyler Sidell (IMA SDK Team)

unread,
Oct 15, 2015, 4:17:48 PM10/15/15
to Interactive Media Ads SDK
Hi Juan Carlos,

Thanks for supplying your code snippet. First, can you clarify exactly what you mean by "when the activity finishes"? Do you mean when the playback (ad and/or content) finishes, or when the app activity is paused/destroyed?

Can you also confirm if you can reproduce the issue in our sample examples?  We've tested a VMAP ad tag using our example apps, and during content playback ContentProgressProvider gets called which is normal.  When the postroll ends, this object is no longer called and we see VideoProgressUpdate.VIDEO_TIME_NOT_READY instead.

If you can, could you also supply us with an ad tag?  Let us know if you are using the latest Android SDK version.

Cheers,
Tyler Sidell
IMA SDK Team

Juan Carlos Ospina Gonzalez

unread,
Oct 20, 2015, 5:26:27 AM10/20/15
to Interactive Media Ads SDK
Hello,

Thanks for your reply.

I mean when the Activity is destroyed. I also see the VideoProgressUpdate.VIDEO_TIME_NOT_READY being called, but, shouldn't it stop polling? isn't it a reference that will keep the Activity in memory even when it has been destroyed?

Tyler Sidell (IMA SDK Team)

unread,
Oct 20, 2015, 11:06:03 AM10/20/15
to Interactive Media Ads SDK
Hi Juan Carlos,

We weren't able to reproduce your issue on our advanced example (with the code you provided). When we sent the app to the background, we saw VIDEO_TIME_NOT_READY get called, which is expected. Once we sent the app back to the foreground, getContentProgress() updated. 

How are you forcing onDestroy to get called? There is no guarantee in Android that onDestory will be called. When we close out of the app altogether (onStop getting called) we do not see ContentProgressProvider called at all.

Would you mind sending us your project so that we can take a look?  You can hit the reply privately to the author button on the top right dropdown.  Can you also send us specific steps to try to reproduce the issue? 

Thanks,

Tyler Sidell
IMA SDK Team

r...@jwplayer.com

unread,
Sep 14, 2016, 11:13:01 AM9/14/16
to Interactive Media Ads SDK
Hi Tyler and Juan Carlos,

We are seeing the same issue in our SDK.
As soon as we provide an AdsRequest with a ContentProgressProvider, IMA will keep polling it forever, essentially causing a memory leak.

Even calling AdsManager.destroy() or passing null to AdsRequest.setContentProgressProvider() doesn't stop IMA from polling.
What can we do to stop IMA from polling for content progress?

At this point of time we workaround this issue by always providing the same instance of a ContentProgressProvider, but we still end up leaking that instance.

We are looking forward to a solution.

Thanks,
Rik

Vu Chau (IMA SDK Team)

unread,
Sep 14, 2016, 1:08:30 PM9/14/16
to Interactive Media Ads SDK
Hi Rik,

Thanks for following up with this case.  I'm not seeing the continual polling here when I set the ContentProgressProvider and call getContentProgress().  Could you share with us some code snippets (preferably a zipped debug build) that shows the content progress polling?

Thanks,

Vu Chau
IMA SDK Team

Tsai HuanChih

unread,
May 10, 2018, 7:15:24 PM5/10/18
to Interactive Media Ads SDK
I am still seeing this behavior in the latest V3.8.2 Android SDK.  Here is a project that can re-produce it. 


Just exit the app right after the playback starts and look for "ImaExample" messages

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

unread,
May 11, 2018, 1:10:48 PM5/11/18
to ima...@googlegroups.com
Hi there,

We were able to reproduce this issue and thank you for providing the sample app. I have shared this with the team and we will provide updates via this thread as soon as the team gets back on this.

Regards,
Deepika Uragayala
IMA SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
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

Jin Wang

unread,
Sep 18, 2018, 2:23:27 AM9/18/18
to Interactive Media Ads SDK
Hey Deepika,

I'm also having this issue and I'm able to reproduce this using the Google IMA SDK 3.9.4 Sample project with our custom ad tag.

Can you please let me know when this will be fixed? This seems to be there for at least 2 years already according to another post with the similar issue.

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

unread,
Sep 18, 2018, 7:08:23 AM9/18/18
to ima...@googlegroups.com
Hi Jin,

I'm Deepika's colleague and I'll be assisting you on this. Could you provide to us the custom Ad Tag you are using when you encountered this?

On the other hand, the team is still actively investigating and there is no definite timeline regarding this concern.

Regards,
Steven Balan
IMA SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Gourav goyal

unread,
Feb 6, 2020, 1:37:00 AM2/6/20
to Interactive Media Ads SDK
Hi Juan Carlos Ospina Gonzalez
I am trying to implement midroll using ima sdk android and using getContentProgress() method to log video progress update..But i am not getting callback here.
Did u face this problem.
Thanks
Screenshot is attached for your reference.

Screenshot 2020-02-06 at 12.50.37 AM.png

IMA SDK

unread,
Feb 6, 2020, 3:58:00 AM2/6/20
to gouravg...@gmail.com, ima...@googlegroups.com

Hi Gourav,

 

Thanks for your message. However, it seems like your concern is the same as your previous email with the subject: "CurrentProgressProvider", which is currently being handled. With this, could you confirm that this is the same, so I can tag this one as duplicate and we'll continue our conversation on the other thread?

 

Regards,

Sherwin Diesta

IMA SDK Team



ref:_00D1U1174p._5001UV05Q7:ref

Gourav goyal

unread,
Feb 7, 2020, 4:06:01 AM2/7/20
to IMA SDK, ima...@googlegroups.com
Yes, it is the same
Reply all
Reply to author
Forward
0 new messages