更新记录

v1.0.2022.0306(2023-03-07)

2023-03-06

修复对讲开启失败的bug。

v1.0.2021.0914(2021-09-14)

2021-09-14

1、添加配网功能。 2、添加部分回调。 3、修复语音对讲功能。

v1.0.2021.0807(2021-08-06)

2021-08-06 发布新版

查看更多

平台兼容性

Android Android CPU类型 iOS
适用版本区间:4.4 - 11.0 armeabi-v7a:未测试,arm64-v8a:未测试,x86:未测试 ×

原生插件通用使用流程:

  1. 购买插件,选择该插件绑定的项目。
  2. 在HBuilderX里找到项目,在manifest的app原生插件配置中勾选模块,如需要填写参数则参考插件作者的文档添加。
  3. 根据插件作者的提供的文档开发代码,在代码中引用插件,调用插件功能。
  4. 打包自定义基座,选择插件,得到自定义基座,然后运行时选择自定义基座,进行log输出测试。
  5. 开发完毕后正式云打包

付费原生插件目前不支持离线打包。
Android 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/android
iOS 离线打包原生插件另见文档 https://nativesupport.dcloud.net.cn/NativePlugin/offline_package/ios

注意事项:使用HBuilderX2.7.14以下版本,如果同一插件且同一appid下购买并绑定了多个包名,提交云打包界面提示包名绑定不一致时,需要在HBuilderX项目中manifest.json->“App原生插件配置”->”云端插件“列表中删除该插件重新选择


插件使用说明:

一、修改app.vue萤石云初始化appKey和accessToken为自己的

<script>
    export default {
        onLaunch: function() {
            var ezOpenModule = uni.requireNativePlugin("XM-EZMonitor-EZOpenModule")
            var ret = ezOpenModule.initSDK({
                "accessToken": "at.2kg8zfq3cs08su138qtym6r3djdtf53o-6bfs2rysr5-1n0bvvj-xxxxxxxxx", //请将此替换成自己的参数
                "appKey": "26810f3acd794862b608b6cfbc32xxxx", //请将此替换成自己的参数
                "serverAreaId": 0, //非必要不要修改
                "openApiServer": "https://open.ys7.com", //非必要不要修改
                "openAuthApiServer": "https://openauth.ys7.com", //非必要不要修改
                "usingGlobalSDK": false //非必要不要修改

            })
            console.log(ret)
            console.log('App Launch')
        },
        onShow: function() {
            console.log('App Show')
        },
        onHide: function() {
            console.log('App Hide')
        }
    }
</script>

<style>
    /*每个页面公共css */
    @import './common/uni-nvue.css';
</style>

二、修改实时预览摄像头信息

