Injecting DrmSessionManager via DownloadHelper.createMediaSource()
With the 2.11.0 change of injecting the DrmSessionManager into the MediaSource (with the .setDrmSessionManager() ) there doesn't seem to be a way to set this when creating the mediasource for offline playback with DownloadHelper.
I have until now created a CacheDataSourceFactory and injected that and the DownloadRequest. Like this:
mediaSource = DownloadHelper.createMediaSource(download.request, cacheDataSourceFactory)
But I can't see a way to set the DrmSessionManager here. The demo app doesn't help either.
What am I missing?
Is this what you want (in the dev-v2 branch): https://github.com/google/ExoPlayer/commit/61c43c30ac1ec26bdfd25757a0ac6ccee7c25fc2#diff-59e559b77cbc205ad4f12135c122ffb5
Looks like exactly what I needed. Sorry, didn't look at the dev branch, just tested the release.
Note that in the meantime, you can just put an equivalent method in your own code (it's just a small helper method; as far as I can see. I don't think it does anything particularly smart).
Yeah I fixed it, thanks.