UNPKG

kaimo_rtsp_plugin

Version:

RTSP plugin for Capacitor with native AAR support

173 lines (172 loc) 4.04 kB
export interface rtsp_viewPlugin { /** * 开始拉流 (JNI功能) * @param options 包含RTSP URL的选项 * @returns 操作结果 */ startPull(options: { url: string; }): Promise<{ success: boolean; }>; /** * 停止拉流 (JNI功能) * @returns 操作结果 */ stopPull(): Promise<{ success: boolean; }>; /** * 保存JPEG图像 (JNI功能) * @param options 包含保存路径的选项 * @returns 操作结果 */ saveJpg(options: { directUrl: string; }): Promise<{ success: boolean; }>; /** * 开始录制MP4视频 (JNI功能) * @param options 包含保存路径的选项 * @returns 操作结果 */ saveMp4(options: { directUrl: string; }): Promise<{ success: boolean; }>; /** * 停止录制MP4视频 (JNI功能) * @returns 操作结果 */ stopRecordMp4(): Promise<{ success: boolean; }>; /** * 获取录制状态 (JNI功能) * @returns 是否正在录制 */ isRecording(): Promise<{ recording: boolean; }>; /** * 写入二进制文件数据 * @param options 包含文件路径和数据的选项 * @returns 操作结果 */ writeBinaryByJava(options: { url: string; data: string; replace: boolean; isFirstChunk: boolean; isLastChunk: boolean; chunkIndex: number; }): Promise<{ success: boolean; }>; /** * 启动相机预览 * @param options 相机预览配置选项 * @returns 操作结果 */ startCameraPreview(options: { camera: 'rear' | 'front'; x: number; y: number; width: number; height: number; toBack?: boolean; tapPhoto?: boolean; tapFocus?: boolean; alpha?: number; }): Promise<{ success: boolean; }>; /** * 停止相机预览 * @returns 操作结果 */ stopCameraPreview(): Promise<{ success: boolean; }>; /** * 更新RTSP预览位置 - 接收HTML滑动后的坐标变化 * @param options 坐标参数 * @returns 操作结果 */ rtspUpdatePos(options: { x: number; y: number; width: number; height: number; }): Promise<{ success: boolean; message: string; }>; rtspCreateDir(options: { directUrl: string; }): Promise<{ success: boolean; message: string; }>; } export interface rtsp_jniPlugin { /** * 开始拉流 * @param options 包含RTSP URL的选项 * @returns 操作结果 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ startPull(options: { url: string; }): Promise<{ success: boolean; }>; /** * 停止拉流 * @returns 操作结果 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ stopPull(): Promise<{ success: boolean; }>; /** * 保存JPEG图像 * @param options 包含保存路径的选项 * @returns 操作结果 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ saveJpg(options: { directUrl: string; }): Promise<{ success: boolean; }>; /** * 开始录制MP4视频 * @param options 包含保存路径的选项 * @returns 操作结果 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ saveMp4(options: { directUrl: string; }): Promise<{ success: boolean; }>; /** * 停止录制MP4视频 * @returns 操作结果 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ stopRecordMp4(): Promise<{ success: boolean; }>; /** * 获取录制状态 * @returns 是否正在录制 * @deprecated 使用rtsp_viewPlugin中的同名方法 */ isRecording(): Promise<{ recording: boolean; }>; }