Class WidevineMediaDrmCallback

  • All Implemented Interfaces:
    com.google.android.exoplayer2.drm.MediaDrmCallback

    public class WidevineMediaDrmCallback
    extends BrightcoveMediaDrmCallback
    implements com.google.android.exoplayer2.drm.MediaDrmCallback
    Provides a concrete implementation of BrightcoveMediaDrmCallback that use Widevine to support playback of DRM protected content in ExoPlayer 2.
    • Field Detail

      • EMPTY

        public static final WidevineMediaDrmCallback EMPTY
        An empty instance of the WidevineMediaDrmCallback, to be returned if getInstance() is called and WidevineMediaDrmCallback is null
    • Constructor Detail

      • WidevineMediaDrmCallback

        public WidevineMediaDrmCallback​(@Nullable
                                        java.lang.String defaultUrl)
        Constructs a new Widevine based Media DRM callback handler.
        Parameters:
        defaultUrl - the fully qualified URL to the DRM license service that will be used if the request does include an URL.
    • Method Detail

      • create

        public static WidevineMediaDrmCallback create​(@NonNull
                                                      java.util.Map<java.lang.String,​java.lang.Object> videoProperties,
                                                      @NonNull
                                                      java.util.Map<java.lang.String,​java.lang.Object> sourceProperties)
        Creates a new new Widevine based Media DRM callback handler using the given video and source properties.
        Parameters:
        videoProperties - the video properties
        sourceProperties - the video source properties
        Returns:
        reference to the new Widevine based Media DRM callback handler
      • executeProvisionRequest

        public byte[] executeProvisionRequest​(java.util.UUID uuid,
                                              @NonNull
                                              com.google.android.exoplayer2.drm.ExoMediaDrm.ProvisionRequest request)
                                       throws com.google.android.exoplayer2.drm.MediaDrmCallbackException
        Specified by:
        executeProvisionRequest in interface com.google.android.exoplayer2.drm.MediaDrmCallback
        Throws:
        com.google.android.exoplayer2.drm.MediaDrmCallbackException
      • executeKeyRequest

        public byte[] executeKeyRequest​(java.util.UUID uuid,
                                        com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest request)
                                 throws com.google.android.exoplayer2.drm.MediaDrmCallbackException
        Specified by:
        executeKeyRequest in interface com.google.android.exoplayer2.drm.MediaDrmCallback
        Throws:
        com.google.android.exoplayer2.drm.MediaDrmCallbackException
      • executeProvisionRequest

        protected byte[] executeProvisionRequest​(java.lang.String url,
                                                 byte[] data)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • executeKeyRequest

        protected byte[] executeKeyRequest​(java.lang.String url,
                                           byte[] data)
                                    throws java.io.IOException
        Throws:
        java.io.IOException