云回看
更新时间:2025-04-01 16:44:30
云端存储录像与事件
// 导入设备管理SDK头文件
#import <RTCXDeviceCenter/RTCXDeviceCenter.h>
云存储录像调用接口
@protocol RTCXCloudStorageProtocol <NSObject>
/**
* 查询云存录像列表
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryRecordListWithReq:(nonnull RTCXCloudStorageRecordReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询云存事件列表
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryEventListWithReq:(nonnull RTCXCloudStorageEventReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询云存录像点播地址
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryVodUrlWithReq:(nonnull RTCXCloudStorageVodUrlReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询云存事件点播地址
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryVodEventUrlWithReq:(nonnull RTCXCloudStorageVodEventUrlReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询月录像
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryMonthRecordWithReq:(nonnull RTCXCloudStorageMonthRecordReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询月事件
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryMonthEventWithReq:(nonnull RTCXCloudStorageMonthEventReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询月消息(消息中心按天统计)
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryMonthMessageWithReq:(nonnull RTCXCloudStorageMonthMessageReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 删除云存录像
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)deleteRecordWithReq:(nonnull RTCXCloudStorageDeleteRecordReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 删除云存事件
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)deleteEventWithReq:(nonnull RTCXCloudStorageDeleteEventReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询事件描述(事件最新记录时间,事件小红点)
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryEventDescWithReq:(nonnull RTCXCloudStorageEventDescReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询消息中心事件描述(消息中心最新记录时间,消息中心小红点)
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryMessageDescWithReq:(nonnull RTCXCloudStorageMessageDescReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 查询消息中心事件列表
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryMessageCenterEventListWithReq:(nonnull RTCXCloudStorageMessageEventReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
/**
* 批量删除消息中心事件
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)deleteMessageWithReq:(nonnull RTCXCloudStorageDeleteMessageReq *)req onSuccess:(nullable RTCXCloudStorageOnSuccess)onSuccess onError:(nullable RTCXCloudStorageOnError)onError;
@end
云端存储套餐调用接口
@protocol RTCXCloudServicesProtocol <NSObject>
/**
* 查询当前云存储套餐详情
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryDeviceCurrentCloudServicesWithReq:(nonnull RTCXCloudServicesReq *)req onSuccess:(nullable RTCXCloudServicesOnSuccess)onSuccess onError:(nullable RTCXCloudServicesOnError)onError;
/**
* 查询历史云存储套餐详情
*
* @param req 请求参数对象
* @param onSuccess 成功回调
* @param onError 失败回调
*/
- (void)queryDeviceHistoryCloudServicesWithReq:(nonnull RTCXCloudServicesReq *)req onSuccess:(nullable RTCXCloudServicesOnSuccess)onSuccess onError:(nullable RTCXCloudServicesOnError)onError;
@end
查询云存录像列表
备注:该接口默认一次性返回beginTime和endTime时间段内所有数据,(注意:如果该时间段跨度比较大,可能查询比较耗时,所以建议不要跨度太大,或者通过分页查询)
- 分页规则:
-
设置pageSize参数,如pageSize = @(10)
-
当响应的RTCXCloudStorageRecordListRsp.nextValid = YES,说明可以继续查询下一页数据,否则没有可查询的更多数据了;
-
查寻下一页时,入参beginTime为上一次的beginTime,endTime为上一次的RTCXCloudStorageRecordListRsp.nextEndTime。
-
RTCXCloudStorageRecordReq *recordReq = [[RTCXCloudStorageRecordReq alloc] init];
recordReq.iotId = weakSelf.curDevice.iotId;
recordReq.beginTime = @(beginTime);
recordReq.endTime = @(endTime);
[RTCXDeviceService(RTCXCloudStorageProtocol) queryRecordListWithReq:recordReq onSuccess:^(id _Nullable data, id _Nullable rawData) {
RTCXCloudStorageRecordListRsp *rsp = data;
NSArray *records = rsp.recordFileList;
NSMutableArray *sectionArray = [[NSMutableArray alloc] initWithCapacity:0];
[records enumerateObjectsUsingBlock:^(RTCXCloudStorageRecordRsp *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
TimelineSectionClip *sectionClip = [[TimelineSectionClip alloc] init];
sectionClip.startTime = [NSDate dateWithTimeIntervalSince1970:obj.beginTime/1000];
sectionClip.endTime = [NSDate dateWithTimeIntervalSince1970:obj.endTime/1000];
[sectionArray addObject:sectionClip];
}];
[weakSelf.timelineData insertSectionDatas:sectionArray needUpdateWhenSameID:YES];
} onError:^(NSError * _Nullable error) {
[weakSelf showToast:@"查询云存录像列表失败"];
}];
查询云存事件列表
备注:该接口默认一次性返回beginTime和endTime时间段内所有数据,(注意:如果该时间段跨度比较大,可能查询比较耗时,所以建议不要跨度太大,或者通过分页查询)
- 分页规则:
-
设置pageSize参数,如pageSize = @(50)
-
当响应的RTCXCloudStorageRecordListRsp.nextValid = YES,说明可以继续查询下一页数据,否则没有可查询的更多数据了;
-
查寻下一页时,入参beginTime为上一次的beginTime,endTime为上一次的RTCXCloudStorageRecordListRsp.nextEndTime。
-
RTCXCloudStorageEventReq *eventReq = [[RTCXCloudStorageEventReq alloc] init];
eventReq.iotId = weakSelf.curDevice.iotId;
eventReq.beginTime = @(beginTime);
eventReq.endTime = @(endTime);
[RTCXDeviceService(RTCXCloudStorageProtocol) queryEventListWithReq:eventReq onSuccess:^(id _Nullable data, id _Nullable rawData) {
NSArray *events = data;
NSMutableArray *eventArray = [[NSMutableArray alloc] initWithCapacity:0];
[events enumerateObjectsUsingBlock:^(RTCXCloudStorageEventRsp *_Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
TimelineEventClip *eventClip = [[TimelineEventClip alloc] init];
eventClip.eventID = [NSString stringWithFormat:@"%ld",(long)obj.eventId];
eventClip.startTime = [NSDate dateWithTimeIntervalSince1970:obj.beginTime/1000];
eventClip.endTime = [NSDate dateWithTimeIntervalSince1970:obj.endTime/1000];
eventClip.eventType = [NSString stringWithFormat:@"%ld",(long)IOTEventModeMotion];
eventClip.region = obj.region;
[eventArray addObject:eventClip];
}];
[weakSelf.timelineData insertEventDatas:eventArray needUpdateWhenSameID:YES];
} onError:^(NSError * _Nullable error) {
[weakSelf showToast:@"查询事件列表失败"];
}];