I am using LibVLC in my own project. I am providing a HD tutorial video with my app, which, sadly, put me way over the 50Mb limit of the Play Store, which means I have to put the video in an apk expansion. To sum up, the apk expansion is a .obb file, which is a zip file, and can be uncompressed, so that, in theory, you can easily read what's inside without uncompressing it.
Here is how you would do with the stock MediaPlayer (ZipResourceFile and ApkExpansionSupport are in libraries provided by Google):
Code: Select all
ZipResourceFile expansionFile=null;
try {
expansionFile = APKExpansionSupport.getAPKExpansionZipFile(getApplicationContext(),3,0);
AssetFileDescriptor fd = expansionFile.getAssetFileDescriptor("test.mp4");
MediaPlayer mPlayer = new MediaPlayer();
mPlayer.setDataSource(fd.getFileDescriptor(),fd.getStartOffset(),fd.getLength());
mPlayer.prepare();
mPlayer.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I tried to look into LibVLC's code, but I have a hard time following the execution path of how the track infos are acquired, let alone how a video is played.
So here is the question: do you think there would be a somewhat easy way to add support for a method akin to setDataSource, or would that take way too much time ?
The back-up solution is to uncompress the video before reading it. Sadely, it means duplicating the content, which means lost memory for the user (Google recommend not deleting/modifying the obb file).
Thanks.