[Contact me directly][Android] Play Pause Issue if an IMA Ad has an overlay play/pause button

35 views
Skip to first unread message

jerry lam

unread,
Aug 20, 2025, 1:40:45 AMAug 20
to Interactive Media Ads SDK
Hi Team,

My app is using exoplayer IMA extension, similar to this example
https://github.com/googleads/googleads-ima-android/tree/main/ExoPlayerExample

*The AD tag can not be shared on the forum, can I just share the content of a vast xml?

And just the below difference in my app
 
//  disable exoplayer controller
playerView.setUseController(false);
// autoplay
player.setPlayWhenReady(true);

AdEventListener
if (eventType == AdEventType.PAUSED) {
  player.pause();
} else if (eventType == AdEventType.RESUMED) {
   player.play();
}

When I click the ad first time, it is paused but when I click again it is resumed and immediately paused again.(attached video) 

I find it works if I put it in 
VideoAdPlayerCallback,but the problem is 
onPause will also be called when
(skip button is clicked, ad btw ad,etc)
 
@Override
public void onResume(@NonNull AdMediaInfo adMediaInfo) {
  player.play();
}

@Override
public void onPause(AdMediaInfo adMediaInfo) {
  player.pause();
}

Your prompt reply would be greatly appreciated!

Regards,
Jerry
Screen_recording_20250819_094334.mp4

IMA SDK

unread,
Aug 20, 2025, 8:03:21 AMAug 20
to jerr...@gmail.com, ima...@googlegroups.com

Hi Jerry,

Thank you for reaching out to the IMA SDK Support team.

I reviewed the changes you mentioned and applied them to our sample project. By default, PlayerView has setUseController(true) along with showController(),which means the player automatically handles playback controls like play, pause.

Could you please help us understand the reason for manually controlling the player calling player.pause() and player.play() within the ad event callbacks, instead of relying on the built-in player controller?

To assist you further and investigate the issue more effectively, could you please share a sample project that reproduces the problem.

Kindly provide the requested details via Reply privately to author option.
 

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=500Ht00001u4ioBIAQ&entry.80707362=00330456

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.


Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-20 12:03:12Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u4ioB:ref" (ADR-00330456)



jerry lam

unread,
Aug 21, 2025, 4:15:17 AMAug 21
to Interactive Media Ads SDK
Hi Team,

Thanks for your reply!

My working project has its own controller layout,
which disables exoplayer default controller and handles play pause manually.

1.AdEvent.AdEventType.PAUSED <- Does it mean the case that user presses the pause btn only or have any other cases?

2. I just want to achieve the following effect:
if an IMA Ad has an overlay play/pause button,
when user presses the overlay pause btn, the ad pauses, when user presses the overlay play btn, the ad resumes

Is it safe to implement like this
pause player in  AdEventListener AdEventType.PAUSED  
resume player in  VideoAdPlayerCallback  onResume

AdEventListener
if (eventType == AdEvent.AdEventType.PAUSED){
  player.pause();
}

VideoAdPlayerCallback
@Override
public void onResume(@NonNull AdMediaInfo adMediaInfo) {
  player.play();
}


3. Is there any functions that I can capture when user clicks an overlay play/pause button only?


Regards,
Jerry

IMA SDK 在 2025年8月20日 星期三晚上8:03:21 [UTC+8] 的信中寫道:

IMA SDK

unread,
Aug 21, 2025, 7:55:31 AMAug 21
to jerr...@gmail.com, ima...@googlegroups.com

Hi Jerry,

Please find the answers to your questions below:

Question1: Does AdEvent.AdEventType.PAUSED only represent the case when the user presses the pause button, or are there other scenarios?
Answer: The AdEvent.AdEventType.PAUSED event is triggered when ad playback is paused. This can occur not only when the user presses the pause button but also in other scenarios— when the app goes to the background during ad playback and then returns to the foreground, the ad may enter a paused state.

Question2: Is it safe to pause the player in AdEventListener and resume it in VideoAdPlayerCallback.onResume()?
Answer: This appears to be a valid implementation. However, to confirm and investigate further, could you please share a VAST tag that includes overlay play/pause controls. This will help us reproduce the exact scenario and verify the behavior on our end.

You can utilize Reply privately to author option to provide VAST URL privately and reply back to us again.

Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-08-21 11:55:19Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u4ioB:ref" (ADR-00330456)



Reply all
Reply to author
Forward
0 new messages