NELivePlayerModel.h
6.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
//
// NELivePlayerModel.h
// NELivePlayerFramework
//
// Created by Netease on 2018/9/27.
// Copyright © 2018年 netease. All rights reserved.
// 播放器相关模型定义
#import <Foundation/Foundation.h>
#import "NELivePlayerDefine.h"
NS_ASSUME_NONNULL_BEGIN
#pragma mark - 缓存配置模型
@interface NELPUrlCacheConfig : NSObject
/**
是否缓存。默认:NO。
*/
@property (nonatomic, assign) BOOL isCache;
/*
* 缓存的路径地址
*
* 每个视频缓存时都会在缓存文件夹路径下面生成两个文件,一个是视频缓存文件,一个是视频缓存索引文件。
*
* 如果为空,那么内部自动缓存到默认地址,并且每次释放播放器、重置播放器、切换拉流地址会删除缓存的视频文件。
*
* 如果不为空,那么SDK会根据设置进来的文件夹路径进行缓存,APP应用层自行管理缓存的文件,SDK不会删除缓存的文件,
* 用户应该每个视频都设置一个对应的缓存文件夹给播放器,这样用户知道每个视频的缓冲文件对应的文件夹,用户只需要对文件夹进行管理就可以管理该视频的缓存文件。
* 如果多个不同地址(类似于防盗链场景)播放的同一个视频,只需要设置相同的缓存文件夹路径就可以自动识别进行缓存文件,不会重复缓存。
*/
@property (nullable, nonatomic, copy) NSString * cacheRootPath;
@end
#pragma mark - 解密配置模型
@interface NELPUrlDecryptionConfig : NSObject
/**
* 解密类型
*/
@property (nonatomic, readonly) NELPUrlDecryptionType type;
/**
* 原始密钥。Type 为 NELPUrlDecryptionOriginalKey 时需要设置
*/
@property (nullable, nonatomic, readonly) NSData *originalKey;
/**
TransferToken.Type 为 NELPUrlDecryptionService 时需要设备
*/
@property (nonatomic, readonly) NSString *transferToken;
/**
accid 为 NELPUrlDecryptionService 时需要设备
*/
@property (nonatomic, readonly) NSString *accid;
/**
appKey 为 NELPUrlDecryptionService 时需要设备
*/
@property (nonatomic, readonly) NSString *appKey;
/**
token 为 NELPUrlDecryptionService 时需要设备
*/
@property (nonatomic, readonly) NSString *token;
/**
快速构造方法(原始密钥解密)
@param originalKey 原始密钥
@return 配置实例
*/
+ (instancetype)configWithOriginalKey:(nullable NSData *)originalKey;
/**
快速构造方法(服务端管理密钥解密)
@param transferToken transferToken
@param accid accid
@param appKey appKey
@param token token
@return 配置实例
*/
+ (instancetype)configWithTransferToken:(NSString *)transferToken
accid:(NSString *)accid
appKey:(NSString *)appKey
token:(NSString *)token;
@end
#pragma mark - 播放源 Url 相关配置模型
@interface NELPUrlConfig : NSObject
/**
缓存配置
*/
@property (nullable, nonatomic, strong) NELPUrlCacheConfig *cacheConfig;
/**
解密配置
*/
@property (nullable, nonatomic, strong) NELPUrlDecryptionConfig *decryptionConfig;
/**
http请求自定义的header field
*/
@property (nullable, nonatomic, strong) NSDictionary *httpHeaders;
@end
#pragma mark - 失败重连配置模型
@interface NELPRetryConfig : NSObject
/**
重试次数。默认值:0。 -1表示无限重试。
*/
@property (nonatomic, assign) NSTimeInterval count;
/**
默认重试间隔时间。默认值:0。 0表示立即重试。单位:s
*/
@property (nonatomic, assign) NSTimeInterval defaultIntervalS;
/**
自定义重试间隔时间。nil表示使用默认间隔。如果数组元素个数大于重试次数,取前面的重试次数个值;如果小于,后面未配置的值使用默认时间间隔。
*/
@property (nonatomic, strong) NSMutableArray <NSNumber *> *customIntervalS;
@end
#pragma mark - HTTP通知信息携带的模型
/**
* HTTP通知信息携带的模型
*/
@interface NELivePlayerHttpCodeModel : NSObject
/**
* http 请求返回状态码
*/
@property (nonatomic, assign) int code;
/**
* http 请求返回Header
*/
@property (nonatomic, copy) NSString *header;
@end
#pragma mark - 自定义透传信息模型
/**
* 自定义透传信息模型
*/
@interface NELivePlayerSyncContent : NSObject
/**
* 透传的信息
*/
@property (nonatomic, strong) NSArray <NSString *>*contents;
@end
#pragma mark - 音轨信息模型类
/**
音轨信息类
*/
@interface NELivePlayerAudioTrackInfo : NSObject
/**
采样率
*/
@property (nonatomic, assign) NSInteger sampleRate;
/**
码率
*/
@property (nonatomic, assign) NSInteger bitrate;
/**
声道数
*/
@property (nonatomic, assign) NSInteger numOfChannels;
/**
编码器类型
*/
@property (nonatomic, copy) NSString *codecName;
/**
语言
*/
@property (nonatomic, copy) NSString *language;
/**
标题
*/
@property (nonatomic, copy) NSString *title;
@end
#pragma mark - PCM配置模型类
/**
PCM配置模型类
*/
@interface NELivePlayerPcmConfig : NSObject
/**
通道数
*/
@property (nonatomic, assign) int channels;
/**
采样率
*/
@property (nonatomic, assign) int sampleRate;
@end
#pragma mark - 播放的实时信息
@interface NELivePlayerRealTimeInfo : NSObject
/**
视频接收的码率
*/
@property (nonatomic, assign) NSInteger videoReceiveBitrate;
/**
视频接收的楨率
*/
@property (nonatomic, assign) NSInteger videoReceiveFramerate;
/**
视频播放的楨率
*/
@property (nonatomic, assign) NSInteger videoPlayFramerate;
/**
视频缓存的时长
*/
@property (nonatomic, assign) uint64_t videoCacheDuration;
/**
视频缓存的大小
*/
@property (nonatomic, assign) uint64_t videoCacheBytes;
/**
音频接收的码率
*/
@property (nonatomic, assign) NSInteger audioReceiveBitrate;
/**
音频缓存的时长
*/
@property (nonatomic, assign) uint64_t audioCacheDuration;
/**
音频缓存的大小
*/
@property (nonatomic, assign) uint64_t audioCacheBytes;
/**
音频和视频的播放时间差
*/
@property (nonatomic, assign) NSTimeInterval AVPlayTimeDifference;
@end
#pragma mark - 调度的结果信息
@interface NELivePlayerUrlItem : NSObject
@property (nonatomic, copy) NSString *address;
@property (nonatomic, copy) NSString *cdnType;
@end
@interface NELivePlayerGslbResult : NSObject
@property (nonatomic, strong) id session;
@property (nonatomic, strong) NSMutableArray <NELivePlayerUrlItem *> *addresses;
@end
NS_ASSUME_NONNULL_END