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

Trigger Pause event when audio route changes on iOS

Open christianYS opened this issue 3 years ago • 2 comments

When "Resume Playback After Audio Session Route Change" is set to OFF, the video player pauses automatically when an audio device is disconnected. At the moment there is no straightforward way to understand when this happens. It's desirable that whenever the video player is paused by some internal mechanism, the MediaPlayer component publishes an event, for example MediaPlayerEvent.EventType.Paused to reflect the video player's change of the state.

Describe alternatives you've considered It's possible to detect the change of state by checking it in every update. But it's already done in AppleMediaPlayer.Update(), implementing another check somewhere else would be redundant.

christianYS avatar Jan 11 '22 13:01 christianYS

Do you have a suggestion for detecting the change of state for the current AVPro version?

christianYS avatar Jan 12 '22 09:01 christianYS

Currently you would need to poll IsPaused, but we agree an event would be better.

kahnivore avatar Jan 12 '22 09:01 kahnivore

Paused and Unpaused events have been added

MorrisRH avatar Oct 31 '23 11:10 MorrisRH