TF卡录像播放
This page only Chinese language
版本/作者/日期 | 修改内容 |
---|---|
1.0/Sandy/2015-09-24 | 初版 |
7.TF卡录像播放
条件:1)摄像机连接成功;2)固件支持,不是所有的摄像机固件都支持此功能
语法:
1)函数
-(int)playRecord:(int)record_id filePath:(NSString*)filePath; //播放tf卡录像文件 参数:(int)record_id:固定为0 (NSString*)filePath:录像文件路径 -(void)stopPlayRecord; //停止播放录像
2)消息通知
FOUNDATION_EXPORT NSString* const IPCamera_PlayRecord_Status_Changed_Notification; //录像播放状态改变 FOUNDATION_EXPORT NSString* const IPCamera_PlayRecord_Notify_Notification; //录像播放通知
3) 设置成功后的消息回调
(void)IPCamera_response_function:(NSNotification*)note;
IPCamera.h宏定义了两种注册消息的方法
#define ADD_IPCAMERA_RESPONSE_WITHOUT_ARG(notice_name) \ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(IPCamera_response_function:) name: notice_name object: nil] #define ADD_IPCAMERA_RESPONSE_WITH_ARG(notice_name,camera_object) \ [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(IPCamera_response_function:) name: notice_name object: camera_object]
示列:
1)注册消息通知
ADD_IPCAMERA_RESPONSE_WITH_ARG( IPCamera_PlayRecord_Status_Changed_Notification, cam_) ADD_IPCAMERA_RESPONSE_WITH_ARG( IPCamera_PlayRecord_Notify_Notification, cam_)
2)播放录像
[cam_ playRecord:0 filePath: recordpath];
3)停止播放录像
[cam_ stopPlayRecord];
4)消息通知回调
-(void)IPCamera_response_function:(NSNotification*)note { if( [note.name isEqualToString:IPCamera_PlayRecord_Status_Changed_Notification ]) { NSLog(@"播放录像状态改变"); } if( [note.name isEqualToString:IPCamera_PlayRecord_Notify_Notification ]) { NSLog(@"开始播放通知"); } }