react_hsbc_teller 2.0.21 → 2.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -167,7 +167,7 @@ export default class foot extends Component {
|
|
|
167
167
|
item == 'PIP' && <div className="one" onClick={this.pictureInPicture.bind(this)}>
|
|
168
168
|
<img className="imgClass" src={require("../../assets/img/huazhonghua.png").default} alt="" />
|
|
169
169
|
<div className="text">
|
|
170
|
-
|
|
170
|
+
开启视频浮窗
|
|
171
171
|
</div>
|
|
172
172
|
</div>
|
|
173
173
|
}
|
|
@@ -53,7 +53,7 @@ import Step from '../components/step/step.jsx'
|
|
|
53
53
|
import axios from 'axios';
|
|
54
54
|
import CryptoJS from "crypto-js";
|
|
55
55
|
|
|
56
|
-
const SDK_VERISON = '2.0.
|
|
56
|
+
const SDK_VERISON = '2.0.23'
|
|
57
57
|
const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
|
|
58
58
|
const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
|
|
59
59
|
const { Option } = Select;
|
|
@@ -82,6 +82,7 @@ let worker
|
|
|
82
82
|
let streamShare
|
|
83
83
|
let streamRecord
|
|
84
84
|
let videoName
|
|
85
|
+
let lastFaceNum = 1
|
|
85
86
|
let muteJson = new Map()
|
|
86
87
|
// let dateTime = 0
|
|
87
88
|
let messageValue = ''
|
|
@@ -1776,18 +1777,24 @@ class Video extends Component {
|
|
|
1776
1777
|
recordId: this.state.recordId,
|
|
1777
1778
|
base64Image: path.replace('data:image/png;base64,', '')
|
|
1778
1779
|
});
|
|
1780
|
+
const changeNum = lastFaceNum - result.faceNum
|
|
1779
1781
|
if (result.faceNum == 0) {
|
|
1780
1782
|
// 人脸出框
|
|
1781
1783
|
this.messageClick('检测到您的人脸已出框', 'error')
|
|
1782
|
-
// 打点
|
|
1783
1784
|
this.saveVideoPoint('ffd', 'RM端人脸离框');
|
|
1785
|
+
} else if (lastFaceNum == 0 && result.faceNum == 1) {
|
|
1786
|
+
// 0->1不需要提示
|
|
1787
|
+
} else if (changeNum != 0) {
|
|
1788
|
+
this.messageClick('检测到参会人员数量发生变化', 'error')
|
|
1789
|
+
this.saveVideoPoint('fcd', 'RM端人脸数量发生变化');
|
|
1784
1790
|
}
|
|
1791
|
+
lastFaceNum = result.faceNum;
|
|
1785
1792
|
} catch (err) {
|
|
1786
1793
|
console.error(err);
|
|
1787
1794
|
if (err.status == 502 || err.status == 404) {
|
|
1788
1795
|
}
|
|
1789
1796
|
}
|
|
1790
|
-
},
|
|
1797
|
+
}, this.props.faceDetectInterval * 1000);
|
|
1791
1798
|
|
|
1792
1799
|
this.state.faceDetectionTimer = timer;
|
|
1793
1800
|
}
|
|
@@ -1812,7 +1819,7 @@ class Video extends Component {
|
|
|
1812
1819
|
// let end = new Date().getTime()
|
|
1813
1820
|
// console.log('执行时间(s) ', (end - start)/1000 )
|
|
1814
1821
|
}
|
|
1815
|
-
},
|
|
1822
|
+
}, this.props.lightDetectInterval * 1000);
|
|
1816
1823
|
|
|
1817
1824
|
this.state.imageDetectionTimer = timer;
|
|
1818
1825
|
}
|
|
@@ -3291,6 +3298,7 @@ class Video extends Component {
|
|
|
3291
3298
|
roomId: this.state.channelId + '',
|
|
3292
3299
|
appId: this.state.appId,
|
|
3293
3300
|
recordId: this.state.recordId,
|
|
3301
|
+
customerId: this.props.customerId,
|
|
3294
3302
|
type: type,
|
|
3295
3303
|
status: status
|
|
3296
3304
|
});
|
|
@@ -3321,6 +3329,7 @@ class Video extends Component {
|
|
|
3321
3329
|
id: businessId,
|
|
3322
3330
|
appId: this.state.appId,
|
|
3323
3331
|
recordId: this.state.businessRecordId,
|
|
3332
|
+
customerId: this.props.customerId,
|
|
3324
3333
|
type: type,
|
|
3325
3334
|
status: status
|
|
3326
3335
|
});
|
|
@@ -3644,20 +3653,6 @@ class Video extends Component {
|
|
|
3644
3653
|
}
|
|
3645
3654
|
componentWillMount() {
|
|
3646
3655
|
console.log('hsbc_teller_sdk', SDK_VERISON)
|
|
3647
|
-
// window.document.startRecord = () => {
|
|
3648
|
-
// this.enableServerRecording();
|
|
3649
|
-
// }
|
|
3650
|
-
// window.document.stopRecord = (recordId) => {
|
|
3651
|
-
// this.test_controller.StopRemoteRecord(recordId || this.state.recordId)
|
|
3652
|
-
// }
|
|
3653
|
-
// window.document.detectNetworkWeak = () => {
|
|
3654
|
-
// console.log('detectNetworkWeak')
|
|
3655
|
-
// this.test_controller.detectNetworkWeak()
|
|
3656
|
-
// }
|
|
3657
|
-
// window.document.start = () => {
|
|
3658
|
-
// this.startFaceDetection();
|
|
3659
|
-
// this.startImageDetection();
|
|
3660
|
-
// }
|
|
3661
3656
|
let arr = []
|
|
3662
3657
|
for(let i=1;i<=12;i++){
|
|
3663
3658
|
arr.push({
|
|
@@ -6336,7 +6331,7 @@ class Video extends Component {
|
|
|
6336
6331
|
<Button className="modelButtonOk" type="primary" danger onClick={this.handleOkPictureConfirm}>确定</Button>
|
|
6337
6332
|
</div>
|
|
6338
6333
|
]}>
|
|
6339
|
-
<div className='endModal'
|
|
6334
|
+
<div className='endModal'>视频浮窗已关闭,请重新开启</div>
|
|
6340
6335
|
</Modal>
|
|
6341
6336
|
{/* 双录中断重新开启确认 */}
|
|
6342
6337
|
<Modal closable={false} centered={true} visible={this.state.isRecordingeErrorModalVisible} maskClosable={false} footer={[
|
|
@@ -6789,6 +6784,8 @@ Video.defaultProps = {
|
|
|
6789
6784
|
isWeakSound: false,
|
|
6790
6785
|
whetherDetectFace: false, // 是否在双录时开启人脸检测
|
|
6791
6786
|
whetherDetectLight: false, // 是否在双录时开启背光检测
|
|
6787
|
+
faceDetectInterval: 6, // 人脸检测间隔(秒)
|
|
6788
|
+
lightDetectInterval: 6, // 背光检测间隔(秒)
|
|
6792
6789
|
userSide: 2,
|
|
6793
6790
|
meetingDuration: null, // 会议时长,单位小时
|
|
6794
6791
|
recordMode: 1, // 录制模式 1远程录制 2网点录制
|
package/packages/utils/utils.js
CHANGED
|
@@ -51,7 +51,7 @@ function debounce(fn, delay = 500) {
|
|
|
51
51
|
}
|
|
52
52
|
function isLight(src) {
|
|
53
53
|
let gray = new cv.Mat()
|
|
54
|
-
cv.cvtColor(src, gray, cv.
|
|
54
|
+
cv.cvtColor(src, gray, cv.COLOR_BGR2GRAY)
|
|
55
55
|
let sum = 0;
|
|
56
56
|
let avg = 0;
|
|
57
57
|
let scalar = new cv.Scalar()
|
|
@@ -59,15 +59,12 @@ function isLight(src) {
|
|
|
59
59
|
let size = gray.rows * gray.cols;
|
|
60
60
|
for (let i = 0; i < 256; i++)
|
|
61
61
|
ls[i] = 0;
|
|
62
|
-
const data = gray.data;
|
|
63
|
-
// console.log(data)
|
|
64
62
|
|
|
65
63
|
for (let i = 0; i < gray.rows; i++)
|
|
66
64
|
{
|
|
67
65
|
for (let j = 0; j < gray.cols; j++)
|
|
68
66
|
{
|
|
69
|
-
|
|
70
|
-
scalar = [data[pos*3], data[pos*3+1], data[pos*3+2]]
|
|
67
|
+
scalar = gray.ucharPtr(i, j);
|
|
71
68
|
sum += (scalar[0] - 128);
|
|
72
69
|
let x = scalar[0];
|
|
73
70
|
ls[x]++;
|
|
@@ -78,7 +75,7 @@ function isLight(src) {
|
|
|
78
75
|
let mean = 0;
|
|
79
76
|
for (let i = 0; i < 256; i++)
|
|
80
77
|
{
|
|
81
|
-
total += Math.abs(
|
|
78
|
+
total += Math.abs((i - 128) - avg) * ls[i];
|
|
82
79
|
}
|
|
83
80
|
mean = total / size;
|
|
84
81
|
let cast = Math.abs(avg / mean);
|