Class RequestConfig

java.lang.Object
com.brightcove.player.offline.RequestConfig

public class RequestConfig extends Object
A configuration class whose values are passed over to the DownloadManager in each request made.
  • Field Details

    • VISIBILITY_VISIBLE

      public static final int VISIBILITY_VISIBLE
      See Also:
    • VISIBILITY_VISIBLE_NOTIFY_COMPLETED

      public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED
      See Also:
    • VISIBILITY_HIDDEN

      public static final int VISIBILITY_HIDDEN
      See Also:
    • VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION

      public static final int VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION
      See Also:
    • DEFAULT_VIDEO_BITRATE

      public static final int DEFAULT_VIDEO_BITRATE
      See Also:
  • Constructor Details

    • RequestConfig

      public RequestConfig()
  • Method Details

    • getDownloadPath

      @Nullable public File getDownloadPath()
      Gets the current base path that will be used to store the downloaded file(s).
      Returns:
      the download path.
    • setDownloadPath

      public RequestConfig setDownloadPath(@NonNull File downloadPath)

      Sets the base path that must be used to the downloaded file(s).

      Parameters:
      downloadPath - the download path.
      Returns:
      this object
    • getTitle

      public String getTitle()
      Gets the request title.
      Returns:
      the title
    • getDescription

      public String getDescription()
      Gets the request description.
      Returns:
      the description
    • isMobileDownloadAllowed

      public boolean isMobileDownloadAllowed()
      Returns whether download over a mobile network is allowed. By default is not allowed.
      Returns:
      true if allowed
    • isWifiDownloadAllowed

      public boolean isWifiDownloadAllowed()
      Returns whether download over a WIFI network is allowed. By default is not allowed.
      Returns:
      true if allowed
    • isBluetoothDownloadAllowed

      public boolean isBluetoothDownloadAllowed()
      Returns whether download over a bluetooth network is allowed. By default is not allowed.
      Returns:
      true if allowed
    • isRoamingDownloadAllowed

      public boolean isRoamingDownloadAllowed()
      Returns whether download over a mobile roaming network is allowed. By default is not allowed.
      Returns:
      true if allowed
    • isMeteredDownloadAllowed

      public boolean isMeteredDownloadAllowed()
      Returns whether download over a metered network is allowed. By default is not allowed.
      Returns:
      true if allowed
    • getNotificationVisibility

      public int getNotificationVisibility()
      Returns the notification visibility. It can have the following values: VISIBILITY_HIDDEN, VISIBILITY_VISIBLE, VISIBILITY_VISIBLE_NOTIFY_COMPLETED and VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION
      Returns:
      the notification visibility
    • getVideoBitrate

      public int getVideoBitrate()
      Gets the video bitrate configured.
      Returns:
      the video bitrate
    • setTitle

      public RequestConfig setTitle(String title)
      Sets the request title.
      Parameters:
      title - the title
      Returns:
      this object
    • setDescription

      public RequestConfig setDescription(String description)
      Sets the request description.
      Parameters:
      description - the description
      Returns:
      this object
    • setMobileDownloadAllowed

      public RequestConfig setMobileDownloadAllowed(boolean allowed)
      Sets whether download over mobile network is allowed.
      Parameters:
      allowed - whether mobile download network is allowed
      Returns:
      this object
    • setWifiDownloadAllowed

      public RequestConfig setWifiDownloadAllowed(boolean allowed)
      Sets whether download over WIFI network is allowed.
      Parameters:
      allowed - whether download WIFI network is allowed
      Returns:
      this object
    • setBluetoothDownloadAllowed

      public RequestConfig setBluetoothDownloadAllowed(boolean allowed)
      Sets whether download over bluetooth network is allowed.
      Parameters:
      allowed - whether download bluetooth network is allowed
      Returns:
      this object
    • setRoamingDownloadAllowed

      public RequestConfig setRoamingDownloadAllowed(boolean roamingDownloadAllowed)
      Sets whether download over roaming is allowed.
      Parameters:
      roamingDownloadAllowed - whether roaming is allowed
      Returns:
      this object
    • setMeteredDownloadAllowed

      public RequestConfig setMeteredDownloadAllowed(boolean meteredDownloadAllowed)
      Sets whether download over metered is allowed.
      Parameters:
      meteredDownloadAllowed - whether metered is allowed
      Returns:
      this object
    • setVideoBitrate

      public RequestConfig setVideoBitrate(int videoBitrate)
      Sets the video bitrate cap which will be used to determine what rendition will be downloaded. If there's no rendition lower than the video bitrate provided, the next higher will be picked.
      Parameters:
      videoBitrate - the video bitrate
      Returns:
      this object
    • setNotificationVisibility

      public RequestConfig setNotificationVisibility(int notificationVisibility)
      Sets the notification visibility.
      Parameters:
      notificationVisibility - the notification visibility
      Returns:
      this object
    • copy

      public RequestConfig copy()
      Creates a shallow copy of the current config.
      Returns:
      a shallow copy of the current config.