Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - ExoPlayer 2 play DRM (widevine) offline

I'm trying to implement offline DRM support for ExoPlayer 2 but I have some problems.

I found this conversation. There is some implementation for ExoPlayer 1.x and some steps how to work that implementation with ExoPlayer 2.x.

I have I problem with OfflineDRMSessionManager whitch implements DrmSessionManager. In that example is DrmSessionManager imported from ExoPlayer 1.x. If I import it from ExoPlayer 2 then I have a problems to compile it. I have a problem with @Override methods (open(), close(), ..) which are NOT in that new DrmSessionManager and there are some new methods: acquireSession(), ... .

like image 983
Pepa Zapletal Avatar asked Oct 30 '25 16:10

Pepa Zapletal


1 Answers

With the latest release of ExoPlayer 2.2.0 , it provides this facility inbuilt in ExoPlayer. ExoPlayer has a helper class to download and refresh offline license keys. It should be the preferred way to do this.

OfflineLicenseHelper.java
/**
 * Helper class to download, renew and release offline licenses. It utilizes {@link
 * DefaultDrmSessionManager}.
 */
public final class OfflineLicenseHelper<T extends ExoMediaCrypto> {

You can access the latest code from the ExoPlayer repo

I created a sample application for Offline playback of DRM content.You can access it from here

like image 95
theJango Avatar answered Nov 02 '25 06:11

theJango



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!