mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00: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
1 changed files with 18 additions and 0 deletions
|
|
@ -27,6 +27,24 @@ import java.lang.annotation.RetentionPolicy;
|
||||||
*/
|
*/
|
||||||
public interface DrmSessionManager<T extends ExoMediaCrypto> {
|
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. */
|
/** Flags that control the handling of DRM protected content. */
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue