跳到主要内容

云回看

更新时间:2026-10-29 10:05:40

云端存储录像相关接口与【通用版-云回看】相同,区别在于专属版在构建请求对象时,需要将 deviceType 设置为 1,用于区分专属版设备。

// 导入云回看头文件
import { RTCXCloudPlayback, RTCXPlaybackTypes } from 'rtcxsdk'

专属版目前支持如下接口:

/**
* 查询录制列表
*/
export declare function recordQuery(params: RecordQueryReq): Promise<RecordQueryRsp>;

/**
* 查询录制事件
*/
export declare function eventQuery(params: EventQueryReq): Promise<EventQueryRsp>;

/**
* 查询月录像(录制统计)
*/
export declare function monthRecordQuery(monthQueryReq: MonthQueryReq): Promise<MonthQueryRsp>;

/**
* 查询月事件(事件统计)
*/
export declare function monthEventQuery(monthQueryReq: MonthQueryReq): Promise<MonthQueryRsp>;

/**
* 录制删除
*/
export declare function recordDelete(recordDeleteReq: RecordDeleteReq): Promise<Object>;

/**
* 事件批量删除
*/
export declare function eventBatchDelete(iotId: string, eventList: TimelineEventInfo[]): Promise<Object | undefined>;

/**
* 获取设备事件描述(查询最新一条事件时间,用于显示小红点)
*/
export declare function getDeviceEventDesc(descReq: DeviceEventDescReq): Promise<DeviceDescRsp>;

查询云存录像列表​

备注:该接口默认一次性返回 beginTime 和 endTime 时间段内所有数据,如果时间跨度较大,查询可能比较耗时,建议不要跨度太大,或者通过分页查询。

  • 分页规则:
    • 设置 pageSize 参数,如 pageSize = 1000;
    • 当响应的 RecordQueryRsp.nextValid = true,说明可以继续查询下一页数据,否则没有更多数据;
    • 查询下一页时,入参 beginTime 为上一次的 beginTime,endTime 为上一次的 RecordQueryRsp.nextEndTime。
const reqParams: RTCXPlaybackTypes.RecordQueryReq = {
iotId: this.deviceInfo?.iotId!!,
beginTime: startOfDate(this.selectedDate).getTime(),
endTime: endOfDate(this.selectedDate).getTime(),
pageSize: 1000,
deviceType: 1 // 1:专属版设备
}
try {
const rsp = await RTCXCloudPlayback.recordQuery(reqParams)
this.dataList = rsp.recordFileList
} catch (e) {
showToast(this, `获取数据失败${e}`)
}

查询云存事件列表​

分页规则与录像列表一致,下一页结束时间取 EventQueryRsp.nextEndTime。

const reqParams: RTCXPlaybackTypes.EventQueryReq = {
iotId: this.deviceInfo?.iotId!!,
beginTime: startOfDate(this.selectedDate).getTime(),
endTime: endOfDate(this.selectedDate).getTime(),
pageSize: 1000,
deviceType: 1 // 1:专属版设备
}
try {
const rsp = await RTCXCloudPlayback.eventQuery(reqParams)
this.dataList = rsp.eventList
} catch (e) {
showToast(this, `获取数据失败${e}`)
}

查询月录像​

const reqParams: RTCXPlaybackTypes.MonthQueryReq = {
iotId: this.deviceInfo?.iotId!!,
beginTime: startOfDate(this.startDate).getTime(),
endTime: endOfDate(this.endDate).getTime(),
zoneOffsetId: getTimezoneFormatted(),
deviceType: 1 // 1:专属版设备
}
try {
const rsp = await RTCXCloudPlayback.monthRecordQuery(reqParams)
this.dataList = rsp.dayCntList
} catch (e) {
showToast(this, `获取数据失败${e}`)
}

查询月事件​

const reqParams: RTCXPlaybackTypes.MonthQueryReq = {
iotId: this.deviceInfo?.iotId!!,
beginTime: startOfDate(this.startDate).getTime(),
endTime: endOfDate(this.endDate).getTime(),
zoneOffsetId: getTimezoneFormatted(),
deviceType: 1 // 1:专属版设备
}
try {
const rsp = await RTCXCloudPlayback.monthEventQuery(reqParams)
this.dataList = rsp.dayCntList
} catch (e) {
showToast(this, `获取数据失败${e}`)
}

删除云存录像​

const reqParams: RTCXPlaybackTypes.RecordDeleteReq = {
iotId: this.deviceInfo?.iotId!!,
beginTime: startOfDate(this.startDate).getTime(),
endTime: endOfDate(this.endDate).getTime(),
deviceType: 1 // 1:专属版设备
}
try {
await RTCXCloudPlayback.recordDelete(reqParams)
} catch (e) {
showToast(this, `删除失败${e}`)
}

删除云存事件​

事件列表中的每个事件都需要带上 deviceType,SDK 会使用第一条事件的 deviceType 选择专属版通道。

const eventList: RTCXPlaybackTypes.TimelineEventInfo[] = [{
eventId: eventId,
eventType: eventType,
beginTime: startOfDate(this.startDate).getTime(),
endTime: endOfDate(this.endDate).getTime(),
region: region,
deviceType: 1 // 1:专属版设备
}]
try {
await RTCXCloudPlayback.eventBatchDelete(this.deviceInfo?.iotId!!, eventList)
} catch (e) {
showToast(this, `删除失败${e}`)
}

查询事件描述​

查询事件最新记录时间,用于显示事件小红点。

const reqParams: RTCXPlaybackTypes.DeviceEventDescReq = {
iotId: this.deviceInfo?.iotId!!,
deviceType: 1 // 1:专属版设备
}
try {
const rsp = await RTCXCloudPlayback.getDeviceEventDesc(reqParams)
} catch (e) {
showToast(this, `获取数据失败${e}`)
}

设备缩略图​

专属版设备的缩略图通过物模型服务 GetDevPicture 获取。创建物模型对象时,请确保设备信息中的 deviceType 为 1,具体见【音视频播放-设备在线状态】。

import { RTCXThingModelType } from 'rtcxsdk'

const result = await this.thingModel?.invokeService<IDevPicture>('GetDevPicture', {
'definition': 1,
'picType': 'jpg'
})
if (result) {
const rsp = result as RTCXThingModelType.InvokeServiceRsp<IDevPicture>
if (rsp.code == 200) {
const devPicture = rsp.data as IDevPicture
this.deviceThumbnails[this.deviceInfo?.iotId!!] = devPicture
} else {
showToast(this, '获取缩略图失败')
}
}