Commit af5eb5e5 by aquilescanta Committed by Oliver Woodman

Add DummyDrmSessionManager

Avoids nullable DrmSessionManagers and simplifies sample reading.
To be used as default value for MediaSources.

PiperOrigin-RevId: 253624465
parent 3204cf8f
......@@ -27,6 +27,24 @@ import java.lang.annotation.RetentionPolicy;
*/
public interface DrmSessionManager<T extends ExoMediaCrypto> {
/** {@link DrmSessionManager} that supports no DRM schemes. */
DrmSessionManager<ExoMediaCrypto> DUMMY =
new DrmSessionManager<ExoMediaCrypto>() {
@Override
public boolean canAcquireSession(DrmInitData drmInitData) {
return false;
}
@Override
public DrmSession<ExoMediaCrypto> acquireSession(
Looper playbackLooper, DrmInitData drmInitData) {
return new ErrorStateDrmSession<>(
new DrmSession.DrmSessionException(
new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME)));
}
};
/** Flags that control the handling of DRM protected content. */
@Documented
@Retention(RetentionPolicy.SOURCE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment