com.google.android.exoplayer2.drm.DefaultDrmSessionEventListener Java Examples

The following examples show how to use com.google.android.exoplayer2.drm.DefaultDrmSessionEventListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LocalDrmSessionManager.java    From no-player with Apache License 2.0 5 votes vote down vote up
LocalDrmSessionManager(KeySetId keySetIdToRestore,
                       ExoMediaDrm<FrameworkMediaCrypto> mediaDrm,
                       UUID drmScheme,
                       Handler handler,
                       DefaultDrmSessionEventListener eventListener) {
    this.keySetIdToRestore = keySetIdToRestore;
    this.mediaDrm = mediaDrm;
    this.eventListener = eventListener;
    this.drmScheme = drmScheme;
    this.handler = handler;
}
 
Example #2
Source File: DownloadDrmSessionCreator.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public DrmSessionManager<FrameworkMediaCrypto> create(DefaultDrmSessionEventListener eventListener) {
    return new LocalDrmSessionManager(
            downloadedModularDrm.getKeySetId(),
            mediaDrmCreator.create(WIDEVINE_MODULAR_UUID),
            WIDEVINE_MODULAR_UUID,
            handler,
            eventListener
    );
}
 
Example #3
Source File: StreamingDrmSessionCreator.java    From no-player with Apache License 2.0 5 votes vote down vote up
@Override
public DrmSessionManager<FrameworkMediaCrypto> create(DefaultDrmSessionEventListener eventListener) {
    FrameworkMediaDrm frameworkMediaDrm = frameworkMediaDrmCreator.create(WIDEVINE_MODULAR_UUID);

    DefaultDrmSessionManager<FrameworkMediaCrypto> defaultDrmSessionManager = new DefaultDrmSessionManager<>(
            WIDEVINE_MODULAR_UUID,
            frameworkMediaDrm,
            mediaDrmCallback,
            NO_OPTIONAL_PARAMETERS
    );
    defaultDrmSessionManager.removeListener(eventListener);
    defaultDrmSessionManager.addListener(handler, eventListener);

    return defaultDrmSessionManager;
}
 
Example #4
Source File: ExoPlayerCreator.java    From no-player with Apache License 2.0 5 votes vote down vote up
@NonNull
public SimpleExoPlayer create(DrmSessionCreator drmSessionCreator,
                              DefaultDrmSessionEventListener drmSessionEventListener,
                              MediaCodecSelector mediaCodecSelector,
                              TrackSelector trackSelector) {
    DrmSessionManager<FrameworkMediaCrypto> drmSessionManager = drmSessionCreator.create(drmSessionEventListener);
    SubtitleDecoderFactory subtitleDecoderFactory = new NoPlayerSubtitleDecoderFactory();
    RenderersFactory renderersFactory = new SimpleRenderersFactory(
            context,
            EXTENSION_RENDERER_MODE_OFF,
            DEFAULT_ALLOWED_VIDEO_JOINING_TIME_MS,
            mediaCodecSelector,
            subtitleDecoderFactory
    );

    DefaultLoadControl loadControl = new DefaultLoadControl();
    return ExoPlayerFactory.newSimpleInstance(context, renderersFactory, trackSelector, loadControl, drmSessionManager);
}
 
Example #5
Source File: NoDrmSessionCreator.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public DrmSessionManager<FrameworkMediaCrypto> create(DefaultDrmSessionEventListener eventListener) {
    return NO_DRM_SESSION;
}
 
Example #6
Source File: DrmSessionCreator.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Nullable
DrmSessionManager<FrameworkMediaCrypto> create(DefaultDrmSessionEventListener eventListener);
 
Example #7
Source File: ExoPlayerDrmSessionEventListener.java    From no-player with Apache License 2.0 4 votes vote down vote up
void add(DefaultDrmSessionEventListener listener) {
    listeners.add(listener);
}
 
Example #8
Source File: ExoPlayerDrmSessionEventListener.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Override
public void onDrmKeysLoaded() {
    for (DefaultDrmSessionEventListener listener : listeners) {
        listener.onDrmKeysLoaded();
    }
}
 
Example #9
Source File: ExoPlayerDrmSessionEventListener.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Override
public void onDrmSessionManagerError(Exception e) {
    for (DefaultDrmSessionEventListener listener : listeners) {
        listener.onDrmSessionManagerError(e);
    }
}
 
Example #10
Source File: ExoPlayerDrmSessionEventListener.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Override
public void onDrmKeysRestored() {
    for (DefaultDrmSessionEventListener listener : listeners) {
        listener.onDrmKeysRestored();
    }
}
 
Example #11
Source File: ExoPlayerDrmSessionEventListener.java    From no-player with Apache License 2.0 4 votes vote down vote up
@Override
public void onDrmKeysRemoved() {
    for (DefaultDrmSessionEventListener listener : listeners) {
        listener.onDrmKeysRemoved();
    }
}
 
Example #12
Source File: ExoPlayerForwarder.java    From no-player with Apache License 2.0 4 votes vote down vote up
public DefaultDrmSessionEventListener drmSessionEventListener() {
    return drmSessionEventListener;
}