RenderHeads / UnityPlugin-AVProVideo

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

Binding to the events of the media player instance doesnt behave the same on editor and android device #1895

Closed SplunkyDev closed 3 days ago

SplunkyDev commented 2 weeks ago

Describe the issue Bind to the MediaPlayer events to check to state of the media actions. The logs printing the event types are not matching. The editor event types and device event types that are being logged are different even though the actions are the same. (by actions I mean Play,Pause, Seek ahead, Seek back)

  m_MediaPlayer.Events.AddListener(OnMediaPlayerEvents); //m_MediaPlayer is the reference to the Media Player component in the scene

//this is the sample code from the docs, I have used the event type to handle certain functionality. But current just show for debug log 
  private void OnMediaPlayerEvents(MediaPlayer mp, MediaPlayerEvent.EventType eventType, ErrorCode code)
 {
     Debug.Log("[MediaPlayer] " + mp.name + " generated event: " + eventType.ToString());
     if (eventType == MediaPlayerEvent.EventType.Error)
     {
         Debug.LogError("Error: " + code);
     }
}

Your Setup (please complete the following information):

To Reproduce Version 2.9.3

  1. Play video-> Pause video -> m_MediaPlayer.Control.SeekToFrameRelative(relativeFrame); //in this example -3 to +3
  2. Play video : Notice on the android device Unpause will not be called it calls StartedSeeking and the FinishedSeeking

Version 3

  1. Play video-> Pause video -> m_MediaPlayer.Control.SeekToFrameRelative(relativeFrame); //in this example -3 to +3
  2. While Seeking on the editor StartedSeeking and FinishedSeeking is called but on the device StartedBuffer and FinishedBuffer is called
Ste-RH commented 2 weeks ago

v2.x is now deprecated and we will no longer be investigating/issuing fixes/updates.

Regarding v3.x, we addressed a seeking/finished event issue in v3.0.2. What version of 3.x are you testing here? Also, what API path are you using (MediaPlayer or ExoPlayer) ?

SplunkyDev commented 2 weeks ago

My apologies for the late response.

image

As you can see its version 3.0.2. I have used the MediaPlayer path as you can see in the code snippet shared in the ticket

MorrisRH commented 1 week ago

The finished seeking event wasn't being fired correctly on Android. This will be fixed in the next release (version 3.0.4).

Chris-RH commented 1 week ago

AVPro Video version 3.0.4 has been released. Please let us know if it has not fixed your issue.