Package 

Class DownloadManager

  • All Implemented Interfaces:
    com.brightcove.player.network.IDownloadManager

    
    public class DownloadManager
     implements IDownloadManager
                        

    Provides an implementation of IDownloadManager that uses an application database to track the requests. The requests placed in the database will be downloaded asynchronously in a separate process. Any request sets that have been marked for deletion will be cancelled.

    • Method Detail

      • setNotificationChannel

         void setNotificationChannel(@NonNull() NotificationChannel notificationChannel)

        Set the specified NotificationChannelThis is typically done when use of a customized NotificationChannel (for example, to manage Notification sound settings) isdesired.Note that setting a custom NotificationChannel will remove this DownloadManager's default NotificationChannel

        Parameters:
        notificationChannel - The user-created NotificationChannel object
      • createDownloadRequestSet

        @NonNull() Observable<DownloadRequestSet> createDownloadRequestSet(@Nullable() RequestConfig requestConfig, long estimatedSize, @NonNull() DownloadManager.Listener listener)

        Creates an empty download request set with the specified estimated size.

        Please note the operation will be carried on a background i/o thread.

        Parameters:
        requestConfig - the configuration to be used for handling the download requests.
        estimatedSize - the estimated total size of the download.
        listener - reference to the callback listener that must be notified about status changesrelated to this download request.
      • enqueueDownload

        @NonNull() Observable<DownloadRequestSet> enqueueDownload(@NonNull() DownloadRequestSet requestSet, @NonNull() Array<IDownloadManager.IRequest> requests)

        Enqueues a set of download requests to the specified request set. The status of the downloadrequest set will be more to STATUS_PENDING immediately adding therequests to the database. The DownloadManager will start to process the downloadrequests after this call, because of network availability and current download queue load.

        Please note the operation will be carried on a background i/o thread.

        Parameters:
        requestSet - reference to the
        requests - the download requests to be enqueued.
      • pauseDownload

        @NonNull() DownloadStatus pauseDownload(@Nullable() DownloadRequestSet requestSet)

        Pauses download of the specified request set, if it is not already paused.

        Parameters:
        requestSet - reference to the download request to be paused.
      • pauseDownload

        @NonNull() DownloadStatus pauseDownload(@NonNull() Long requestSetKey)

        Pauses download of the specified request set, if it is not already paused.

        Parameters:
        requestSetKey - the unique identifier to the download request.
      • resumeDownload

        @NonNull() DownloadStatus resumeDownload(@Nullable() DownloadRequestSet requestSet)

        Resumes download of the specified request set, if it is currently paused.

        Parameters:
        requestSet - reference to the download request to be resumed.
      • resumeDownload

        @NonNull() DownloadStatus resumeDownload(@NonNull() Long requestSetKey)

        Resumes download of the specified request set, if it is currently paused.

        Parameters:
        requestSetKey - the unique identifier to the download request.
      • deleteDownload

         boolean deleteDownload(@NonNull() Long requestSetKey)

        Cancels all the download requests in the specified set and removes the download request set.

        Parameters:
        requestSetKey - the unique identifier to the download request.
      • deleteDownload

         boolean deleteDownload(@Nullable() DownloadRequestSet requestSet)

        Cancels all the download requests in the specified set and removes the download request set.

        Parameters:
        requestSet - the request set to be cancelled.
      • getDownloadStatus

        @NonNull() DownloadStatus getDownloadStatus(@NonNull() Long requestSetKey)

        Queries the overall download status of the specified download request set.

        Parameters:
        requestSetKey - the unique identifier to the download request.
      • getDownloadStatus

        @NonNull() DownloadStatus getDownloadStatus(@Nullable() DownloadRequestSet requestSet)

        Queries the overall download status of the specified download request set.

        Parameters:
        requestSet - reference to the download request set.
      • removeNotificationChannelById

         void removeNotificationChannelById(@NonNull() String notificationChannelId)

        Remove the NotificationChannel with the spedified ID from the NotificationManager

        Parameters:
        notificationChannelId - The ID of the NotificationChannel to remove