UnityPlugin-AVProVideo icon indicating copy to clipboard operation
UnityPlugin-AVProVideo copied to clipboard

Android. The playback doesn't pause during the incoming call.

Open PopovYuriy opened this issue 1 year ago • 8 comments

Describe the issue The video playback doesn't pause during an incoming call on Android devices, while on an iOS device it works fine.

  • Unity version: 2022.3.40f1
  • AVPro Video version (number and edition (trial/core/ultra/enterprise)): 3.0.6 Core edition
  • Operating system version: 14
  • Device model: OPPO CPH2591

To Reproduce

  1. Run the app with the AVPro player.
  2. Play a video.
  3. Get an incoming call.

Logs Error Unity Exception: No such proxy method: UnityEngine.AndroidJavaProxy.onAudioFocusChange(System.Int32)

PopovYuriy avatar Aug 15 '24 15:08 PopovYuriy

Are you expecting the video be paused for the duration of the call, even if brought back into focus?

  1. Are you using Exoplayer or Android mediaplayer?
  2. Are you using Vulkan or OpenGLES?
  3. Can you reproduce it in a new project running only the mediaplayer demo scene?
  4. Is it reproducible on other android devices?
  5. Can you provide a full, unfiltered logcat in txt format?

I can't reproduce this in a new project using the mediaplayer demo. When answering the call and the app is out of focus, the video is paused. Playback will resume once the call has ended and the app is refocused. The video will also resume during the call if I bring the app back into focus, but the audio will not play. This is using Unity 2021.3.29 and AVPro Video version 3.0.8.

Chris-RH avatar Aug 16 '24 12:08 Chris-RH

Hi, Chris. Did the video pause during the incoming call popup is shown?

PopovYuriy avatar Aug 16 '24 12:08 PopovYuriy

It paused when I answered the phone and the app was automatically backgrounded. My device doesn't show backgrounded apps when on a call, unless you refocus them on purpose.

Chris-RH avatar Aug 16 '24 12:08 Chris-RH

Yes, it works for me too. The player works perfectly when the app loses focus. But losing audio focus doesn't work. Sorry for the not clear description of the issue. I meant the video doesn't pause when lose audio focus, for example during the incoming-call popup is shown. For example on iOS to works fine.

PopovYuriy avatar Aug 16 '24 13:08 PopovYuriy

So you wish it to be paused from the moment an incoming call pops up, even if it isn't answered?

Chris-RH avatar Aug 16 '24 13:08 Chris-RH

Right. As I mentioned before, iOS devices have this behavior.

PopovYuriy avatar Aug 16 '24 14:08 PopovYuriy

Hi @Chris-RH Would you happen to have any updates?

PopovYuriy avatar Aug 22 '24 11:08 PopovYuriy

I think we can accommodate this such that pausing videos rather than just muting them is the default behavior on Android. This will be included in the next release (v3.0.9). We are aiming to release it later this week.

Ste-RH avatar Aug 27 '24 15:08 Ste-RH

AVPro Video v3.0.9 has just been released. Do let us know if the issue has been fixed for you.

Ste-RH avatar Aug 30 '24 14:08 Ste-RH

NOTE: The fix used to address this issue caused #2026 and so a different fix has been applied for this issue now.

Ste-RH avatar Oct 10 '24 13:10 Ste-RH