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
  • 16,357
  • 12
  • 72
  • 76
Vishnu Mishra
  • 3,683
  • 2
  • 25
  • 36

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
  • 17,196
  • 30
  • 105
  • 172