I\'m trying to use ExoPlayer instead of MediaPlayer because it\'s a common bug that MediaPlayer returns wrong getCurrentPosition() and I need a substitute.
But I can\'t
The ExoPlayer demo app in github can be modified to play local files. To do that, edit https://github.com/google/ExoPlayer/blob/master/demo/src/main/java/com/google/android/exoplayer/demo/Samples.java file to add a new video set.
public static final Sample[] LOCAL_VIDEOS = new Sample[] {
new Sample("Some User friendly name of video 1",
"/mnt/sdcard/video1.mp4", DemoUtil.TYPE_OTHER),
new Sample("Some User friendly name of video 2",
"/mnt/sdcard/video2.mp4", DemoUtil.TYPE_OTHER),
};
To do that, edit https://github.com/google/ExoPlayer/blob/master/demo/src/main/java/com/google/android/exoplayer/demo/Samples.java file to add a new sample set.
sampleAdapter.add(new Header("Local Videos"));
sampleAdapter.addAll((Object[]) Samples.LOCAL_VIDEOS);