Page 1 of 1

Android libvlc Error handler for load errors of differrent media types

Posted: 08 Mar 2021 23:38
by gecko19
Hello All,

I am new to the forum and I am hoping I am asking the right questions.

I have embedded libvlc in my Android app and it works perfect!
However, I wish to know if there are any android libvlc APIs I can use to determine if a media file can be played back without errors. I have this issue with some files where playback of the file causes a crash, I would like to warn the user that playing the content will cause a crash.

I used the MediaPlayer.setEventListener to listen for errors, yet no MediaPlayer.Event.EncounteredError are generated for these files.
Any ideas how I could handle this issue with differrent media gracefully.

Thanks,
G.

Re: Android libvlc Error handler for load errors of differrent media types

Posted: 09 Mar 2021 03:28
by mfkl
I wish to know if there are any android libvlc APIs I can use to determine if a media file can be played back without errors.
No. How would that be possible without playing the file?

The correct way would be to report the crash, and fix it.

Re: Android libvlc Error handler for load errors of differrent media types

Posted: 11 Mar 2021 15:35
by gecko19
Hello Mkfi,

Thanks for getting back to me. Sorry I did not clarify, I am able to load the video and start playback - however, while playing the video, libvlc crashes and I was hoping to get an error notification from MediaPlayer.EventListener registered to org.videolan.libvlc.MediaPlayer.setEventListener().

Any ideas why I am not getting any errors before the crash, I am sure the content is the culprit here - hoping there would be some mechanism I could use.

Thanks,
G.

Re: Android libvlc Error handler for load errors of differrent media types

Posted: 15 Mar 2021 02:18
by mfkl
Any ideas why I am not getting any errors before the crash, I am sure the content is the culprit here - hoping there would be some mechanism I could use..
Maybe it crashes before the event is sent, maybe no event is sent. Do share the full crash logs and media file if possible (and libvlc version used).