RenderHeads / UnityPlugin-AVProVideo

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

Video playback won't start on android UGUI #103

Closed AconitumNapellum closed 5 years ago

AconitumNapellum commented 5 years ago

Having issues rendering videos on Android using the Display UGUI component. FirstFrameReady seems to never fire, and video doesn't get displayed. Can't even hear audio. Using OpenGLES3 and tried with MediaPlayer and ExoPlayer.

To Reproduce

  1. Download project files (since it's probably something wrong with my project, tried ugui demo scene on the same device and it works)
  2. Create a folder named "MediaFolder" in the android persistent data path (/storage/emulated/0/Android/data//files) and drop some mp4 files in it
  3. Run the app

Logs https://pastebin.com/hLGcFbwY

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Sending project to unitysupport@renderheads.com

Ste-RH commented 5 years ago

Thanks for reporting the issue you are encountering. We will certainly try our best to get to the bottom of it. I have a couple of questions, if you don't mind...

Have you tried loading a video out of the StreamingAsset folder, rather than directly off the SSD?

Do you have 'Write Permissions' set to 'External (SDCard) in your 'Player Settings>Other Settings->Configuration' ?

AconitumNapellum commented 5 years ago

Hi, tried to load a video from streamingassets to no avail already. Didn't try to set write permissions to external though. Tried it now, still isn't working. Tablet doesn't have an sd card anyways, so app is installed internally. If you have other questions i'll be happy to answer you!

AndrewRH commented 5 years ago

So it's not firing that FirstFrameReady event because on Android they don't support displaying the first frame when the video is loaded but not played. We have an option for this:

image

If you enable the poster frame, then when the video loads it will internally issue a play and pause command which will make the first frame display.

So you could do this, or you could also just set the MediaPlayer to auto-play.

I hope this helps. Closing this issue now.

Ste-RH commented 5 years ago

Just to jump in and add some info here. As of the next version (1.10.0), the ExoPlayer API path will not have this option...because you will get poster frames by default. MediaPlayer API path will still have this option if it is desired.