Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Playing encrypted video files using VideoView

Does android native "VideoView" video rendering widget plays encrypted video files?
And if yes then how to play it and what all the APIs.
I have gone through this link i don't find anything related playing encrypted video.

Is it that i need to decrypt my video and then pass it to VideoView?

like image 683
User7723337 Avatar asked Feb 12 '13 11:02

User7723337


1 Answers

VideoView can't play an encrypted video, you have to decrypt it yourself. There are roughly two ways:

  1. generate a temporary clear file from the encrypted one, but this has some inconveniences: a delay before to start the playing and an exposure of the contents in clear.
  2. use a streaming scheme, with a local http server.

libmedia is a library developed to precisely address this feature.

Something like:

mServer = new LocalSingleHttpServer();
mServer.setCipher(myGetCipher());
mServer.start();
path = mServer.getURL(path);
mVideoView.setVideoPath(path);
mVideoView.start();
like image 145
libeasy Avatar answered Oct 20 '22 18:10

libeasy