更新记录

1.0.2(2025-12-29)

优化

1.0.1(2025-12-29)

优化

1.0.0(2025-12-29)

初次提交

查看更多

平台兼容性

uni-app(4.81)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - - -

uni-app x(4.81)

Chrome Safari Android iOS 鸿蒙 微信小程序
- - - -

umini-hk2036

开发文档

接口

export type HK2036Listener = {
    /**
     * 灯的状态监听
     * 
     * LIGHT_WHITE = 0x01 白灯
     * 
     * LIGHT_PURPLE = 0x02 紫灯
     * 
     * LIGHT_RED_ON = 0x03 红灯开
     * 
     * LIGHT_RED_OFF = 0x04 红灯关
     */
    onLightStatusReceived ?: OnLightStatusReceived
    /**
     * 电池状态监听
     */
    onBatteryStatusReceived ?: OnBatteryStatusReceived
    /**
     * 同步时间监听
     */
    onSyncTimeReceived ?: OnSyncTimeReceived
    /**
     * 拍照按钮监听
     */
    onPhotoCommandReceived ?: OnPhotoCommandReceived

    onRecordReceived ?: OnRecordReceived

    /**
     * 关机监听
     */
    onDeviceShutdown ?: OnDeviceShutdown
}

export interface IHK2036Controller {
    /**
     * 初始化并设置监听
     */
    initialize(listener : HK2036Listener) : void
    /**
     * 销毁
     */
    release() : void
    /**
     * 设置灯的状态
     * LIGHT_WHITE = 0x01 白灯
     * LIGHT_PURPLE = 0x02 紫灯
     * LIGHT_RED_ON = 0x03 红灯开
     * LIGHT_RED_OFF = 0x04 红灯关
     */
    setLightStatus(status : number) : void
    /**
     * 关机
     */
    setDeviceShutdown() : void
}

使用方法


HK2036Controller.initialize({
    onLightStatusReceived: (status) => {
        console.log("onLightStatusReceived = " + status)
    },
    onBatteryStatusReceived: (isCharging, level) => {
        console.log("isCharging = " + isCharging + " level = " + level)
    },
    onPhotoCommandReceived: () => {

    }
});

openRedLight() {
    HK2036Controller.setLightStatus(HK2036Controller.LIGHT_RED_ON)
},
closeRedLight() {
    HK2036Controller.setLightStatus(HK2036Controller.LIGHT_RED_OFF)
}

HK2036Controller.release()

视频

<template>
    <view>
        <Hk2036Camera url="rtsp://192.168.1.1:7070/webcam"></Hk2036Camera>
    </view>
</template>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。