I'm trying to play a video using FullscreenVideoView but i keep getting this error everytime that i try to play a stored video
Java.io.IOException: setDataSource failed.
File n = new File(getApplicationContext().getFilesDir()+"/Downloads/video9.mp4");
Log.e(TAG, "URL:" + n);
fullscreenVideoView.videoFile(n).enableAutoStart().fastForwardSeconds(5)
.rewindSeconds(5)
.addSeekBackwardButton()
.addSeekForwardButton();
There are bunch of reasons, why your dataSource doesn't work. Try to add logging:
File n = new File(getApplicationContext().getFilesDir()+"/Downloads/video9.mp4");
Log.e(TAG, "URL:" + n);
Log.e(TAG, "exists: " + n.exists());
fullscreenVideoView.videoFile(n).enableAutoStart().fastForwardSeconds(5)
.rewindSeconds(5)
.addSeekBackwardButton()
.addSeekForwardButton();
Probably file doesn't exist. It may be because of not granted permissions or the wrong way of file.
At first I would advise you ti check permissions. If you running your code on app on 6+ android, you must request permissions in runtime. In your case they would be: READ_EXTERNAL_STORAGE
, WRITE_EXTERNAL_STORAGE
.