mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Add DummyDrmSessionManager
Avoids nullable DrmSessionManagers and simplifies sample reading. To be used as default value for MediaSources. PiperOrigin-RevId: 253624465
This commit is contained in:
parent
3204cf8ffa
commit
af5eb5e552
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user