public class AliPlayerGlobalSettings
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
AliPlayerGlobalSettings.OnGetUrlHashCallback
Get the hash value of the loaded URL, used as the unique id of the URL.
|
static class |
AliPlayerGlobalSettings.StreamType
audio stream type
|
构造器和说明 |
---|
AliPlayerGlobalSettings() |
限定符和类型 | 方法和说明 |
---|---|
static void |
clearCaches()
Clear all cache files.
|
static void |
enableHttpDns(boolean enable)
enable httpDNS.
|
static void |
enableLocalCache(boolean enable,
int maxBufferMemoryKB,
java.lang.String localCacheDir)
Enable local cache.
|
static void |
forceAudioRendingFormat(boolean force,
java.lang.String format,
int channels,
int sample_rate)
force audio render use the particular format,the value will no effect when the format not supported by device,the out range value will be ignored,and use the default value;
and it will affect the pcm data that from audio rending callback, it only can be reset in the same thread, disabled by default.
|
static void |
loadClass() |
static void |
setAudioStreamType(AliPlayerGlobalSettings.StreamType streamType)
Set audio stream type
|
static void |
setCacheFileClearConfig(long expireMin,
long maxCapacityMB,
long freeStorageMB)
Settings related to automatic cleanup of local cache files
|
static void |
setCacheUrlHashCallback(AliPlayerGlobalSettings.OnGetUrlHashCallback cb)
Sets the hash callback to load the URL.
|
static void |
setDNSResolve(java.lang.String host,
java.lang.String ip)
Set a DNS ip to resolve the host.
|
static void |
setIPResolveType(IPlayer.IPResolveType type)
set ip resolve type
|
static void |
setUseHttp2(boolean use)
Set if use http2.
|
public static void loadClass()
public static void setDNSResolve(java.lang.String host, java.lang.String ip)
host
- The host. Need to specify the port(http defualt port is 80,https default port is 443). E.g player.alicdn.com:80ip
- The ip address, set as empty string to clear the setting.public static void setUseHttp2(boolean use)
use
- true:use http2.public static void setIPResolveType(IPlayer.IPResolveType type)
type
- See IPlayer.IPResolveType
public static void setAudioStreamType(AliPlayerGlobalSettings.StreamType streamType)
streamType
- see AliPlayerGlobalSettings.StreamTypepublic static void forceAudioRendingFormat(boolean force, java.lang.String format, int channels, int sample_rate)
force
- enable/disableformat
- the pcm format, only support s16 for now, signed integer with 16 bitschannels
- the pcm channels, available range 1~2sample_rate
- set the pcm sample rate, available range 1~48000public static void enableLocalCache(boolean enable, int maxBufferMemoryKB, java.lang.String localCacheDir)
enable
- true: enables the local cache. false: disable. This function is disabled by default.maxBufferMemoryKB
- Set the maximum memory size for a single source. Unit is KBlocalCacheDir
- Directory of files cached locally, absolute pathpublic static void setCacheFileClearConfig(long expireMin, long maxCapacityMB, long freeStorageMB)
expireMin
- How long the cache expires: the unit is minute. The default value is 30 days.maxCapacityMB
- maximum cache capacity: in megabytes. The default value is 20GB. If the total cache size exceeds this size, the cache size is sorted by cacheItem until it is less than or equal to the maximum cache capacity.freeStorageMB
- Minimum free disk capacity: in megabytes (default value: 0). If the current disk capacity is less than this value, the freeStorage will be eliminated one by one until the freeStorage is greater than or equal to this value or all caches are eliminated.public static void clearCaches()
public static void setCacheUrlHashCallback(AliPlayerGlobalSettings.OnGetUrlHashCallback cb)
cb
- the hash callbackpublic static void enableHttpDns(boolean enable)
enable
-