How to play an encrypted Video or Audio file from a remote server or a local file on Android (Part…
['Mohsen Mousavi']
ProAndroidDev - Medium
What is an ExoPlayer DataSource?
Stream an Encrypted Local MediaFileTo stream an encrypted local media file, we’ll create a custom DataSource called FileCipherEncryptedDataSource .
Inject DataSource inside the ExoPlayerNow that we have implemented our FileCipherEncryptedDataSource the easiest part is just remaining.
Inject your DataSource inside the ExoPlayer’s DataSource.Factory as follows:Use EncryptedDataSourceFactory to instantiate your previously created DataSource.
In Part 2, we’ll dive into streaming encrypted media files from a remote server on the fly, expanding your knowledge of secure media playback.