public class AliPlayerGlobalSettings
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
AliPlayerGlobalSettings.OnGetUrlHashCallback |
static class |
AliPlayerGlobalSettings.StreamType |
Constructor and Description |
---|
AliPlayerGlobalSettings() |
Modifier and Type | Method and Description |
---|---|
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 |
setAudioStreamType(AliPlayerGlobalSettings.StreamType streamType) |
static void |
setCacheFileClearConfig(long expireMin,
long maxCapacityMB,
long freeStorageMB) |
static void |
setCacheUrlHashCallback(AliPlayerGlobalSettings.OnGetUrlHashCallback cb) |
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) |
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)
public static void setIPResolveType(IPlayer.IPResolveType type)
type
- See IPlayer.IPResolveType
public static void setAudioStreamType(AliPlayerGlobalSettings.StreamType streamType)
public 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)
public static void setCacheUrlHashCallback(AliPlayerGlobalSettings.OnGetUrlHashCallback cb)