UnityPlugin-AVProVideo
UnityPlugin-AVProVideo copied to clipboard
Trigger Pause event when audio route changes on iOS
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.
Do you have a suggestion for detecting the change of state for the current AVPro version?
Currently you would need to poll IsPaused, but we agree an event would be better.
Paused and Unpaused events have been added