RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
232 stars 28 forks source link

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

Closed PopovYuriy closed 1 week ago

PopovYuriy commented 1 month ago

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

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)

Chris-RH commented 4 weeks ago

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.

PopovYuriy commented 4 weeks ago

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

Chris-RH commented 4 weeks ago

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.

PopovYuriy commented 4 weeks ago

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.

Chris-RH commented 4 weeks ago

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

PopovYuriy commented 4 weeks ago

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

PopovYuriy commented 3 weeks ago

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

Ste-RH commented 2 weeks ago

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 commented 2 weeks ago

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