AliyunPlayer v5.5.0.0
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)
 回调方法 More...
 

Class Methods

(void) + clearCaches
 
(void) + enableBufferToLocalCache:
 是否开启缓冲buffer到本地缓存,开启后,如果maxBufferDuration大于50s,则大于50s到部分会缓存到本地缓存。默认关闭。 More...
 
(void) + enableHttpDns:
 是否开启httpDNS。默认不开启。 More...
 
(void) + enableHWAduioTempo:
 设置是否使能硬件提供的音频变速播放能力,关闭后则使用软件实现音频的倍速播放,pcm回调数据的格式和此设置关联,如果修改,请在同一个线程操作,默认打开 More...
 
(void) + enableLocalCache:maxBufferMemoryKB:localCacheDir:
 开启本地缓存,开启之后,就会缓存到本地文件中。 More...
 
(void) + enableNetworkBalance:
 是否开启内建预加载网络平衡策略,播放过程中,自动控制预加载的运行时机。默认开启。 More...
 
(void) + forceAudioRendingFormat:fmt:channels:sample_rate:
 强制音频渲染器采用指定的格式进行渲染,如果设定的格式设备不支持,则无效,无效值将被忽略,使用默认值;pcm回调数据的格式和此设置关联,如果修改,请在同一个线程操作,默认关闭 More...
 
(void) + setCacheFileClearConfig:maxCapacityMB:freeStorageMB:
 本地缓存文件自动清理相关的设置 More...
 
(void) + setCacheUrlHashCallback:
 设置加载url的hash值回调。如果不设置,SDK使用md5算法。 More...
 
(void) + setDNSResolve:ip:
 设置域名对应的解析ip More...
 
(void) + setFairPlayCertID:
 设置fairPlay的用户证书id, 每次设置必须在同一个线程,否则无法更新 More...
 
(void) + setIpResolveType:
 设置解析ip类型 More...
 
(void) + setUseHttp2:
 设置是否使用http2。 More...
 

Member Typedef Documentation

◆ CaheUrlHashCallback

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

回调方法

Parameters
url视频url
Returns
hash值,必须要保证每个url都不一样

Method Documentation

◆ clearCaches

+ (void) clearCaches

◆ enableBufferToLocalCache:

+ (void) enableBufferToLocalCache: (BOOL)  enable

是否开启缓冲buffer到本地缓存,开启后,如果maxBufferDuration大于50s,则大于50s到部分会缓存到本地缓存。默认关闭。

Parameters
enable

◆ enableHttpDns:

+ (void) enableHttpDns: (BOOL)  enable

是否开启httpDNS。默认不开启。

Parameters
enable

◆ enableHWAduioTempo:

+ (void) enableHWAduioTempo: (bool)  enable

设置是否使能硬件提供的音频变速播放能力,关闭后则使用软件实现音频的倍速播放,pcm回调数据的格式和此设置关联,如果修改,请在同一个线程操作,默认打开

◆ enableLocalCache:maxBufferMemoryKB:localCacheDir:

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

开启本地缓存,开启之后,就会缓存到本地文件中。

Parameters
enabletrue:开启本地缓存。false:关闭。默认关闭。
maxBufferMemoryKB设置单个源的最大内存占用大小。单位KB
localCacheDir本地缓存的文件目录,绝对路径

◆ enableNetworkBalance:

+ (void) enableNetworkBalance: (BOOL)  enable

是否开启内建预加载网络平衡策略,播放过程中,自动控制预加载的运行时机。默认开启。

Parameters
enable

◆ forceAudioRendingFormat:fmt:channels:sample_rate:

+ (void) forceAudioRendingFormat: (bool)  force
fmt: (NSString *)  fmt
channels: (int)  channels
sample_rate: (int)  sample_rate 

强制音频渲染器采用指定的格式进行渲染,如果设定的格式设备不支持,则无效,无效值将被忽略,使用默认值;pcm回调数据的格式和此设置关联,如果修改,请在同一个线程操作,默认关闭

Parameters
force打开/关闭 强制设置
fmt设置pcm的格式,目前只支持s16,16位有符号整数
channels设置pcm的声道数,有效值 1~8
sample_rate设置pcm的采样率,有效值 1~48000

◆ setCacheFileClearConfig:maxCapacityMB:freeStorageMB:

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

本地缓存文件自动清理相关的设置

Parameters
expireMin缓存多久过期:单位分钟,默认值30天,过期的缓存不管容量如何,都会在清理时淘汰掉;
maxCapacityMB最大缓存容量:单位兆,默认值20GB,在清理时,如果缓存总大小超过此大小,会以cacheItem为粒度,按缓存的最后时间排序,一个一个淘汰掉一些缓存,直到小于等于最大缓存容量;
freeStorageMB磁盘最小空余容量:单位兆,默认值0,在清理时,同最大缓存容量,如果当前磁盘容量小于该值,也会按规则一个一个淘汰掉一些缓存,直到freeStorage大于等于该值或者所有缓存都被干掉;

◆ setCacheUrlHashCallback:

+ (void) setCacheUrlHashCallback: (CaheUrlHashCallback callback

设置加载url的hash值回调。如果不设置,SDK使用md5算法。

◆ setDNSResolve:ip:

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

设置域名对应的解析ip

Parameters
host域名,需指定端口(http默认端口80,https默认端口443)。例如player.alicdn.com:443
ip相应的ip,设置为空字符串清空设定。

◆ setFairPlayCertID:

+ (void) setFairPlayCertID: (NSString *)  certID

设置fairPlay的用户证书id, 每次设置必须在同一个线程,否则无法更新

Parameters
certID用户证书id

◆ setIpResolveType:

+ (void) setIpResolveType: (AVPIpResolveType type

设置解析ip类型

Parameters
type解析ip的类型

◆ setUseHttp2:

+ (void) setUseHttp2: (bool)  use

设置是否使用http2。

Parameters
use

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