[android] getContentProgress() and getAdContentProgress() still get call even app pause

112 views
Skip to first unread message

Brian Chu

unread,
Jul 29, 2015, 10:38:24 AM7/29/15
to Interactive Media Ads SDK
I put a debug printout inside getContentProgress() and getAdContentProgress() and to my surprise, they continue printing out even after the app pauses (e.g. put into the complete background).

I try calling adsManager.pause() inside onPause() but getAdProgress() still get called every seconds.

and I also check when IMA SDK ask the content to pause, getContentProgresss() still get called every seconds.

Given that we let adsManager know we pause, shouldn't IMA SDK stop calling get[Content|Ad]Progress() ?

Tyler Sidell (IMA SDK Team)

unread,
Jul 29, 2015, 4:09:17 PM7/29/15
to Interactive Media Ads SDK, brian.ch...@gmail.com
Hi Brian,

This is not necessarily the case.
  • getContentProgress() just gets an update on the progress of the video.  As of beta 12, getContentProgress should never return a null value.  
  • getAdProgress() gets an update for the progress of the ad.  This should also never return a null value.
Although the content/ad may be paused, these functions are still listening so that they can continue to monitor the progress when the app resumes.  Although you are seeing a printout, it doesn't necessarily mean that the values that these methods return are getting updated. 

Thanks,
Tyler Sidell
IMA SDK Team

Brian Chu

unread,
Jul 31, 2015, 2:18:58 PM7/31/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
- getContentProgress() and getAdProgress() are implemented correctly accordingly the JavaDoc. They never return null. You can see it in the Advance example. I verify base on what I saw with Advance example.

- I thought in Android, whenever an application put into background, it should minimize using resource & CPU consumption. A library should let the app tell it to stop pulling. Once the app resumes, it is perfectly fine to let the library pull again.

- This issue go away if I call adsManasger.destroy(), but I cannot do it because that means I have to create a new adsManager.

- There is no  adDisplayContainer.unsetPlayer(videoAdPlayer) call so I cannot unset VideoAdPlayer (which has the getAdProgress() call), none there is an AdsRequest.unsetContentProgressProvider())

- My understanding is that adsManager.pause() means asking IMA to pause the ad. and adsManager.resume() means asking IMA to resume the ad. Between pause() and resume(), why do IMA needs to monitor the content or ad progress? IMA can monitor the progress when the app resumes.

Tyler Sidell (IMA SDK Team)

unread,
Jul 31, 2015, 4:34:43 PM7/31/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Hi Brian,

Thanks for supplying this information.   Are you noticing any effect on ad playback?  Also, are you seeing the returned values for getContentProgress() and getAdProgress() update when the app is paused?  In other words, is the progress changing?

You are correct that adsManager.pause() makes a request to pause the ad, and adsManager.resume() makes a request to resume the ad. However, it is still necessary to monitor the content and ad progress in order to know the exact cue points to play the ad. 

We'll discuss with the rest of the team to see what can be done or improved. 


Thanks,
Tyler Sidell
IMA SDK Team

Brian Chu

unread,
Aug 5, 2015, 6:02:11 PM8/5/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
- There isn't any effect on the ad playback 

- I am not sure I understand the second question. When the app is paused (either during the content or the ad is playing). My implementation of getContentProgress() or getAdProgress() get called by the SDK, they return value reflecting their latest progress. For example, getContentProgress() returns VIDEO_TIME_NOT_READY as they are not playing and getAdProgress() returns VideoProgressUpdate object with current video time and video duration. And it was asked again and again and it returns the same values because it was paused.

Hope that helps, really want to see if there is any way to have SDK not calling the app continuously after the app is paused.

tsi...@google.com

unread,
Aug 6, 2015, 11:02:08 AM8/6/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Hi Brian,

Thank you for supplying more specifics about your use case.  This helps us to fully understand the issue that you are reporting.  We tried in the default settings for the Basic Example and did not see getContentProgress() get called in the background.  Would you be able to provide a snippet of your code so that we can see if there is something particular to your implementation?

Cheers,
Tyler Sidell
IMA SDK Team

Brian Chu

unread,
Aug 6, 2015, 5:54:35 PM8/6/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Sure. you're always welcomed: see https://github.com/brianchu/googleads-ima-android/tree/backgroundCall 
I add debug print out and change the ad to VMAP from the Advance example.

Please use VMAP as an example, don't use pre-roll. 

getContentProgress() will still get called in the background. 

and this is getting worst:

The IMA SDK will even call our OLD object's getContentProgress() method even the object no longer being used. 

Just by running the basic example and see all the print out calling from the IMA.

Tyler Sidell (IMA SDK Team)

unread,
Aug 7, 2015, 9:55:14 AM8/7/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Hi Brian,

I was able to reproduce this issue with the Advanced Example that you supplied with a VMAP tag.  I will discuss this with the rest of the team to see what can be done and will update this thread.

Thanks,
Tyler Sidell
IMA SDK Team

Brian Chu

unread,
Sep 7, 2015, 11:45:02 PM9/7/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Hi, just want to check if there is any progress on this issue. Thanks Tyler and your team working on it.
-brian

Tyler Sidell (IMA SDK Team)

unread,
Sep 8, 2015, 11:27:15 AM9/8/15
to Interactive Media Ads SDK, brian.ch...@gmail.com, ima-sdk-ad...@google.com
Hi Brian,

We are currently looking into this issue.  I will make sure to update this thread when we have more information.

Thanks,
Tyler Sidell
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages