I have video file loaded in the RAM and wanted to make the MediaPlayer to use the information from RAM to play the video. I've done this in Windows by directly using VLC's APIs. But I'm not sure whether its possible to use this in Android. MediaPlayer accepts either file or Internet Stream as input, but its not documented to support RAM. Have anyone tried this?
It is not a good idea to load videos on to the RAM. There are many devices with a very low amount of RAM. Always use temp folders for such needs and clear it when you exit the app, if you don't want to keep it.
This is how to create a temporary file.
File outputDir = context.getCacheDir(); // Gets the cache dir, which is a temp directory.
File outputFile = File.createTempFile("video", "mp4", outputDir);
Then open it with android media player.