Closed blevok closed 4 years ago
So that error comes directly as the file is opening and it fails right away - that is why there's no event for it. Sort of like if you try to open a file that doesn't exist.
When you call OpenVideoFromFile() you should check the return value - if it returns false then it failed to find/load the file. The event is used for problems with loading once the media has been found.
Does that help?
Oh I didn't realize OpenVideoFromFile returned a bool. That makes sense. Thank you.
I'm having an issue with the error event. I need to know when a video fails to load, so i can close my spinny loading indicator, show an error message, and do other stuff. I have all events selected in the media player component, and every other event that i use works fine, but the error event only works in some cases.
Here is my code:
FirstFrameReady works, and the code in the callback executes. Same for closing, metadataready, and others. When i try to load a video that has no issue, but just isn't a supported format or something, it fails, and the error event fires. But i also need to catch issues like corrupted/broken videos. To test this, i made a text file and named it fake_video.mp4 and tried to load it. Of course it fails, and error logs are generated, but the event does not fire.
Here is what i see in the log after closing a good video, and opening the bad video:![projectconsole](https://user-images.githubusercontent.com/13594103/90194058-f4793c00-dd8b-11ea-8535-6395964547dd.png)
I'm using unity 2019.3.2f1 on windows 10, and avpro 1.11.2 I see this issue in the android build and in the editor.