<template>
    <view>
        <view>
            <EZOpenMonitorView ref="hkView" :config="config" style="height: 500rpx; width: 100%;" @onError="onError" />
        </view>
        <view style="margin-top:100rpx;width: 750rpx;flex-direction: row;justify-content: center;">
            <div style="width: 402rpx;height: 402rpx;border-radius: 201rpx;background-color: #f4f4f4; margin: 0 auto;">
                <view style="flex-direction: row;justify-content: center;height: 134rpx;" @touchstart="up"
                    @touchend="stopPTZ">
                    <view style="width: 30rpx;height: 46rpx;margin-top: 30rpx;transform: rotateZ(90deg);">
                        <image style="width: 30rpx;height: 46rpx;" src="../../static/fangxiang.png" mode=""></image>
                    </view>
                </view>
                <view style="flex-direction: row;justify-content: center;align-items: center;height: 134rpx;">
                    <view style="width: 134rpx;height: 134rpx;flex-direction: row;align-items: center;"
                        @touchstart="left" @touchend="stopPTZ">
                        <view style="width: 30rpx;height: 46rpx;margin-left: 30rpx;">
                            <image style="width: 30rpx;height: 46rpx;" src="../../static/fangxiang.png" mode=""></image>
                        </view>
                    </view>
                    <div style="width: 134rpx;height: 134rpx;background-color: #f2804c;border-radius: 67px;"
                        @touchstart="startVoice" @touchend="stopVoice"></div>
                    <view style="width: 134rpx;height: 134rpx;flex-direction: row;align-items: center;"
                        @touchstart="right" @touchend="stopPTZ">
                        <view style="width: 30rpx;height: 46rpx;margin-left: 74rpx;transform: rotateZ(-180deg);">
                            <image style="width: 30rpx;height: 46rpx;" src="../../static/fangxiang.png" mode=""></image>
                        </view>
                    </view>
                </view>
                <view style="flex-direction: row;justify-content: center;height: 134rpx;" @touchstart="down"
                    @touchend="stopPTZ">
                    <view style="width: 30rpx;height: 46rpx;margin-top: 58rpx;transform: rotateZ(-90deg);">
                        <image style="width: 30rpx;height: 46rpx;" src="../../static/fangxiang.png" mode=""></image>
                    </view>
                </view>
            </div>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                config: {
                    "mCameraIndex": 0,
                    "mDeviceInfo": {
                        "addTime": 1617801422000,
                        "cameraInfoList": [{
                            "cameraCover": "https://statics.ys7.com/device/image/8464/101.jpeg",
                            "cameraName": "C6CN(F50805326)",
                            "cameraNo": 1,
                            "deviceSerial": "F50805326",
                            "isShared": 0,
                            "permission": -1,
                            "videoLevel": 2,
                            "videoQualityInfos": [{
                                "streamType": 2,
                                "videoLevel": 0,
                                "videoQualityName": "流畅"
                            }, {
                                "streamType": 1,
                                "videoLevel": 2,
                                "videoQualityName": "高清"
                            }]
                        }],
                        "cameraNum": 1,
                        "category": "C6CN",
                        "defence": 0,
                        "detectorNum": 0,
                        "deviceCover": "https://statics.ys7.com/device/image/CS-C6CN-3H3WF/101.jpeg",
                        "deviceName": "C6CN(F50805326)",
                        "deviceSerial": "F50805326",
                        "deviceType": "CS-C6CN-3H3WF",
                        "deviceVersion": "V5.3.4 build 210513",
                        "isEncrypt": 1,
                        "status": 1,
                        'supportChannelNums': 0,
                        },
                    "mVerifyCode": "000000",
                    "mRtspUrl": ""
                },
                index: 0,
                num: 1
            }
        },
        onLoad() {

        },
        onUnload() {
            this.$refs['hkView'].close();
        },
        onBackPress() {
            this.$refs['hkView'].exitFullScreen((ret) => {
                console.log(ret)
            });
        },
        methods: {
            startOrStop() {
                this.$refs['hkView'].startPreview();
            },
            up() {
                this.$refs['hkView'].up();
            },
            down() {
                this.$refs['hkView'].down();
            },
            left() {
                this.$refs['hkView'].left();
            },
            right() {
                this.$refs['hkView'].right();
            },
            stopPTZ() {
                this.$refs['hkView'].stopPTZ()
            },
            startPTZ(e) {
                this.$refs['hkView'].startPTZ(e)
            },
            startVoice() {
                this.$refs['hkView'].startVoiceTalk()
            },
            stopVoice() {
                this.$refs['hkView'].stopVoiceTalk()
            },
            retry() {
                this.index++
                if (this.index < 3) {
                    this.$refs['hkView'].retry(this.config);
                }
            },
            onError(res) {
                this.retry()
                plus.nativeUI.toast(res.detail);
            }
        }
    }
</script>

三、修改历史回放相关数据

<template>
    <view>
        <EZOpenPlaybackView ref="hkView" :config="config" style="height: 600rpx; width: 100%;" @onError="onError" />
    </view>

</template>

<script>
    export default {
        data() {
            return {
                config: {
                    "mCameraInfo": {
                        "cameraCover": "https://statics.ys7.com/device/image/8464/101.jpeg",
                        "cameraName": "C6CN(F50805326)",
                        "cameraNo": 1,
                        "deviceSerial": "F50805326",
                        "isShared": 0,
                        "permission": -1,
                        "videoLevel": 2,
                        "videoQualityInfos": [{
                            "streamType": 2,
                            "videoLevel": 0,
                            "videoQualityName": "流畅"
                        }, {
                            "streamType": 1,
                            "videoLevel": 2,
                            "videoQualityName": "高清"
                        }]
                    },
                    "mCloudPartInfoFile": {//历史回放相关信息,请通过api接口获取
                        "fileId": null,
                        "startTime": '20210803004322',
                        "endTime": '20210803005606',
                        "position": 100005,
                        "fileName": null,
                        "fileSize": 0,
                        "downloadPath": null,
                        "keyCheckSum": null,
                        "isCloud": false,
                        "fileType": 0,
                        "picUrl": null,
                        "startMillis": 1627922602000,
                        "endMillis": 1627923366000,
                        'deviceSerial': null,
                        'cameraNo': 0,
                    },
                    "mVerifyCode": "000000"
                },
                index: 0,
                num: 1
            }
        },
        onLoad() {

        },
        onUnload() {
            this.$refs['hkView'].close();
        },
        onBackPress() {
            this.$refs['hkView'].exitFullScreen((ret) => {
                console.log(ret)
            });
        },
        methods: {
            onError(res) {
                this.retry()
                plus.nativeUI.toast(res.detail);
            }
        }
    }
</script>

范例代码可直接导入使用,购买前请先试用,确定满足需求后再进行购买。如果使用过程中遇到任何问题,请联系我。我将全力协助你进行使用本插件,联系QQ:1804945430。

隐私、权限声明

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

存储、录音

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

插件不采集任何数据 SDK地址:https://open.ys7.com/doc/zh/book/4.x/android-sdk.html

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

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问