DefaultDrmSessionManagerProvider


@UnstableApi
public final class DefaultDrmSessionManagerProvider implements DrmSessionManagerProvider


Default implementation of DrmSessionManagerProvider.

Summary

Public constructors

Public methods

DrmSessionManager
get(MediaItem mediaItem)

Returns a DrmSessionManager for the given media item.

void

Sets the DataSource.Factory which is used to create HttpMediaDrmCallback instances.

void
setDrmLoadErrorHandlingPolicy(
    LoadErrorHandlingPolicy drmLoadErrorHandlingPolicy
)

Sets a load error handling policy to pass to setLoadErrorHandlingPolicy.

void

This method is deprecated.

Pass a custom DataSource.Factory to setDrmHttpDataSourceFactory which sets the desired user agent on outgoing requests.

Public constructors

DefaultDrmSessionManagerProvider

public DefaultDrmSessionManagerProvider()

Public methods

get

public DrmSessionManager get(MediaItem mediaItem)

Returns a DrmSessionManager for the given media item.

The caller is responsible for preparing the before use, and subsequently releasing it.

setDrmHttpDataSourceFactory

public void setDrmHttpDataSourceFactory(
    @Nullable DataSource.Factory drmDataSourceFactory
)

Sets the DataSource.Factory which is used to create HttpMediaDrmCallback instances. If null is passed a DefaultHttpDataSource.Factory is used.

Parameters
@Nullable DataSource.Factory drmDataSourceFactory

The data source factory or null to use .

setDrmLoadErrorHandlingPolicy

public void setDrmLoadErrorHandlingPolicy(
    LoadErrorHandlingPolicy drmLoadErrorHandlingPolicy
)

Sets a load error handling policy to pass to setLoadErrorHandlingPolicy.

If null is passed the setter is not called, so the default defined by Builder is used instead.

setDrmUserAgent

public void setDrmUserAgent(@Nullable String userAgent)