RenderHeads / UnityPlugin-AVProVideo

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

Invalid url causes app crash on Android. #1209

Closed cseheon closed 2 years ago

cseheon commented 2 years ago

On Android, when I play a video with an invalid url, the app crashes. I want to receive an Error event when the user enters an invalid url, but the app crashes before that.

Unity version : 2021.3.1f1 AVPro : 2.5.2 (core) OS : Android Device : Galaxy Note 10

[ AVPro Android Settting ] Video API : Exo Player Use OES Rendering : enabled (It's the same when you disable it)

[ Unity Player Settings ] Color Space : Linear Multithreaded Rendering : enabled Scripting Backend : IL2CPP Api compatibilty level : .NET Standard 2.1 Managed Stripping Level : Disabled

Chris-RH commented 2 years ago

Hi @cseheon

  1. Do you have a crash log?
  2. Do you mean invalid characters in the url, a url that does not exist or something else?
cseheon commented 2 years ago

Hi @Chris-RH

I was able to solve this problem in a few tests. I found that MediaPlayer is sending ReadyToPlay event even after sending Error event. When I receive the ReadyToPlay event in my code, it seems that the problem was that I tried to play unconditionally. I was able to solve this problem by modifying my code to ignore all processing after receiving the Error event. thank you

Ste-RH commented 2 years ago

I am a little interested in this one. If I try to open a fake video URL I do not get ReadyToPlay. I do get StartBuffering/FinishedBuffering though.