Playing encrypted video files using VideoView

大兔子大兔子 提交于 2019-11-30 09:45:36

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();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!