react_hsbc_teller 2.0.39 → 2.0.40

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": "2.0.39",
3
+ "version": "2.0.40",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -75,9 +75,11 @@ startVideo = () => {
75
75
  }
76
76
  onLeaveRoom = (val) => {
77
77
  console.log(val)
78
- this.setState({
79
- isVideo: false
80
- })
78
+ if (val.code == 1) {
79
+ this.setState({
80
+ isVideo: false
81
+ })
82
+ }
81
83
  }
82
84
  handleChangeTeller = (event) => {
83
85
  this.setState({
@@ -339,6 +339,7 @@ class Copy extends Component {
339
339
  </div>
340
340
  ]}>
341
341
  <div className='endModal'>
342
+ <div className='modalEndTitle'>提示</div>
342
343
  <div className='modalEnd'>
343
344
  <FormattedMessage id="noCopy" />
344
345
  </div>
@@ -60,13 +60,14 @@ import MultiModule from '../multiModule/multiModule'//签字、抄录
60
60
  import axios from 'axios';
61
61
  import CryptoJS from "crypto-js";
62
62
 
63
- const SDK_VERISON = '2.0.39'
63
+ const SDK_VERISON = '2.0.40'
64
64
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
65
65
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
66
66
  const { Option } = Select;
67
67
  const LEAVE_TYPE = {
68
68
  TELLER_EXIT: 1, // 坐席退出
69
69
  ROOM_DESTROYED: -1, // 房间异常
70
+ TELLER_DISCONNECT: -2, // 坐席连接断开
70
71
  }
71
72
  const POINT_TYPE = {
72
73
  tts: '文字转语音',
@@ -248,6 +249,7 @@ class Video extends Component {
248
249
  isModalVisibleEnd: false,
249
250
  isModalVisible: false,
250
251
  isPictureConfirmModalVisible:false,
252
+ isDisconnectModalVisible: false,
251
253
  screenName: '共享模式',
252
254
  suspendName: '暂停',
253
255
  cameraImg: cameraImgOpen,
@@ -530,7 +532,7 @@ class Video extends Component {
530
532
  config_param.sign = window.sessionStorage.getItem('alimpassSig')
531
533
  config_param.room_server_url = this.props.roomServerUrl;
532
534
  // 允许最大断网时间 (超过未重连, 直接关闭)
533
- config_param.network_check_timeout = 10000;
535
+ config_param.network_check_timeout = 1200000; // sdk默认120秒。wpb要求一直重连,设定20分钟
534
536
  this.test_controller.Connect(config_param)
535
537
  this.saveLog('mrtc connect start')
536
538
  };
@@ -1138,15 +1140,16 @@ class Video extends Component {
1138
1140
  };
1139
1141
  return mediaInfo;
1140
1142
  }
1141
- detectNetworkWeak = () => {
1143
+ detectNetworkWeak = (streamInfo) => {
1142
1144
  return new Promise((resolve, reject) => {
1143
- let detectionsNumber = 3
1145
+ const Total_Detect_Number = 3; // 触发弱网回调后,再连续检测3次
1146
+ let detectionsNumber = Total_Detect_Number;
1144
1147
  let finalResult = true
1145
1148
  let setTimer = () => {
1146
1149
  setTimeout(() => {
1147
- this.test_controller.GetStats(this.mediaInfo).then(media_stat => {
1148
- if (detectionsNumber>2) {
1149
- // 不考虑第一次的评估结果,重新计算码率
1150
+ this.test_controller.GetStats(streamInfo || this.mediaInfo).then(media_stat => {
1151
+ if (detectionsNumber> Total_Detect_Number-1) {
1152
+ // 不考虑第一次的评估结果,重新计算码率(因为刚触发弱网时的获取的码率总是非常大,原因不明)
1150
1153
  detectionsNumber--;
1151
1154
  setTimer()
1152
1155
  return
@@ -1159,27 +1162,38 @@ class Video extends Component {
1159
1162
  let ssrcVideoSendLostRate = media_stat["ssrcVideoSend"]["lostRate"];
1160
1163
  let ssrcAudioSendLostRate = media_stat["ssrcAudioSend"]["lostRate"];
1161
1164
  let weak_googAvailableSendBandwidth = 200;
1162
- let weak_ssrcVideoSendLostRate = 20;
1163
- let weak_ssrcAudioSendLostRate = 20;
1165
+ // let weak_ssrcVideoSendLostRate = 0.20;
1166
+ // let weak_ssrcAudioSendLostRate = 0.20;
1164
1167
  let weak_str = "网络正常";
1165
1168
  if (googAvailableSendBandwidth < weak_googAvailableSendBandwidth) {
1166
1169
  weak_str = "当前网络不佳";
1167
1170
  }
1168
1171
  let bpsSend = (media_stat.ssrcVideoSend["bpsSend"] / 1000).toFixed(2)
1172
+ let bpsAudioSend = (media_stat.ssrcAudioSend["bpsSend"] / 1000).toFixed(2)
1169
1173
  let fps = media_stat["ssrcVideoSend"].googFrameRateSent
1170
1174
  let str =
1171
1175
  "带宽评估:" + (googAvailableSendBandwidth == undefined ? "none" : googAvailableSendBandwidth + "kbps") + "; "
1172
1176
  + "视频码率:" + bpsSend + "kb" + "; "
1173
- + "音频码率:" + (media_stat.ssrcAudioSend["bpsSend"] / 1000).toFixed(2) + "kb" + "; "
1177
+ + "音频码率:" + bpsAudioSend + "kb" + "; "
1174
1178
  + "视频丢包率:" + (ssrcVideoSendLostRate == undefined ? "none" : ssrcVideoSendLostRate + "%") + "; "
1175
1179
  + "音频丢包率:" + (ssrcAudioSendLostRate == undefined ? "none" : ssrcAudioSendLostRate + "%") + "; "
1176
1180
  + weak_str + "; "
1177
1181
  + "当前编码格式:" + media_stat["ssrcVideoSend"].googCodecName + "; "
1178
1182
  + "分辨率:" + media_stat["ssrcVideoSend"].resolution + "; "
1179
- + "帧率:" + media_stat["ssrcVideoSend"].googFrameRateSent;
1183
+ + "帧率:" + fps + '; '
1184
+ + "源帧率:" + media_stat["ssrcVideoSend"].googFrameRateInput;
1180
1185
  console.log('弱网', str)
1181
- // document.getElementById("publish_media_stat1").innerText = str;
1182
- let result = (bpsSend < 200 ) && googAvailableSendBandwidth < weak_googAvailableSendBandwidth
1186
+
1187
+ let bpsResult = (bpsSend && bpsSend < 200 ) || (bpsAudioSend && bpsAudioSend < 200 )
1188
+ // 码率和带宽评估均低于200
1189
+ let result = bpsResult && (!googAvailableSendBandwidth || googAvailableSendBandwidth < weak_googAvailableSendBandwidth)
1190
+
1191
+ if (fps !== undefined) {
1192
+ // 丢包率>=10 或者帧率 <= 5
1193
+ let videoResult = (Number(ssrcVideoSendLostRate) >= 0.1 ) || fps <= 5
1194
+ console.log('丢包及帧率不满足', ssrcVideoSendLostRate, fps, videoResult)
1195
+ result = videoResult || result
1196
+ }
1183
1197
  if (result) {
1184
1198
  console.log('[!]弱网单次评估' + result);
1185
1199
  } else {
@@ -2317,9 +2331,9 @@ class Video extends Component {
2317
2331
  };
2318
2332
  // 音视频关闭通知
2319
2333
  this.test_controller.OnMediaClose = (code, sid) => {
2320
- console.log(code, sid)
2334
+ console.log('OnMediaClose',code, sid)
2321
2335
  if (code == 5003 || code == 5004 || code == 5005 || code == 5007 || code == 5009 || code == 5010 || code == 5011 || code == 5012) {
2322
- if (sid == document.getElementById('publish_streamId1').name) {
2336
+ if (sid == this.state.publishSid) {
2323
2337
  this.saveLog('Audio and video close notification,' + code)
2324
2338
  this.roomCallBack(2, '音视频异常关闭', 8)
2325
2339
  } else {
@@ -2526,9 +2540,10 @@ class Video extends Component {
2526
2540
  this.state.isScreenSwitching = false
2527
2541
  this.setSharedScreenState(true)
2528
2542
  }
2543
+ this.videoInfo = this.generateMediaInfo(document.getElementById("video20").name);
2529
2544
  }
2530
2545
  if (sid == document.getElementById('publish_streamId1').name) {
2531
-
2546
+ this.state.publishSid = document.getElementById('publish_streamId1').name
2532
2547
  this.setState({
2533
2548
 
2534
2549
  loading: false,
@@ -2921,6 +2936,15 @@ class Video extends Component {
2921
2936
  }
2922
2937
 
2923
2938
  console.log('退出房间回调', leaveType);
2939
+ // if (leaveType != 1) {
2940
+ // this.props.onLeaveRoom({
2941
+ // code: LEAVE_TYPE.TELLER_DISCONNECT,
2942
+ // errMsg: '坐席断开连接'
2943
+ // })
2944
+ // this.setState({
2945
+ // isDisconnectModalVisible: true
2946
+ // })
2947
+ // }
2924
2948
  };
2925
2949
  // 推送“退出房间者”给与会者
2926
2950
  this.test_controller.OnParticipantLeaveRoom = (
@@ -3006,9 +3030,10 @@ class Video extends Component {
3006
3030
  // 弱网回调
3007
3031
  this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
3008
3032
  console.log('弱网回调', bpsSend, bpsRecv, sid)
3009
- if (sid == document.getElementById('publish_streamId1').name) {
3033
+ if (sid == document.getElementById('publish_streamId1').name || sid == document.getElementById('video20').name) {
3034
+ const stream = sid == document.getElementById('publish_streamId1').name ? this.mediaInfo : this.videoInfo
3010
3035
 
3011
- this.detectNetworkWeak().then((isWeak) => {
3036
+ this.detectNetworkWeak(stream).then((isWeak) => {
3012
3037
  console.log('弱网结果:' + isWeak)
3013
3038
  if (isWeak) {
3014
3039
  this.messageClick('当前网络环境较差', 'error')
@@ -4001,10 +4026,8 @@ class Video extends Component {
4001
4026
  let matchArr = re.data.matchRawTextItems.map(el => el.matchedText);
4002
4027
  this.saveVideoPoint('pwd', `${resultValue}`, matchArr.toString())
4003
4028
  if (matchArr.length>0) {
4004
- matchArr.forEach(el => {
4005
- this.messageClick('检测到敏感词:' + matchArr, 'error')
4006
- })
4007
- }
4029
+ this.messageClick('检测到敏感词:' + matchArr, 'error')
4030
+ }
4008
4031
  }
4009
4032
  });
4010
4033
  }
@@ -4379,6 +4402,9 @@ class Video extends Component {
4379
4402
  this.pictureInPictureClick('add')
4380
4403
  this.setState({isPictureConfirmModalVisible: false})
4381
4404
  }
4405
+ isDisconnectModalVisible = () => {
4406
+ this.setState({isDisconnectModalVisible: false})
4407
+ }
4382
4408
  handleOkRecordConfirm = () => {
4383
4409
  if (!this.state.isPictureInPicture) {
4384
4410
  this.pictureInPicture()
@@ -5462,6 +5488,7 @@ class Video extends Component {
5462
5488
 
5463
5489
  }, error => {
5464
5490
  console.log("Unable to acquire screen capture", error);
5491
+ console.log('取消签署')
5465
5492
  });
5466
5493
  }
5467
5494
  publishRecorderDevice = () => {
@@ -6794,6 +6821,14 @@ class Video extends Component {
6794
6821
  ]}>
6795
6822
  <div className='endModal'>视频浮窗已关闭,请重新开启</div>
6796
6823
  </Modal>
6824
+ {/* 连接断开 */}
6825
+ {/* <Modal closable={false} centered={true} visible={this.state.isDisconnectModalVisible} maskClosable={false} footer={[
6826
+ <div key='end'>
6827
+ <Button className="modelButtonOk" type="primary" danger onClick={this.isDisconnectModalVisible}>确定</Button>
6828
+ </div>
6829
+ ]}>
6830
+ <div className='endModal'>您的连接已断开,请稍后重试</div>
6831
+ </Modal> */}
6797
6832
  {/* 双录中断重新开启确认 */}
6798
6833
  <Modal closable={false} centered={true} visible={this.state.isRecordingeErrorModalVisible} maskClosable={false} footer={[
6799
6834
  <div key='end'>