I want to catch error "Can't Play this video" by making setOnErrorListener: return true .
As the documentation says If no listener is specified, or if the listener returned false, Video View will inform the user of any errors., so I'm assuming if you set one and return true it will not show the user error. I have seen some code in Java Android , But I am not that great with java. I would appreciate if Some one can help me with Links in Xamarin or could explain me How to use it with working example.
Code in Android was like :
video.setOnErrorListener(new OnErrorListener()
{
@Override
public boolean onError(MediaPlayer mp, int what, int extra)
{
Log.d("video", "setOnErrorListener ");
return true;
}
});
You can try this way by implementing IOnErrorListener
interface
public class MainActivity : AppCompatActivity, IOnErrorListener
{
public bool OnError(MediaPlayer mp, [GeneratedEnum] MediaError what, int extra)
{
// Do Something here because error happened
}
}