EZOpenSDK  v4.7.1
 All Classes Functions Properties
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, //low
19  EZVideoQualityMiddle = 1, //normal
20  EZVideoQualityHigh = 2 //high
21 };
22 
23 /* Player states */
24 typedef NS_ENUM(NSInteger, EZMessageCode) {
25  PLAYER_REALPLAY_START = 1, //Live start
26  PLAYER_VIDEOLEVEL_CHANGE = 2, //Video quality changing
27  PLAYER_STREAM_RECONNECT = 3, //Live stream reconnecting
28  PLAYER_VOICE_TALK_START = 4, //Intercom start
29  PLAYER_VOICE_TALK_END = 5, //Intercom end
30  PLAYER_STREAM_START = 10, //Playback stream start
31  PLAYER_PLAYBACK_START = 11, //Playback start
32  PLAYER_PLAYBACK_STOP = 12, //Playback end
33  PLAYER_PLAYBACK_FINISHED = 13, //Playback stop by user
34  PLAYER_PLAYBACK_PAUSE = 14, //Playback pause
35  PLAYER_NET_CHANGED = 21, //Network changed
36  PLAYER_NO_NETWORK = 22, //No network
37 };
38 
40 @protocol EZPlayerDelegate <NSObject>
41 
42 @optional
49 - (void)player:(EZPlayer *)player didPlayFailed:(NSError *)error;
50 
57 - (void)player:(EZPlayer *)player didReceivedMessage:(NSInteger)messageCode;
58 
65 - (void)player:(EZPlayer *)player didReceivedDataLength:(NSInteger)dataLength;
66 
74 - (void)player:(EZPlayer *)player didReceivedDisplayHeight:(NSInteger)height displayWidth:(NSInteger)width;
75 
76 @end
77 
79 @interface EZPlayer : NSObject
80 
82 @property (nonatomic, weak) id<EZPlayerDelegate> delegate;
83 
85 @property (nonatomic) BOOL backgroundModeByPlayer;
86 
95 + (instancetype)createPlayerWithDeviceSerial:(NSString *)deviceSerial cameraNo:(NSInteger)cameraNo;
96 
104 + (instancetype)createPlayerWithUrl:(NSString *)url;
105 
106 
115 + (instancetype)createPlayerWithUserId:(NSInteger) userId cameraNo:(NSInteger) cameraNo streamType:(NSInteger) streamType;
116 
122 - (BOOL)destoryPlayer;
123 
129 - (void)setPlayerView:(UIView *)playerView;
130 
136 - (BOOL)startRealPlay;
137 
143 - (BOOL)stopRealPlay;
144 
150 - (void)setPlayVerifyCode:(NSString *)verifyCode;
151 
157 - (BOOL)openSound;
158 
164 - (BOOL)closeSound;
165 
171 - (BOOL)startVoiceTalk;
172 
178 - (BOOL)stopVoiceTalk;
179 
187 - (BOOL)audioTalkPressed:(BOOL)isPressed;
188 
195 - (BOOL)startPlaybackFromCloud:(EZCloudRecordFile *)cloudFile;
196 
204 - (BOOL)startPlaybackFromDevice:(EZDeviceRecordFile *)deviceFile;
205 
209 - (BOOL)pausePlayback;
210 
214 - (BOOL)resumePlayback;
215 
221 - (void)seekPlayback:(NSDate *)offsetTime;
222 
228 - (NSDate *)getOSDTime;
229 
233 - (BOOL)stopPlayback;
234 
242 - (BOOL)startLocalRecord:(void (^)(NSData *data))recordDataBlock;
243 
251 - (BOOL)startLocalRecordWithPath:(NSString *)path;
252 
258 - (BOOL)stopLocalRecord;
259 
267 - (UIImage *)capturePicture:(NSInteger)quality;
268 
269 
270 @end
271 
BOOL startRealPlay()
BOOL stopRealPlay()
Player delegate.
Definition: EZPlayer.h:40
BOOL destoryPlayer()
BOOL resumePlayback()
BOOL stopLocalRecord()
BOOL pausePlayback()
BOOL stopPlayback()
id< EZPlayerDelegate > delegate
delegate
Definition: EZPlayer.h:82
Player class.
Definition: EZPlayer.h:79
BOOL openSound()
BOOL backgroundModeByPlayer
Auto process when app enter background.YES:auto process;NO:no process,default YES.
Definition: EZPlayer.h:85
Device video information (including the video of SD card, NVR, and DVR)
Definition: EZDeviceRecordFile.h:12
BOOL closeSound()
BOOL stopVoiceTalk()
Cloud storage video.
Definition: EZCloudRecordFile.h:12
NSDate * getOSDTime()
BOOL startVoiceTalk()