I am using the Exoplayer Demo app and want to preload a MP4 video from SD card. I have tried out the implementation from this post, but it does not work. There is no such class
For those who want to play a video from assets using ExoPlayer 2 here is a way:
String playerInfo = Util.getUserAgent(context, "ExoPlayerInfo");
DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(
context, playerInfo
);
MediaSource mediaSource = new ExtractorMediaSource.Factory(dataSourceFactory)
.setExtractorsFactory(new DefaultExtractorsFactory())
.createMediaSource(Uri.parse("asset:///your_video.mov"));
player.prepare(mediaSource);