AliyunPlayer v6.21.0
Aliyun Player API Reference Manual for iOS Platforms
Loading...
Searching...
No Matches
AliPlayerGlobalSettings Class Reference

#include "AliPlayerGlobalSettings.h"

Inheritance diagram for AliPlayerGlobalSettings:

Public Types

typedef NSString *(* AdaptiveDecoderGetBackupURLCallback) (AVPBizScene oriBizType, AVPCodecType oriCodecType, NSString *oriURL)
 decoding adaptive downgrade switching backup URL
 
typedef NSString *(* CaheUrlHashCallback) (NSString *url)
 callback
 
typedef BOOL(* NetworkDataProcessCallback) (NSString *requestUrl, const uint8_t *inData, const int64_t inOutSize, uint8_t *outData)
 A chance for media data downloading from network and modified by app, now only mp4 is supported.
 

Class Methods

(void) + clearCaches
 
(void) + disableCrashUpload:
 whether disable crash upload
 
(void) + enableBufferToLocalCache:
 enable buffer to local cache when maxBufferDuration large than 50s.
 
(void) + enableEnhancedHttpDns:
 enable enhanced httpDNS.
 
(void) + enableHttpDns:
 enable httpDNS.
 
(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.
 
(NSString *) + enableLocalCache:
 Enable local cache.
 
(void) + enableLocalCache:maxBufferMemoryKB:localCacheDir:
 Enable local cache.
 
(void) + enableNetworkBalance:
 enable Network Balance mechanism for control media loader's scheduling automatically.
 
(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.
 
(void) + setAdaptiveDecoderGetBackupURLCallback:
 Set the callback to get backup url.
 
(void) + setCacheFileClearConfig:maxCapacityMB:freeStorageMB:
 Settings related to automatic clearing of local cache files.
 
(void) + setCacheUrlHashCallback:
 Sets the hash callback to load the URL.
 
(void) + setDNSResolve:ip:
 Set a DNS ip to resolve the host.
 
(void) + setFairPlayCertID:
 Set the .fairPlay certID, update the certID must use the thread first set.
 
(void) + setIpResolveType:
 Set a IP type when resolve the host.
 
(void) + setNetworkDataProcessCallback:
 Set the network data callback.
 
(void) + setOption:value:
 Set specific option.
 
(void) + setOption:valueInt:
 Set specific option.
 
(void) + setUseHttp2:
 Set use http2 or not。Default is true since from v5.5.0.0.
 

Member Typedef Documentation

◆ AdaptiveDecoderGetBackupURLCallback

- (typedef NSString *(* AdaptiveDecoderGetBackupURLCallback) (AVPBizScene oriBizType, AVPCodecType oriCodecType, NSString *oriURL))

decoding adaptive downgrade switching backup URL

Parameters
oriBizTypeScenarios of downgrading
oriCodecTypeexperiencing downgrade
oriURLOriginal URL
Returns
Backup URL

◆ CaheUrlHashCallback

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

callback

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

◆ NetworkDataProcessCallback

- (typedef BOOL(* NetworkDataProcessCallback) (NSString *requestUrl, const uint8_t *inData, const int64_t inOutSize, uint8_t *outData))

A chance for media data downloading from network and modified by app, now only mp4 is supported.

Parameters
requestUrldata's source URL
inDatainput data buffer
inOutSizeinput/output data buffer size in byte
outDataoutput data buffer and its memory is managed by sdk, app can write it but size must not exceed to inOutSize
Returns
whether processed. If processed, return YES and sdk will use outData for later process, otherwise use original data and return NO.

Method Documentation

◆ clearCaches

+ (void) clearCaches

◆ disableCrashUpload:

+ (void) disableCrashUpload: (BOOL) disable

whether disable crash upload

Parameters
disable

◆ enableBufferToLocalCache:

+ (void) enableBufferToLocalCache: (BOOL) enable

enable buffer to local cache when maxBufferDuration large than 50s.

Default is enabled.

Parameters
enable

◆ enableEnhancedHttpDns:

+ (void) enableEnhancedHttpDns: (BOOL) enable

enable enhanced httpDNS.

Default is disbled. Need to pay attention to the following matters after open this function 1.This function is mutually exclusive with Httpdns. If turned on at the same time, the later turned on function will actually take effect; 2.this method need apply license enhanced dns function, otherwise this function will not work 3.need to add the cdn domain name through the interface, otherwise it will be downgraded to local dns

See also
[AliDomainProcessor addEnhancedHttpDnsDomain:NSString] 4.Please ensure that the domain name is added and configured with corresponding functions on the alicdn platform to ensure that online services can be provided. For configuration methods, please refer to: https://www.alibabacloud.com/product/content-delivery-network
Parameters
enable

◆ enableHttpDns:

+ (void) enableHttpDns: (BOOL) enable

enable httpDNS.

Default is disabled. Need to pay attention to the following matters after open this function 1.This function is mutually exclusive with enhanced Httpdns. 2.After opening, standard httpdns will be used for requests. If it fails, it will be downgraded to local dns.

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:

+ (NSString *) enableLocalCache: (BOOL) enable

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.
Returns
local cache path

◆ 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.
maxBufferMemoryKBthis parameter is deprecated. Set the maximum memory size for a single source. Unit is KB
localCacheDirDirectory of files cached locally, absolute path

◆ enableNetworkBalance:

+ (void) enableNetworkBalance: (BOOL) enable

enable Network Balance mechanism for control media loader's scheduling automatically.

Default is enabled.

Parameters
enable

◆ 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

◆ setAdaptiveDecoderGetBackupURLCallback:

+ (void) setAdaptiveDecoderGetBackupURLCallback: (AdaptiveDecoderGetBackupURLCallback) callback

Set the callback to get backup url.

◆ 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 2GB. 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. Recommend 500MB if based on short video bussiness.
freeStorageMBMinimum free disk capacity: in megabytes. The default value is 1GB. 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.

◆ setNetworkDataProcessCallback:

+ (void) setNetworkDataProcessCallback: (NetworkDataProcessCallback) callback

Set the network data callback.

◆ setOption:value:

+ (void) setOption: (GlobalOption) key
value: (NSString *) value 

Set specific option.

Parameters
keykey option
valuevalue of key

◆ setOption:valueInt:

+ (void) setOption: (GlobalOption) key
valueInt: (int) value 

Set specific option.

Parameters
keykey option
valueIntvalue of key

◆ setUseHttp2:

+ (void) setUseHttp2: (bool) use

Set use http2 or not。Default is true since from v5.5.0.0.

Parameters
use

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