react_hsbc_teller 1.9.35 → 1.9.37

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.9.35",
3
+ "version": "1.9.37",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -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.35'
50
+ const SDK_VERISON = '1.9.37'
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
@@ -1592,8 +1686,10 @@ class Video extends Component {
1592
1686
  speakerList: objList2.length > 0 ? [objList2[0]] : []
1593
1687
  })
1594
1688
  let indexId = 0
1595
- objList.map((item, index) => {
1596
- if (item.actionname.indexOf('Integrated Camera') != -1) {
1689
+ objList.forEach((item, index) => {
1690
+ if (item.actionname.indexOf('HP Full-HD Camera') != -1) {
1691
+ indexId = index
1692
+ } else if (item.actionname.indexOf('Integrated Camera') != -1) {
1597
1693
  indexId = index
1598
1694
  }
1599
1695
  })
@@ -1923,6 +2019,8 @@ class Video extends Component {
1923
2019
  },
1924
2020
  1000
1925
2021
  );
2022
+ this.mediaInfo = this.generateMediaInfo(document.getElementById("publish_video1").name);
2023
+
1926
2024
  } else {
1927
2025
  var box = document.getElementById("whiteboardDIV");
1928
2026
  var box1 = document.getElementById("operate")
@@ -2350,21 +2448,26 @@ class Video extends Component {
2350
2448
  this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
2351
2449
  console.log('弱网回调', bpsSend, bpsRecv, sid)
2352
2450
  if (sid == document.getElementById('publish_video1').name) {
2353
- this.messageClick('当前网络环境较差', 'error')
2354
- this.saveLog('mrtc OnNetworkWeak')
2355
-
2356
- if (this.props.isWeakSound && this.state.ablePlayNetweakAudio) {
2357
- this.state.ablePlayNetweakAudio = false;
2358
- let src = networkWeakAudio
2359
- let audio = new Audio(src)
2360
- audio.play()
2361
- setTimeout(() => {
2362
- this.state.ablePlayNetweakAudio = true;
2363
- }, 30000);
2364
- }
2365
- if (this.props.OnNetworkWeak) {
2366
- this.props.OnNetworkWeak(bpsSend, bpsRecv, sid)
2367
- }
2451
+
2452
+ this.detectNetworkWeak().then((isWeak) => {
2453
+ console.log('弱网结果:' + isWeak)
2454
+ if (isWeak) {
2455
+ this.messageClick('当前网络环境较差', 'error')
2456
+ this.saveLog('mrtc OnNetworkWeak')
2457
+ if (this.props.isWeakSound && this.state.ablePlayNetweakAudio) {
2458
+ this.state.ablePlayNetweakAudio = false;
2459
+ let src = networkWeakAudio
2460
+ let audio = new Audio(src)
2461
+ audio.play()
2462
+ setTimeout(() => {
2463
+ this.state.ablePlayNetweakAudio = true;
2464
+ }, 30000);
2465
+ }
2466
+ if (this.props.OnNetworkWeak) {
2467
+ this.props.OnNetworkWeak(bpsSend, bpsRecv, sid)
2468
+ }
2469
+ }
2470
+ })
2368
2471
 
2369
2472
  }
2370
2473
  };
@@ -419,7 +419,7 @@
419
419
  border-spacing: 20px!important;
420
420
  }
421
421
  .modelButtonFaceOkColorFile{
422
- width: 170px!important;
422
+ min-width: 170px!important;
423
423
  height: 40px!important;
424
424
  font-size: 16px!important;
425
425
  color: #5C5C5C!important;