Class DownloadRequest

  • All Implemented Interfaces:

    public final class DownloadRequest
    extends Object
    implements Parcelable
    Defines content to be downloaded.
    • Field Detail

      • id

        public final String id
        The unique content id.
      • uri

        public final Uri uri
        The uri being downloaded.
      • mimeType

        public final String mimeType
        The MIME type of this content. Used as a hint to infer the content's type (DASH, HLS, SmoothStreaming). If null, a DownloadService will infer the content type from the uri.
      • streamKeys

        public final List<StreamKey> streamKeys
        Stream keys to be downloaded. If empty, all streams will be downloaded.
      • keySetId

        public final byte[] keySetId
        The key set id of the offline licence if the content is protected with DRM.
      • customCacheKey

        public final String customCacheKey
        Custom key for cache indexing, or null. Must be null for DASH, HLS and SmoothStreaming downloads.
      • data

        public final byte[] data
        Application defined data associated with the download. May be empty.
    • Method Detail

      • copyWithId

        public DownloadRequest copyWithId​(String id)
        Returns a copy with the specified ID.
        id - The ID of the copy.
        The copy with the specified ID.
      • copyWithKeySetId

        public DownloadRequest copyWithKeySetId​(@Nullable
                                                byte[] keySetId)
        Returns a copy with the specified key set ID.
        keySetId - The key set ID of the copy.
        The copy with the specified key set ID.
      • copyWithMergedRequest

        public DownloadRequest copyWithMergedRequest​(DownloadRequest newRequest)
        Returns the result of merging newRequest into this request. The requests must have the same id.

        The resulting request contains the stream keys from both requests. For all other member variables, those in newRequest are preferred.

        newRequest - The request being merged.
        The merged result.
        IllegalArgumentException - If the requests do not have the same id.
      • toMediaItem

        public MediaItem toMediaItem()
        Returns a MediaItem for the content defined by the request.
      • equals

        public boolean equals​(@Nullable
                              Object o)
        equals in class Object
      • hashCode

        public final int hashCode()
        hashCode in class Object