AliyunPlayer v5.4.9.1
Aliyun Player API Reference Manual for iOS Platforms
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
AliPlayerGlobalSettings Class Reference

#import "AliPlayerGlobalSettings.h"

Inheritance diagram for AliPlayerGlobalSettings:

Public Types

typedef NSString *(* CaheUrlHashCallback) (NSString *url)
 callback More...
 

Class Methods

(void) + clearCaches
 
(void) + enableHttpDns:
 enable httpDNS. More...
 
(void) + enableHWAduioTempo:
 enable/disable hardware audio tempo, player will use soft ware tempo filter when disabled, and it will affect the pcm data that from audio rending callback, it only can be reset in the same thread, enable by default. More...
 
(void) + enableLocalCache:maxBufferMemoryKB:localCacheDir:
 Enable local cache. More...
 
(void) + forceAudioRendingFormat:fmt:channels: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. More...
 
(void) + setCacheFileClearConfig:maxCapacityMB:freeStorageMB:
 Settings related to automatic clearing of local cache files. More...
 
(void) + setCacheUrlHashCallback:
 Sets the hash callback to load the URL. More...
 
(void) + setDNSResolve:ip:
 Set a DNS ip to resolve the host. More...
 
(void) + setFairPlayCertID:
 Set the .fairPlay certID, update the certID must use the thread first set. More...
 
(void) + setIpResolveType:
 Set a IP type when resolve the host. More...
 
(void) + setUseHttp2:
 Set use http2 or not。 More...
 

Member Typedef Documentation

◆ CaheUrlHashCallback

- (typedef NSString *(* CaheUrlHashCallback) (NSString *url))

callback

Parameters
urlthe loaded URL
Returns
the hash value . Ensure that each URL is different.

Method Documentation

◆ clearCaches

+ (void) clearCaches

◆ enableHttpDns:

+ (void) enableHttpDns: (BOOL)  enable

enable httpDNS.

Default is disabled.

Parameters
enable

◆ enableHWAduioTempo:

+ (void) enableHWAduioTempo: (bool)  enable

enable/disable hardware audio tempo, player will use soft ware tempo filter when disabled, and it will affect the pcm data that from audio rending callback, it only can be reset in the same thread, enable by default.

◆ enableLocalCache:maxBufferMemoryKB:localCacheDir:

+ (void) enableLocalCache: (bool)  enable
maxBufferMemoryKB: (int)  maxBufferMemoryKB
localCacheDir: (NSString *)  localCacheDir 

Enable local cache.

When enabled, it will be cached in local files.

Parameters
enabletrue: enables the local cache. false: disable. This function is disabled by default.
maxBufferMemoryKBSet the maximum memory size for a single source. Unit is KB
localCacheDirDirectory of files cached locally, absolute path

◆ forceAudioRendingFormat:fmt:channels:sample_rate:

+ (void) forceAudioRendingFormat: (bool)  force
fmt: (NSString *)  fmt
channels: (int)  channels
sample_rate: (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.

Parameters
forceenable/disable
fmtthe pcm format, only support s16 for now, signed integer with 16 bits
channelsthe pcm channels, available range 1~8
sample_rateset the pcm sample rate, available range 1~48000

◆ setCacheFileClearConfig:maxCapacityMB:freeStorageMB:

+ (void) setCacheFileClearConfig: (int64_t)  expireMin
maxCapacityMB: (int64_t)  maxCapacityMB
freeStorageMB: (int64_t)  freeStorageMB 

Settings related to automatic clearing of local cache files.

Parameters
expireMinHow long the cache expires: the unit is minute. The default value is 30 days.
maxCapacityMBmaximum cache capacity: in megabytes. The default value is 20GB. If the total cache size exceeds this size, some caches are discarded one by one in the cacheItem granularity until they are smaller than or equal to the maximum cache capacity.
freeStorageMBMinimum free disk capacity: in megabytes. The default value is 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.

◆ setCacheUrlHashCallback:

+ (void) setCacheUrlHashCallback: (CaheUrlHashCallback callback

Sets the hash callback to load the URL.

If this parameter is not set, the SDK uses md5 algorithm.

◆ setDNSResolve:ip:

+ (void) setDNSResolve: (NSString *)  host
ip: (NSString *)  ip 

Set a DNS ip to resolve the host.

Parameters
hostThe host. Need to specify the port (http defualt port is 80,https default port is 443). E.g player.alicdn.com:443
ipThe ip address, set as empty string to clear the setting.

◆ setFairPlayCertID:

+ (void) setFairPlayCertID: (NSString *)  certID

Set the .fairPlay certID, update the certID must use the thread first set.

Parameters
typeThe IP type.

◆ setIpResolveType:

+ (void) setIpResolveType: (AVPIpResolveType type

Set a IP type when resolve the host.

Parameters
typeThe IP type.

◆ setUseHttp2:

+ (void) setUseHttp2: (bool)  use

Set use http2 or not。

Parameters
use

The documentation for this class was generated from the following file: