0

I encrypt a video using AES and stored in the sd card . Now I'm able to decrypt the video and play but decryption is taking long time, so the I have to wait until whole video file get decrypted.

Is there any way by which I can decrypt and parallelly play the video without waiting for whole file decryption?

andreas
  • 15,414
  • 12
  • 68
  • 68
Vishnu Mishra
  • 3,326
  • 2
  • 23
  • 35

1 Answers1

1

One solution is to use ExoPlayer. I did it in my last project. I had some problem with the decription, but eventually I came up with a solution.

Basically you need to create your custom DataSource that gets data from your file, and on-fly decrypt those data and provides them to the Player. Here you can find the ExoPlayer documentation.

Here my question with my solution.

NOTE: Consider that my DataSource was written for ExoPlayer 1.5.9. Just two days ago has been released (major) a new version 2.0.0 where they changed a lot of stuff in the ExoPlayer. So if you want use the new one I can't garantee that my custom DataSource will work (despite I expect it will xD).

Community
  • 1
  • 1
GVillani82
  • 16,583
  • 29
  • 102
  • 167