Class DefaultDrmSessionManagerProvider
- java.lang.Object
-
- com.google.android.exoplayer2.drm.DefaultDrmSessionManagerProvider
-
- All Implemented Interfaces:
DrmSessionManagerProvider
public final class DefaultDrmSessionManagerProvider extends Object implements DrmSessionManagerProvider
Default implementation ofDrmSessionManagerProvider
.
-
-
Constructor Summary
Constructors Constructor Description DefaultDrmSessionManagerProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DrmSessionManager
get(MediaItem mediaItem)
Returns aDrmSessionManager
for the given media item.void
setDrmHttpDataSourceFactory(HttpDataSource.Factory drmHttpDataSourceFactory)
Sets theHttpDataSource.Factory
to be used for creatingHttpMediaDrmCallbacks
which executes key and provisioning requests over HTTP.void
setDrmUserAgent(String userAgent)
Sets the optional user agent to be used for DRM requests.
-
-
-
Method Detail
-
setDrmHttpDataSourceFactory
public void setDrmHttpDataSourceFactory(@Nullable HttpDataSource.Factory drmHttpDataSourceFactory)
Sets theHttpDataSource.Factory
to be used for creatingHttpMediaDrmCallbacks
which executes key and provisioning requests over HTTP. Ifnull
is passed theDefaultHttpDataSource.Factory
is used.- Parameters:
drmHttpDataSourceFactory
- The HTTP data source factory ornull
to useDefaultHttpDataSource.Factory
.
-
setDrmUserAgent
public void setDrmUserAgent(@Nullable String userAgent)
Sets the optional user agent to be used for DRM requests.In case a factory has been set by
setDrmHttpDataSourceFactory(HttpDataSource.Factory)
, this user agent is ignored.- Parameters:
userAgent
- The user agent to be used for DRM requests.
-
get
public DrmSessionManager get(MediaItem mediaItem)
Description copied from interface:DrmSessionManagerProvider
Returns aDrmSessionManager
for the given media item.The caller is responsible for
preparing
theDrmSessionManager
before use, and subsequentlyreleasing
it.- Specified by:
get
in interfaceDrmSessionManagerProvider
-
-