Play encrypted video in exo player android?


Play encrypted video in exo player android?



I want a play encrypted video which is on my server . i want to play it on exo player . in a sample provided by google on https://github.com/google/ExoPlayer is play only you tube videos. i had tried using change the uri in https://github.com/google/ExoPlayer/blob/master/demo/src/main/java/com/google/android/exoplayer/demo/Samples.java file . but it is not worked may be beacuse my video is encrypted . So how can i play my encrypted video.





found any thing usefull?
– Nasrudeen
Jan 27 '16 at 6:47




1 Answer
1



It's an old question but I hope this answer will help.



encrypted video



There are a number of ways a video/media file can be encrypted. It can be a simple AES 128 encryption or a more standard DRM protection can be provided.Last but not least Your own custom encryption can also be done. Let's cater all one by one.



AES 128 : AES is a old standard for encryption and good thing is that Exo Player supports that out of the box.
Your manifest/master file must have the ContentProtection tag rest ExoPlayer will take care. It will hit your server where You have hosted the key for decryption of the content.



DRM : DRM is all about content protection. There are multiple companies which provide DRM license. Like Google's Widevine, Apples' FairPlay or Microsoft's PlayReady.
ExoPlayer supports widevine out of the box. You need to provide the license url to ExoPlayer and rest it will take care.



Check out this sample for Widevine Online/Offline content playback using ExoPlayer



Your own encryption : This is a little bit trick and should be avoided. The reason being in this case mostly You have to decrypt the video on the device first then it will be played by the media player like any local video/media file. You have to write the logic to retrieve the decryption key, decrypt the content and then play it like any local video.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV