I am using ExoPlayer to play Media files(mp4s .h264 encoded) from the SD card of a device. Some of the files are DES encrypted. I can decrypt the files and get back an inputStream, but then I am unsure of how to play this inputStream using ExoPlayer. Any help would be appreciated.
protected void playVideo(File file) {
InputStream is;
if (file.getName().endsWith(".DES")) {
is = FileManager.decryptFile(file);
//what to do with this input stream?
}
Uri uri = Uri.parse(file.getAbsolutePath());
if (mPlayer != null) {
mPlayer.release();
}
mPlayer = new VideoPlayer(getRendererBuilder(uri));
mPlayer.addListener(this);
if (mLastPosition > 0) {
mPlayer.seekTo(mLastPosition);
}
mPlayer.prepare();
mPlayer.setSurface(mSurface);
mPlayer.setPlayWhenReady(true);
}