com.brightcove.player.offline

## Class RequestConfig

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

-     public class RequestConfig
      extends java.lang.Object

  A configuration class whose values are passed over to the `DownloadManager` in each request made.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RequestConfig.RequestVisibility` List of values that can take the method `setNotificationVisibility(int)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_VIDEO_BITRATE`
    `static int` | `VISIBILITY_HIDDEN`
    `static int` | `VISIBILITY_VISIBLE`
    `static int` | `VISIBILITY_VISIBLE_NOTIFY_COMPLETED`
    `static int` | `VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RequestConfig()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RequestConfig` | `copy()` Creates a shallow copy of the current config.
    `java.lang.String` | `getDescription()` Gets the request description.
    `java.io.File` | `getDownloadPath()` Gets the current base path that will be used to store the downloaded file(s).
    `int` | `getNotificationVisibility()` Returns the notification visibility.
    `java.lang.String` | `getTitle()` Gets the request title.
    `int` | `getVideoBitrate()` Gets the video bitrate configured.
    `boolean` | `isBluetoothDownloadAllowed()` Returns whether download over a bluetooth network is allowed.
    `boolean` | `isMeteredDownloadAllowed()` Returns whether download over a metered network is allowed.
    `boolean` | `isMobileDownloadAllowed()` Returns whether download over a mobile network is allowed.
    `boolean` | `isRoamingDownloadAllowed()` Returns whether download over a mobile roaming network is allowed.
    `boolean` | `isWifiDownloadAllowed()` Returns whether download over a WIFI network is allowed.
    `RequestConfig` | `setBluetoothDownloadAllowed(boolean allowed)` Sets whether download over bluetooth network is allowed.
    `RequestConfig` | `setDescription(java.lang.String description)` Sets the request description.
    `RequestConfig` | `setDownloadPath(java.io.File downloadPath)` Sets the base path that must be used to the downloaded file(s).
    `RequestConfig` | `setMeteredDownloadAllowed(boolean meteredDownloadAllowed)` Sets whether download over metered is allowed.
    `RequestConfig` | `setMobileDownloadAllowed(boolean allowed)` Sets whether download over mobile network is allowed.
    `RequestConfig` | `setNotificationVisibility(int notificationVisibility)` Sets the notification visibility.
    `RequestConfig` | `setRoamingDownloadAllowed(boolean roamingDownloadAllowed)` Sets whether download over roaming is allowed.
    `RequestConfig` | `setTitle(java.lang.String title)` Sets the request title.
    `RequestConfig` | `setVideoBitrate(int videoBitrate)` Sets the video bitrate cap which will be used to determine what rendition will be downloaded.
    `RequestConfig` | `setWifiDownloadAllowed(boolean allowed)` Sets whether download over WIFI network is allowed.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### VISIBILITY_VISIBLE

          public static final int VISIBILITY_VISIBLE

      See Also:
        `DownloadManager.Request#VISIBILITY_VISIBLE}`, Constant Field Values

    - #### VISIBILITY_VISIBLE_NOTIFY_COMPLETED

          public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED

      See Also:
        `DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_COMPLETED}`, Constant Field Values

    - #### VISIBILITY_HIDDEN

          public static final int VISIBILITY_HIDDEN

      See Also:
        `DownloadManager.Request#VISIBILITY_HIDDEN}`, Constant Field Values

    - #### VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION

          public static final int VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION

      See Also:
        `DownloadManager.Request#VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION}`, Constant Field Values

    - #### DEFAULT_VIDEO_BITRATE

          public static final int DEFAULT_VIDEO_BITRATE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RequestConfig

          public RequestConfig()

  - ### Method Detail

    - #### getDownloadPath

          @Nullable
          public java.io.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
                                               java.io.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 java.lang.String getTitle()

      Gets the request title.
      Returns:
        the title
      See Also:
        `#setTitle(String)}`

    - #### getDescription

          public java.lang.String getDescription()

      Gets the request description.
      Returns:
        the description
      See Also:
        `#setDescription(String)}`

    - #### isMobileDownloadAllowed

          public boolean isMobileDownloadAllowed()

      Returns whether download over a mobile network is allowed. By default is not allowed.
      Returns:
        true if allowed
      See Also:
        `#setMobileDownloadAllowed(boolean)}`

    - #### isWifiDownloadAllowed

          public boolean isWifiDownloadAllowed()

      Returns whether download over a WIFI network is allowed. By default is not allowed.
      Returns:
        true if allowed
      See Also:
        `#setWifiDownloadAllowed(boolean)}`

    - #### isBluetoothDownloadAllowed

          public boolean isBluetoothDownloadAllowed()

      Returns whether download over a bluetooth network is allowed. By default is not allowed.
      Returns:
        true if allowed
      See Also:
        `#setBluetoothDownloadAllowed(boolean)}`

    - #### isRoamingDownloadAllowed

          public boolean isRoamingDownloadAllowed()

      Returns whether download over a mobile roaming network is allowed. By default is not allowed.
      Returns:
        true if allowed
      See Also:
        `#setRoamingDownloadAllowed(boolean)}`

    - #### isMeteredDownloadAllowed

          public boolean isMeteredDownloadAllowed()

      Returns whether download over a metered network is allowed. By default is not allowed.
      Returns:
        true if allowed
      See Also:
        `#setMeteredDownloadAllowed(boolean)}`

    - #### 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(java.lang.String title)

      Sets the request title.
      Parameters:
        `title` - the title
      Returns:
        this object
      See Also:
        `DownloadManager.Request#setTitle(CharSequence)}`

    - #### setDescription

          public RequestConfig setDescription(java.lang.String description)

      Sets the request description.
      Parameters:
        `description` - the description
      Returns:
        this object
      See Also:
        `DownloadManager.Request#setDescription(CharSequence)}`

    - #### 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
      See Also:
        `DownloadManager.Request#setAllowedOverRoaming(boolean)}`

    - #### setMeteredDownloadAllowed

          public RequestConfig setMeteredDownloadAllowed(boolean meteredDownloadAllowed)

      Sets whether download over metered is allowed.
      Parameters:
        `meteredDownloadAllowed` - whether metered is allowed
      Returns:
        this object
      See Also:
        `DownloadManager.Request#setAllowedOverMetered(boolean)}`

    - #### 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
      See Also:
        `DownloadManager.Request#setNotificationVisibility(int)}`

    - #### copy

          public RequestConfig copy()

      Creates a shallow copy of the current config.
      Returns:
        a shallow copy of the current config.