My codenameone project has a mediaPlayer which plays videos once they are downloaded, in some instances when the network breaks the video is still saved on the device even though it is corrupt and when the player tries to play this video i get the 'can't play this video' dialog. How can i intercept this so it doesnt show the dialog and i can handle the error in the background, my code for the media player is below
video = MediaManager.createMedia(videostream, "video/mp4", new Runnable() {
@Override
public void run() {
videoIsPlaying = false;
videoCounter++;
}
});
video.setNativePlayerMode(true);
newmp = new MediaPlayer(video);
newmp.setAutoplay(true);
newmp.hideControls();
newmp.setHideNativeVideoControls(true);