EZOpenSDK  4.8.6
 全部  函数 属性
EZPlayer.h
1 //
2 // EZPlayer.h
3 // EzvizOpenSDK
4 //
5 // Created by DeJohn Dong on 15/9/16.
6 // Copyright (c) 2015年 Ezviz. All rights reserved.
7 //
8 
9 #import <UIKit/UIKit.h>
10 
11 @class EZDeviceRecordFile;
12 @class EZCloudRecordFile;
13 @class EZPlayer;
17 typedef NS_ENUM(NSInteger, EZVideoQuality) {
18  EZVideoQualityLow = 0, //流畅
19  EZVideoQualityMiddle = 1, //均衡
20  EZVideoQualityHigh = 2 //高清
21 };
22 
23 /* 播放器EZPlayer的状态消息定义 */
24 typedef NS_ENUM(NSInteger, EZMessageCode) {
25  PLAYER_REALPLAY_START = 1, //直播开始
26  PLAYER_VIDEOLEVEL_CHANGE = 2, //直播流清晰度切换中
27  PLAYER_STREAM_RECONNECT = 3, //直播流取流正在重连
28  PLAYER_VOICE_TALK_START = 4, //对讲开始
29  PLAYER_VOICE_TALK_END = 5, //对讲结束
30  PLAYER_STREAM_START = 10, //录像取流开始
31  PLAYER_PLAYBACK_START = 11, //录像回放开始播放
32  PLAYER_PLAYBACK_STOP = 12, //录像回放结束播放
33  PLAYER_PLAYBACK_FINISHED = 13, //录像回放被用户强制中断
34  PLAYER_PLAYBACK_PAUSE = 14, //录像回放暂停
35  PLAYER_NET_CHANGED = 21, //播放器检测到wifi变换过
36  PLAYER_NO_NETWORK = 22, //播放器检测到无网络
37 };
38 
39 
43 typedef NS_ENUM(NSInteger, EZPlaybackRate) {
44  EZ_PLAYBACK_RATE_1 = 1, // 1倍速
45  EZ_PLAYBACK_RATE_2, // 2倍速
46  EZ_PLAYBACK_RATE_2_1, // 1/2倍速
47  EZ_PLAYBACK_RATE_4, // 4倍速
48  EZ_PLAYBACK_RATE_4_1, // 1/4倍速
49  EZ_PLAYBACK_RATE_8, // 8倍速
50  EZ_PLAYBACK_RATE_8_1, // 1/8倍速
51 };
52 
56 typedef NS_ENUM(NSInteger, EZCloudPlaybackRate) {
57  EZ_CLOUD_PLAYBACK_RATE_1 = 1, // 1倍速
58  EZ_CLOUD_PLAYBACK_RATE_4 = 4, // 4倍速
59  EZ_CLOUD_PLAYBACK_RATE_8 = 6, // 8倍速
60  EZ_CLOUD_PLAYBACK_RATE_16 = 8, // 16倍速
61  EZ_CLOUD_PLAYBACK_RATE_32 = 10, // 32倍速
62 };
63 
65 @protocol EZPlayerDelegate <NSObject>
66 
67 @optional
74 - (void)player:(EZPlayer *)player didPlayFailed:(NSError *)error;
75 
82 - (void)player:(EZPlayer *)player didReceivedMessage:(NSInteger)messageCode;
83 
90 - (void)player:(EZPlayer *)player didReceivedDataLength:(NSInteger)dataLength;
91 
99 - (void)player:(EZPlayer *)player didReceivedDisplayHeight:(NSInteger)height displayWidth:(NSInteger)width;
100 
101 @end
102 
104 @interface EZPlayer : NSObject
105 
107 @property (nonatomic, weak) id<EZPlayerDelegate> delegate;
108 
110 @property (nonatomic) BOOL backgroundModeByPlayer;
111 
120 + (instancetype)createPlayerWithDeviceSerial:(NSString *)deviceSerial cameraNo:(NSInteger)cameraNo;
121 
129 + (instancetype)createPlayerWithUrl:(NSString *)url;
130 
131 
140 + (instancetype)createPlayerWithUserId:(NSInteger) userId cameraNo:(NSInteger) cameraNo streamType:(NSInteger) streamType;
141 
147 - (BOOL)destoryPlayer;
148 
154 - (void)setPlayerView:(UIView *)playerView;
155 
161 - (BOOL)startRealPlay;
162 
168 - (BOOL)stopRealPlay;
169 
175 - (void)setPlayVerifyCode:(NSString *)verifyCode;
176 
182 - (BOOL)openSound;
183 
189 - (BOOL)closeSound;
190 
196 - (BOOL)startVoiceTalk;
197 
203 - (BOOL)stopVoiceTalk;
204 
212 - (BOOL)audioTalkPressed:(BOOL)isPressed;
213 
220 - (BOOL)startPlaybackFromCloud:(EZCloudRecordFile *)cloudFile;
221 
229 - (BOOL)startPlaybackFromDevice:(EZDeviceRecordFile *)deviceFile;
230 
234 - (BOOL)pausePlayback;
235 
239 - (BOOL)resumePlayback;
240 
246 - (void)seekPlayback:(NSDate *)offsetTime;
247 
253 - (NSDate *)getOSDTime;
254 
258 - (BOOL)stopPlayback;
259 
267 - (BOOL)startLocalRecord:(void (^)(NSData *data))recordDataBlock;
268 
276 - (BOOL)startLocalRecordWithPath:(NSString *)path;
277 
283 - (BOOL)stopLocalRecord;
284 
292 - (UIImage *)capturePicture:(NSInteger)quality;
293 
299 - (int) getPlayPort;
300 
307 - (BOOL) setPlaybackRate:(EZPlaybackRate) rate;
308 
315 - (BOOL) setCloudPlaybackRate:(EZCloudPlaybackRate) rate;
316 
317 @end
318 
BOOL startRealPlay()
BOOL stopRealPlay()
萤石播放器delegate方法
Definition: EZPlayer.h:65
BOOL destoryPlayer()
BOOL resumePlayback()
BOOL stopLocalRecord()
BOOL pausePlayback()
BOOL stopPlayback()
id< EZPlayerDelegate > delegate
EZPlayer关联的delegate.
Definition: EZPlayer.h:107
此类为萤石播放器类
Definition: EZPlayer.h:104
BOOL openSound()
BOOL backgroundModeByPlayer
是否让播放器处理进入后台,YES:自动处理;NO:不处理,默认为YES
Definition: EZPlayer.h:110
此类为设备录像文件信息(包含SD卡、后端关联设备的录像)
Definition: EZDeviceRecordFile.h:12
BOOL closeSound()
int getPlayPort()
BOOL stopVoiceTalk()
此类为云存储录像文件对象
Definition: EZCloudRecordFile.h:12
NSDate * getOSDTime()
BOOL startVoiceTalk()