Android decrypts and plays mp4 at runtime

I am working on an application that shows a series of mp4 files. So that users do not just copy them from the SD card where they are stored, we want to encrypt them (using DES at the moment). Most encrypted files, such as images and xml, can be easily decrypted at runtime, but I have problems with the video. All this must be done in memory, since decrypting it to an SD card before using it makes the whole idea useless.

Anyone have any ideas on how I can do this? Files are also quite large, so keep in mind memory limitations, and this should be minimal for Android 2.3.3.

+4
source share
1 answer

Streaming is another way of what you call "everything will be done in memory." You can feed the VideoView using the file path or Uri for the stream. libmedia is a library that I developed to accurately address this function.

Sort of:

mServer = new LocalSingleHttpServer(); mServer.setCipher(myGetCipher()); mServer.start(); path = mServer.getURL(path); mVideoView.setVideoPath(path); mVideoView.start(); 

Remember that the local HTTP server is not so simple as it has to deal with leaps due to the possible VideoView.seekTo ().

+3
source

Source: https://habr.com/ru/post/1402411/


All Articles