音视频接口
更新日期:2025/5/15
目录
音视频接口
TK_start
- 功能描述:
- 开启AV通道。
接口定义
export const TK_start: (uid: string, channel: number, password: string, account: string) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道号,一般为0 |
password | string | 设备密码 |
account | string | 设备用户名 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_start: (uid, channel, password, account)
TK_start2
- 功能描述:
- 开启AV通道(支持authType和securityMode设定)。
接口定义
export const TK_start2: (uid: string, channel: number, password: string, account: string, authType: TKAuthType, securityMode: TKSecurityMode) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道号 |
password | string | 设备密码 |
account | string | 设备用户名 |
authType | 设备验证码类型 | |
securityMode | 加密模式 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_start2: (uid, channel, password, account, TKAuthType.Password, TKSecurityMode.AUTO)
TK_stop
- 功能描述:
- 关闭AV通道。
接口定义
export const TK_stop: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道号 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stop: (uid, channel)
TK_startShow
- 功能描述:
- 开始接收、解码并显示画面。
接口定义
export const TK_startShow: (uid: string, channel: number, xids: string[]) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
xids | array | 指定XComponent IDs |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startShow: (uid, channel, ["window1"])
TK_startShow2
- 功能描述:
- 开始接收、解码并显示画面。
接口定义
export const TK_startShow2: (uid: string, channel: number, xids: string[], isDecodeAndRender: boolean, isSWDecode: boolean, isDropFrame: boolean, renderType: RENDER_TYPE, isSendComond: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
xids | array | 指定XComponent IDs |
isDecodeAndRender | boolean | 是否解码并渲染 |
isSWDecode | boolean | 是否软解 |
isDropFrame | boolean | 是否丢P帧 |
renderType | 输出数据类型 | |
isSendCommand | boolean | 是否发送指令1FF/2FF |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startShow2: (uid, channel, ["window1"], true, false, false, OUTPUT_EMPTY, true)
TK_stopShow
- 功能描述:
- 停止接收、解码和画面显示。
接口定义
export const TK_stopShow: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stopShow: (uid, channel)
TK_startSoundToPhone
- 功能描述:
- 开始接收、解码并监听设备声音。
接口定义
export const TK_startSoundToPhone: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startSoundToPhone: (uid, channel)
TK_stopSoundToPhone
- 功能描述:
- 停止接收、解码和监听设备声音。
接口定义
export const TK_stopSoundToPhone: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stopSoundToPhone: (uid, channel)
TK_startSoundToDevice
- 功能描述:
- 开始对讲(发送声音到设备)。
接口定义
export const TK_startSoundToDevice: (uid: string, channel: number, isResend: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
isResend | boolean | 是否开启重传 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startSoundToDevice: (uid, channel, true)
TK_stopSoundToDevice
- 功能描述:
- 停止对讲。
接口定义
export const TK_stopSoundToDevice: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stopSoundToDevice: (uid, channel)
TK_startVideoToDevice
- 功能描述:
- 开始建立视频发送通道(发送视频到设备)。
接口定义
export const TK_startVideoToDevice: (uid: string, channel: number, isResend: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
isResend | boolean | 是否开启重传 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startVideoToDevice: (uid, channel, true)
TK_stopVideoToDevice
- 功能描述:
- 停止发送视频并关闭通道。
接口定义
export const TK_stopVideoToDevice: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stopVideoToDevice: (uid, channel)
TK_sendVideoToDevice
- 功能描述:
- 发送视频帧。
接口定义
export const TK_sendVideoToDevice: (uid: string, channel: number, buff: Uint8Array, buffer_size: number, pts: number, codec_id: number, isKeyFrame: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
buff | Uint8Array | 视频帧数据 |
buffer_size | number | 数据长度 |
pts | number | 视频帧对应时间戳 |
codec_id | number | 帧数据编码格式 |
isKeyFrame | boolean | 是否是关键帧 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_sendVideoToDevice: (uid, channel, buff, buff_size, timestamp, 0x4E, true)
TK_setHWDecodingAbility
- 功能描述:
- 设置指定通道的解码方式。
接口定义
export const TK_setHWDecodingAbility: (uid: string, channel: number, isHWDecode: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
isHWDecode | boolean | 是否硬解码 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_setHWDecodingAbility: (uid, channel, true)
TK_snapshot
- 功能描述:
- 截取图片。
接口定义
export const TK_snapshot: (uid: string, channel: number, filepath: string, cb: (arg: snapshotState) => void) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
filepath | string | 沙盒图片路径 |
cb | 截图结果回调 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_snapshot: (uid, channel, filepath,(state: snapshotState) => {})
TK_startRecording
- 功能描述:
- 指定通道开始本地录像。
接口定义
export const TK_startRecording: (uid: string, channel: number, filepath: string, isListening: boolean) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
filepath | string | 沙盒图片路径 |
isListening | boolean | 是否播放监听声音 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_startRecording: (uid, channel, filepath, false)
TK_stopRecording
- 功能描述:
- 停止录像。
接口定义
export const TK_stopRecording: (uid: string, channel: number) => number;
参数说明
参数 | 类型 | 说明 |
---|---|---|
uid | string | 设备uid |
channel | number | av通道 |
回调说明
暂无
返回码
暂无
代码示例
camera.TK_stopRecording: (uid, channel)