react_hsbc_teller 1.9.35 → 1.9.36
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/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/pages/video/video.jsx +117 -16
- package/packages/pages/video/video.less +1 -1
package/package.json
CHANGED
|
@@ -47,7 +47,7 @@ import Step from '../components/step/step.jsx'
|
|
|
47
47
|
import axios from 'axios';
|
|
48
48
|
import CryptoJS from "crypto-js";
|
|
49
49
|
|
|
50
|
-
const SDK_VERISON = '1.9.
|
|
50
|
+
const SDK_VERISON = '1.9.36'
|
|
51
51
|
const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
|
|
52
52
|
const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
|
|
53
53
|
const { Option } = Select;
|
|
@@ -971,6 +971,100 @@ class Video extends Component {
|
|
|
971
971
|
this.selectCustomer('facial')
|
|
972
972
|
}
|
|
973
973
|
};
|
|
974
|
+
generateMediaInfo = (sid) => {
|
|
975
|
+
let that = this
|
|
976
|
+
console.log(that.test_controller, sid)
|
|
977
|
+
console.log(that.test_controller.GetMediaInfo(sid))
|
|
978
|
+
let originalMediaInfo = that.test_controller.GetMediaInfo(sid);
|
|
979
|
+
let mediaInfo = {
|
|
980
|
+
peer_connection_: originalMediaInfo.peer_connection_,
|
|
981
|
+
local_video_width: originalMediaInfo.local_video_width,
|
|
982
|
+
local_video_height: originalMediaInfo.local_video_height,
|
|
983
|
+
local_video_frame: originalMediaInfo.local_video_frame,
|
|
984
|
+
local_video_bitrate: originalMediaInfo.local_video_bitrate,
|
|
985
|
+
stream_type: originalMediaInfo.stream_type,
|
|
986
|
+
stat_interval_: 3,
|
|
987
|
+
video_send_packets_base_: 0,
|
|
988
|
+
video_recv_packets_base_: 0,
|
|
989
|
+
video_send_lost_pack_base_: 0,
|
|
990
|
+
video_recv_lost_pack_base_: 0,
|
|
991
|
+
audio_send_packets_base_: 0,
|
|
992
|
+
audio_recv_packets_base_: 0,
|
|
993
|
+
audio_send_lost_pack_base_: 0,
|
|
994
|
+
audio_recv_lost_pack_base_: 0,
|
|
995
|
+
video_send_qpsum_base: 0,
|
|
996
|
+
video_send_frame_encoded_base: 0,
|
|
997
|
+
video_recv_qpsum_base: 0,
|
|
998
|
+
video_recv_frame_decoded_base: 0,
|
|
999
|
+
video_send_bitrate_base_: 0,
|
|
1000
|
+
video_recv_bitrate_base_: 0,
|
|
1001
|
+
audio_send_bitrate_base_: 0,
|
|
1002
|
+
audio_recv_bitrate_base_: 0,
|
|
1003
|
+
};
|
|
1004
|
+
return mediaInfo;
|
|
1005
|
+
}
|
|
1006
|
+
detectNetworkWeak = () => {
|
|
1007
|
+
return new Promise((resolve, reject) => {
|
|
1008
|
+
let detectionsNumber = 3
|
|
1009
|
+
let finalResult = true
|
|
1010
|
+
let setTimer = () => {
|
|
1011
|
+
setTimeout(() => {
|
|
1012
|
+
this.test_controller.GetStats(this.mediaInfo).then(media_stat => {
|
|
1013
|
+
if (detectionsNumber>2) {
|
|
1014
|
+
// 不考虑第一次的评估结果,重新计算码率
|
|
1015
|
+
detectionsNumber--;
|
|
1016
|
+
setTimer()
|
|
1017
|
+
return
|
|
1018
|
+
}
|
|
1019
|
+
console.log('media_stat:')
|
|
1020
|
+
console.log(media_stat)
|
|
1021
|
+
// 分辨率、帧率
|
|
1022
|
+
let googAvailableSendBandwidth = (media_stat["VideoBwe"]["googAvailableSendBandwidth"] / 1000).toFixed(2);
|
|
1023
|
+
let googTransmitBitrate = (media_stat["VideoBwe"]["googTransmitBitrate"] / 1000).toFixed(2);
|
|
1024
|
+
let ssrcVideoSendLostRate = media_stat["ssrcVideoSend"]["lostRate"];
|
|
1025
|
+
let ssrcAudioSendLostRate = media_stat["ssrcAudioSend"]["lostRate"];
|
|
1026
|
+
let weak_googAvailableSendBandwidth = 200;
|
|
1027
|
+
let weak_ssrcVideoSendLostRate = 20;
|
|
1028
|
+
let weak_ssrcAudioSendLostRate = 20;
|
|
1029
|
+
let weak_str = "网络正常";
|
|
1030
|
+
if (googAvailableSendBandwidth < weak_googAvailableSendBandwidth) {
|
|
1031
|
+
weak_str = "当前网络不佳";
|
|
1032
|
+
}
|
|
1033
|
+
let bpsSend = (media_stat.ssrcVideoSend["bpsSend"] / 1000).toFixed(2)
|
|
1034
|
+
let fps = media_stat["ssrcVideoSend"].googFrameRateSent
|
|
1035
|
+
let str =
|
|
1036
|
+
"带宽评估:" + (googAvailableSendBandwidth == undefined ? "none" : googAvailableSendBandwidth + "kbps") + "; "
|
|
1037
|
+
+ "视频码率:" + bpsSend + "kb" + "; "
|
|
1038
|
+
+ "音频码率:" + (media_stat.ssrcAudioSend["bpsSend"] / 1000).toFixed(2) + "kb" + "; "
|
|
1039
|
+
+ "视频丢包率:" + (ssrcVideoSendLostRate == undefined ? "none" : ssrcVideoSendLostRate + "%") + "; "
|
|
1040
|
+
+ "音频丢包率:" + (ssrcAudioSendLostRate == undefined ? "none" : ssrcAudioSendLostRate + "%") + "; "
|
|
1041
|
+
+ weak_str + "; "
|
|
1042
|
+
+ "当前编码格式:" + media_stat["ssrcVideoSend"].googCodecName + "; "
|
|
1043
|
+
+ "分辨率:" + media_stat["ssrcVideoSend"].resolution + "; "
|
|
1044
|
+
+ "帧率:" + media_stat["ssrcVideoSend"].googFrameRateSent;
|
|
1045
|
+
console.log('弱网', str)
|
|
1046
|
+
// document.getElementById("publish_media_stat1").innerText = str;
|
|
1047
|
+
let result = (bpsSend < 200 ) && googAvailableSendBandwidth < weak_googAvailableSendBandwidth
|
|
1048
|
+
if (result) {
|
|
1049
|
+
console.log('[!]弱网单次评估' + result);
|
|
1050
|
+
} else {
|
|
1051
|
+
finalResult = false
|
|
1052
|
+
console.log('弱网单次评估' + result);
|
|
1053
|
+
}
|
|
1054
|
+
if (detectionsNumber > 0 && finalResult) {
|
|
1055
|
+
detectionsNumber -= 1
|
|
1056
|
+
setTimer();
|
|
1057
|
+
} else {
|
|
1058
|
+
console.log('弱网综合检测结果:' + finalResult)
|
|
1059
|
+
resolve(finalResult)
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
}, 3000)
|
|
1064
|
+
}
|
|
1065
|
+
setTimer()
|
|
1066
|
+
})
|
|
1067
|
+
}
|
|
974
1068
|
ocrClick = () => {
|
|
975
1069
|
if (this.isFileSuccuse()) {
|
|
976
1070
|
this.state.faceCustomerType = 2
|
|
@@ -1923,6 +2017,8 @@ class Video extends Component {
|
|
|
1923
2017
|
},
|
|
1924
2018
|
1000
|
|
1925
2019
|
);
|
|
2020
|
+
this.mediaInfo = this.generateMediaInfo(document.getElementById("publish_video1").name);
|
|
2021
|
+
|
|
1926
2022
|
} else {
|
|
1927
2023
|
var box = document.getElementById("whiteboardDIV");
|
|
1928
2024
|
var box1 = document.getElementById("operate")
|
|
@@ -2350,21 +2446,26 @@ class Video extends Component {
|
|
|
2350
2446
|
this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
|
|
2351
2447
|
console.log('弱网回调', bpsSend, bpsRecv, sid)
|
|
2352
2448
|
if (sid == document.getElementById('publish_video1').name) {
|
|
2353
|
-
|
|
2354
|
-
this.
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2449
|
+
|
|
2450
|
+
this.detectNetworkWeak().then((isWeak) => {
|
|
2451
|
+
console.log('弱网结果:' + isWeak)
|
|
2452
|
+
if (isWeak) {
|
|
2453
|
+
this.messageClick('当前网络环境较差', 'error')
|
|
2454
|
+
this.saveLog('mrtc OnNetworkWeak')
|
|
2455
|
+
if (this.props.isWeakSound && this.state.ablePlayNetweakAudio) {
|
|
2456
|
+
this.state.ablePlayNetweakAudio = false;
|
|
2457
|
+
let src = networkWeakAudio
|
|
2458
|
+
let audio = new Audio(src)
|
|
2459
|
+
audio.play()
|
|
2460
|
+
setTimeout(() => {
|
|
2461
|
+
this.state.ablePlayNetweakAudio = true;
|
|
2462
|
+
}, 30000);
|
|
2463
|
+
}
|
|
2464
|
+
if (this.props.OnNetworkWeak) {
|
|
2465
|
+
this.props.OnNetworkWeak(bpsSend, bpsRecv, sid)
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
})
|
|
2368
2469
|
|
|
2369
2470
|
}
|
|
2370
2471
|
};
|