Package 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 theDownloadManager
in each request made.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RequestConfig.RequestVisibility
List of values that can take the methodsetNotificationVisibility(int)
.
-
Field Summary
Fields Modifier and Type Field 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 Description RequestConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
VISIBILITY_VISIBLE
public static final int VISIBILITY_VISIBLE
- See Also:
- Constant Field Values
-
VISIBILITY_VISIBLE_NOTIFY_COMPLETED
public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED
- See Also:
- Constant Field Values
-
VISIBILITY_HIDDEN
public static final int VISIBILITY_HIDDEN
- See Also:
- Constant Field Values
-
VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION
public static final int VISIBILITY_VISIBLE_NOTIFY_ONLY_COMPLETION
- See Also:
- Constant Field Values
-
DEFAULT_VIDEO_BITRATE
public static final int DEFAULT_VIDEO_BITRATE
- See Also:
- Constant Field Values
-
-
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
-
getDescription
public java.lang.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
andVISIBILITY_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
-
setDescription
public RequestConfig setDescription(java.lang.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.
-
-