react_hsbc_teller 2.0.47 → 2.0.49

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.
@@ -26,12 +26,14 @@ import ipadLeaveMeeting from '../../assets/mp3/ipad_leave_meeting.mp3'
26
26
  import recordErrorAudio from '../../assets/mp3/record_error.mp3'
27
27
  import IpadLeaveAudio from '../../assets/mp3/ipad_leave_error.mp3';
28
28
  import IpadLowPowerAudio from '../../assets/mp3/ipad_low_power.mp3';
29
+ import ipadMediaCloseAudio from '../../assets/mp3/ipad_media_close.mp3';
29
30
  import MediaErrorAudio from '../../assets/mp3/media_error.mp3';
30
31
  import internalJoin from '../../assets/mp3/internalJoin.mp3'
31
32
  import internalLeft from '../../assets/mp3/internalLeft.mp3'
32
33
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
33
34
  import networkWeakAudio from '../../assets/mp3/networkweak.mp3'
34
35
  import PIPictureClosedAudio from '../../assets/mp3/pip_close.mp3'
36
+ import screenSharedIntervalAudio from '../../assets/mp3/share_stop_audio.mp3'
35
37
  import errorPng from '../../assets/img/tooltips2_fail.png'
36
38
  import Modal from "antd/lib/modal";
37
39
  import 'antd/lib/modal/style'
@@ -61,7 +63,7 @@ import MultiModule from '../multiModule/multiModule'//签字、抄录
61
63
  import axios from 'axios';
62
64
  import CryptoJS from "crypto-js";
63
65
 
64
- const SDK_VERISON = '2.0.47'
66
+ const SDK_VERISON = '2.0.49'
65
67
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
66
68
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
67
69
  const { Option } = Select;
@@ -82,6 +84,7 @@ const POINT_TYPE = {
82
84
  expDark: '曝光、背光',
83
85
  fcd: '人脸变化检测',
84
86
  padConnected: 'ipad已连接',
87
+ cancelShare: '取消投屏',
85
88
  conFail: '媒体流服务断开'
86
89
  }
87
90
  const RECORD_DEVICE_NAME = 'screen-capture-recorder'
@@ -528,6 +531,7 @@ class Video extends Component {
528
531
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
529
532
  // eslint-disable-next-line no-undef
530
533
  const config_param = {};
534
+ config_param.autoUploadLog = true;
531
535
  config_param.workspaceId = this.state.workSpaceId;
532
536
  config_param.uid = this.props.tellerAccount;
533
537
  config_param.biz_name = this.state.bizName; // 'demo'
@@ -745,7 +749,7 @@ class Video extends Component {
745
749
  enable: true,
746
750
  xPosition: 16 * SCALE, // x 轴位置
747
751
  yPosition: 8 * SCALE, // y 轴位置
748
- text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.state.salesBranchCode || ''} ${this.state.branchName || ''} ${this.state.financialOffice || ''}`,
752
+ text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.state.branchName || ''} ${this.props.financialOffice || ''}`,
749
753
  fontSize: 16 * SCALE, // 字体⼤⼩
750
754
  url: '' // ⽔印图⽚ HTTP 地址
751
755
  },
@@ -788,7 +792,7 @@ class Video extends Component {
788
792
  enable: true,
789
793
  xPosition: 16, // x 轴位置
790
794
  yPosition: 8, // y 轴位置
791
- text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.state.salesBranchCode || ''} ${this.state.branchName || ''} ${this.state.financialOffice || ''}`,
795
+ text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.state.branchName || ''} ${this.props.financialOffice || ''}`,
792
796
  fontSize: 16, // 字体⼤⼩
793
797
  url: '' // ⽔印图⽚ HTTP 地址
794
798
  },
@@ -1803,6 +1807,8 @@ class Video extends Component {
1803
1807
  })
1804
1808
  } else {
1805
1809
  if (document.getElementById('video20').name) {
1810
+ this.saveLog('unPublish share, reason: receive stop whiteboard message 1218')
1811
+ console.log('unPublish share, reason: receive stop whiteboard message 1218')
1806
1812
  this.test_controller.UnPublish(document.getElementById('video20').name)
1807
1813
  if(this.state.drawCanvasInterval) clearInterval(this.state.drawCanvasInterval)
1808
1814
  }
@@ -1816,12 +1822,12 @@ class Video extends Component {
1816
1822
  }
1817
1823
 
1818
1824
  } else if (Mival.typeId == 1219) {
1819
- // 传入分行信息
1820
- if (Mival.sessionId == this.state.sessionId && this.props.recordMode == 2) {
1821
- this.state.salesBranchCode = Mival.salesBranchCode;
1822
- this.state.financialOffice = Mival.financialOffice;
1823
- this.state.branchName = Mival.salesBranchName;
1824
- }
1825
+ // 旧逻辑废弃。现在无论什么模式均为sdk外部传入
1826
+ // if (Mival.sessionId == this.state.sessionId && this.props.recordMode == 2) {
1827
+ // this.state.salesBranchCode = Mival.salesBranchCode;
1828
+ // this.state.financialOffice = Mival.financialOffice;
1829
+ // this.state.branchName = Mival.salesBranchName;
1830
+ // }
1825
1831
  } else if (Mival.typeId == 3100) {
1826
1832
  if(Mival.data.sessionId == this.state.sessionId) {
1827
1833
  muteJson.set(Mival.data.userId, JSON.stringify(Mival))
@@ -1936,22 +1942,47 @@ class Video extends Component {
1936
1942
  }
1937
1943
  } else if (Mival.typeId == 10020) {
1938
1944
  // 录制中断(模拟测试)
1939
- // this.messageClick('双录异常中断,请重新开启', 'error')
1940
- // this.setState({
1941
- // isRecordingeErrorModalVisible: true,
1942
- // businessRecordId: '',
1943
- // })
1944
- // // 循环播放录制中断语音
1945
- // clearTimeout(this.recordLoopPlayTimer)
1946
- // this.recordLoopPlay = () => {
1947
- // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1948
- // if(!this.state.businessRecordId && document.getElementById("publish_video1")){
1949
- // let audio = new Audio(recordErrorAudio)
1950
- // audio.play()
1951
- // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1952
- // }
1953
- // }
1954
- // setTimeout(this.recordLoopPlay, 0);
1945
+ const recordId = Mival.recordId;
1946
+
1947
+ // if (this.state.businessRecordId == recordId) {
1948
+ // // 双录录制中断
1949
+ // this.messageClick('双录异常中断,请重新开启', 'error')
1950
+ // this.setState({
1951
+ // isRecordingeErrorModalVisible: true,
1952
+ // businessRecordId: '',
1953
+ // })
1954
+ // this.saveLog(`dual recording crash, recordId=${recordId}`);
1955
+ // // 循环播放录制中断语音
1956
+ // clearTimeout(this.recordLoopPlayTimer)
1957
+ // this.recordLoopPlay = () => {
1958
+ // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1959
+ // if(!this.state.businessRecordId && document.getElementById("publish_streamId1")){
1960
+ // let audio = new Audio(recordErrorAudio)
1961
+ // audio.play()
1962
+ // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1963
+ // }
1964
+ // }
1965
+ // setTimeout(this.recordLoopPlay, 0);
1966
+ // } else if (this.state.ipadRecordId == recordId) {
1967
+ // // ipad录制中断
1968
+ // this.messageClick('双录异常中断,请重新开启', 'error')
1969
+ // this.setState({
1970
+ // isRecordingeErrorModalVisible: true,
1971
+ // ipadRecordId: '',
1972
+ // })
1973
+ // this.saveLog(`ipad dual recording crash, recordId=${recordId}`);
1974
+ // // 循环播放录制中断语音
1975
+ // clearTimeout(this.recordLoopPlayTimer)
1976
+ // this.recordLoopPlay = () => {
1977
+ // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1978
+ // if(!this.state.ipadRecordId && document.getElementById("publish_streamId1")){
1979
+ // let audio = new Audio(recordErrorAudio)
1980
+ // audio.play()
1981
+ // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1982
+ // }
1983
+ // }
1984
+ // setTimeout(this.recordLoopPlay, 0);
1985
+ // }
1955
1986
 
1956
1987
  } else if (Mival.typeId == 33001 && this.state.sessionId == Mival.data.sessionId) {
1957
1988
  if (Mival.type == 1) {
@@ -2363,6 +2394,7 @@ class Video extends Component {
2363
2394
  } else if (sid == this.state.publishScreenSid) {
2364
2395
  this.state.isScreenSwitching = false
2365
2396
  this.setSharedScreenState(false)
2397
+ this.setSharedScreenTimer(false)
2366
2398
  if (code == 5007 || code == 5007 || code == 5009 || code == 5010 || code == 5011) {
2367
2399
  this.saveVideoPoint('conFail', `RM投屏媒体链路断开, err_code=${code}`)
2368
2400
  playAudioTip();
@@ -2507,15 +2539,19 @@ class Video extends Component {
2507
2539
  if ( stream.getVideoTracks()[0] instanceof BrowserCaptureMediaStreamTrack) {
2508
2540
  console.log('tab共享')
2509
2541
  this.saveLog('Share type = tab')
2542
+ this.state.lastShareType = 'share'
2510
2543
  } else if (stream.getVideoTracks()[0] instanceof MediaStreamTrack && stream.getVideoTracks()[0].label.includes('screen')) {
2511
2544
  console.log('屏幕共享')
2512
2545
  this.saveLog('Share type = screen')
2546
+ this.state.lastShareType = 'share'
2513
2547
  } else if (stream.getVideoTracks()[0].label.includes('window')){
2514
2548
  console.log('窗口共享')
2515
2549
  this.saveLog('Share type = window')
2550
+ this.state.lastShareType = 'share'
2516
2551
  } else if (stream.getVideoTracks()[0] instanceof CanvasCaptureMediaStreamTrack){
2517
2552
  console.log('白板共享')
2518
2553
  this.saveLog('Share type = whiteboard')
2554
+ this.state.lastShareType = 'whiteboard'
2519
2555
  }
2520
2556
  } catch (err) {
2521
2557
  console.log('不支持此浏览器记录投屏类型日志')
@@ -2568,6 +2604,7 @@ class Video extends Component {
2568
2604
  if (sid == document.getElementById('video20').name) {
2569
2605
  this.state.publishScreenSid = document.getElementById('video20').name
2570
2606
  this.setSharedScreenState(true)
2607
+ this.setSharedScreenTimer(true)
2571
2608
  this.saveLog('Share success')
2572
2609
  this.sendMessage({
2573
2610
  'typeId': 2030,
@@ -2639,6 +2676,7 @@ class Video extends Component {
2639
2676
  } else {
2640
2677
  this.messageClick('投屏失败请重新投屏', 'error')
2641
2678
  this.setSharedScreenState(false)
2679
+ this.setSharedScreenTimer(false)
2642
2680
  this.saveLog('Share fail, code=' + err_code)
2643
2681
  }
2644
2682
 
@@ -2898,6 +2936,7 @@ class Video extends Component {
2898
2936
  })
2899
2937
  this.state.isSharedScreen = false
2900
2938
  this.setSharedScreenState(false)
2939
+ this.setSharedScreenTimer(false)
2901
2940
  this.saveLog('Stop share')
2902
2941
  this.setState({
2903
2942
 
@@ -2958,6 +2997,41 @@ class Video extends Component {
2958
2997
  // 推送“取消发布”给与会者
2959
2998
  this.test_controller.OnUnPublish = (feed) => {
2960
2999
  console.log('取消发布者', feed)
3000
+
3001
+ // ipad取消发布提醒
3002
+ if (feed.uid.includes(IPAD_SUFFIX) && this.state.businessId){
3003
+ // ipad单独处理,双录过程中ipad如果取消发布,要提示+循环播报直到ipad重新入会
3004
+ this.setState({
3005
+ IpadLeaveErrorModalVisible: true,
3006
+ IpadErrorWording: 'iPad 媒体流异常,请重新扫码或输入会议号入会',
3007
+ ipadTag: '',
3008
+ })
3009
+ // 循环播放ipad退出语音
3010
+ clearTimeout(this.ipadLeavePlayTimer)
3011
+ this.ipadMediaClosePlay = () => {
3012
+ if(!this.state.ipadTag && document.getElementById("publish_streamId1")){
3013
+ if (this.ipadLeaveAudio) this.ipadLeaveAudio.pause()
3014
+ setTimeout(() => {
3015
+ this.ipadLeaveAudio = new Audio(ipadMediaCloseAudio)
3016
+ this.ipadLeaveAudio.play()
3017
+ }, 800); // 防止退出房间时重音
3018
+ this.ipadLeavePlayTimer = setTimeout(this.ipadMediaClosePlay, 3000);
3019
+ }
3020
+ }
3021
+ setTimeout(this.ipadMediaClosePlay, 0);
3022
+ } else if (feed.uid.includes(IPAD_SUFFIX)) {
3023
+ // 非双录下ipad离开提示iPad已断开
3024
+ this.setState({
3025
+ ipadTag: '',
3026
+ })
3027
+ this.messageClick(('iPad 媒体流异常,请调整'), 'error')
3028
+ this.saveLog('iPad media close')
3029
+ if (this.props.isOpenSound) {
3030
+ let audio = new Audio(ipadMediaCloseAudio)
3031
+ audio.play()
3032
+ }
3033
+ }
3034
+
2961
3035
  for (let i = 0; i < this.state.roomCustomerList.length; i++) {
2962
3036
  if (this.state.roomCustomerList[i].feedId == feed.feedId) {
2963
3037
  this.state.roomCustomerList.splice(i, 1)
@@ -3014,18 +3088,21 @@ class Video extends Component {
3014
3088
  // ipad单独处理,双录过程中ipad如果离开,要提示+循环播报直到ipad重新入会
3015
3089
  this.setState({
3016
3090
  IpadLeaveErrorModalVisible: true,
3091
+ IpadErrorWording: 'iPad 摄像头异常退出,请扫码或输入会议号入会',
3017
3092
  ipadTag: '',
3018
3093
  })
3019
3094
  // 循环播放ipad退出语音
3020
3095
  clearTimeout(this.ipadLeavePlayTimer)
3021
3096
  this.ipadLeavePlay = () => {
3022
3097
  if(!this.state.ipadTag && document.getElementById("publish_streamId1")){
3023
- let audio = new Audio(IpadLeaveAudio)
3024
- audio.play()
3098
+ if (this.ipadLeaveAudio) this.ipadLeaveAudio.pause()
3099
+ this.ipadLeaveAudio = new Audio(IpadLeaveAudio)
3100
+ this.ipadLeaveAudio.play()
3025
3101
  this.ipadLeavePlayTimer = setTimeout(this.ipadLeavePlay, 3000);
3026
3102
  }
3027
3103
  }
3028
3104
  setTimeout(this.ipadLeavePlay, 0);
3105
+ this.saveLog('iPad leave room during recording')
3029
3106
  return
3030
3107
  } else if (participant.includes(IPAD_SUFFIX)) {
3031
3108
  // 非双录下ipad离开提示iPad已断开
@@ -3265,7 +3342,7 @@ class Video extends Component {
3265
3342
 
3266
3343
  // 如果在业务双录中,需要重新开启;如果是full录制出错,则不用处理
3267
3344
  if (this.state.businessRecordId == recordId) {
3268
- // 录制中断
3345
+ // 双录录制中断
3269
3346
  this.messageClick('双录异常中断,请重新开启', 'error')
3270
3347
  this.setState({
3271
3348
  isRecordingeErrorModalVisible: true,
@@ -3283,6 +3360,25 @@ class Video extends Component {
3283
3360
  }
3284
3361
  }
3285
3362
  setTimeout(this.recordLoopPlay, 0);
3363
+ } else if (this.state.ipadRecordId == recordId) {
3364
+ // ipad录制中断
3365
+ this.messageClick('双录异常中断,请重新开启', 'error')
3366
+ this.setState({
3367
+ isRecordingeErrorModalVisible: true,
3368
+ ipadRecordId: '',
3369
+ })
3370
+ this.saveLog(`ipad dual recording crash, recordId=${recordId}`);
3371
+ // 循环播放录制中断语音
3372
+ clearTimeout(this.recordLoopPlayTimer)
3373
+ this.recordLoopPlay = () => {
3374
+ console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
3375
+ if(!this.state.ipadRecordId && document.getElementById("publish_streamId1")){
3376
+ let audio = new Audio(recordErrorAudio)
3377
+ audio.play()
3378
+ this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
3379
+ }
3380
+ }
3381
+ setTimeout(this.recordLoopPlay, 0);
3286
3382
  }
3287
3383
  };
3288
3384
  // 停止浏览器录制成功回调
@@ -3374,6 +3470,7 @@ class Video extends Component {
3374
3470
  this.state.isSharedScreen = true
3375
3471
  this.state.isScreenSwitching = false
3376
3472
  this.setSharedScreenState(true)
3473
+ this.setSharedScreenTimer(true)
3377
3474
  this.saveLog('Share changed')
3378
3475
  }
3379
3476
  }
@@ -3392,10 +3489,13 @@ class Video extends Component {
3392
3489
  })
3393
3490
  this.messageClick('切换摄像头或麦克风失败,请先检查设备', 'error')
3394
3491
  } else if (this.state.screenName == '切换共享') {
3492
+ this.saveLog('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3493
+ console.log('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3395
3494
  this.test_controller.UnPublish(document.getElementById('video20').name)
3396
3495
  this.state.isSharedScreen = false
3397
3496
  this.state.isScreenSwitching = false
3398
3497
  this.setSharedScreenState(false)
3498
+ this.setSharedScreenTimer(false)
3399
3499
  this.saveLog('Share fail, code=' + code)
3400
3500
  this.setState({
3401
3501
  screenName: '共享模式'
@@ -3530,6 +3630,8 @@ class Video extends Component {
3530
3630
  this.state.isScreenSwitching = false
3531
3631
  } else {
3532
3632
  if (!streamShare) {
3633
+ this.saveLog('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
3634
+ console.log('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
3533
3635
  document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
3534
3636
  } else {
3535
3637
  console.log('白板')
@@ -3537,6 +3639,7 @@ class Video extends Component {
3537
3639
  this.state.isSharedScreen = false
3538
3640
  this.state.isScreenSwitching = false
3539
3641
  this.setSharedScreenState(false)
3642
+ this.setSharedScreenTimer(false)
3540
3643
  this.setState({
3541
3644
  screenName: '共享模式'
3542
3645
  });
@@ -3760,9 +3863,14 @@ class Video extends Component {
3760
3863
  clearTimeout(this.ipadLeavePlayTimer)
3761
3864
  clearTimeout(this.ipadLowPowerPlayTimer)
3762
3865
  clearTimeout(this.mediaErrorPlayTimer)
3866
+ clearTimeout(this.screenSharedTimer)
3763
3867
  clearInterval(this.state.drawCanvasInterval)
3764
3868
  clearInterval(this.state.faceDetectionTimer);
3765
3869
  clearInterval(this.state.imageDetectionTimer);
3870
+ this.removeVideoEvent(['video20', 'video21', 'publish_video1'])
3871
+ for(let i=1;i<=12;i++){
3872
+ this.removeVideoEvent(['video'+ i])
3873
+ }
3766
3874
  }
3767
3875
  finishSession = () => {
3768
3876
  // clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
@@ -3996,6 +4104,27 @@ class Video extends Component {
3996
4104
  hasOcr: 0,
3997
4105
  })
3998
4106
  }
4107
+ this.videoErrorEvent = (event) => {
4108
+ console.log(event)
4109
+ console.log(`video load ${event.type || 'error'}: sid=${event.target.name}, domid=${event.target.id}`)
4110
+ this.saveLog(`video load ${event.type || 'error'}: sid=${event.target.name}, domid=${event.target.id}`)
4111
+ }
4112
+ this.bindVideoEvent = (domArr) => {
4113
+ domArr.forEach((domId) => {
4114
+ document.getElementById(domId).addEventListener("error", this.videoErrorEvent);
4115
+ document.getElementById(domId).addEventListener("emptied", this.videoErrorEvent);
4116
+ document.getElementById(domId).addEventListener("stalled", this.videoErrorEvent);
4117
+ document.getElementById(domId).addEventListener("suspend", this.videoErrorEvent);
4118
+ })
4119
+ }
4120
+ this.removeVideoEvent = (domArr) => {
4121
+ domArr.forEach((domId) => {
4122
+ document.getElementById(domId).removeEventListener("error", this.videoErrorEvent);
4123
+ document.getElementById(domId).removeEventListener("emptied", this.videoErrorEvent);
4124
+ document.getElementById(domId).removeEventListener("stalled", this.videoErrorEvent);
4125
+ document.getElementById(domId).removeEventListener("suspend", this.videoErrorEvent);
4126
+ })
4127
+ }
3999
4128
  this.setState({
4000
4129
  videoList: arr
4001
4130
  }, () => {
@@ -4009,7 +4138,9 @@ class Video extends Component {
4009
4138
  // console.log(arrItem.videoName)
4010
4139
 
4011
4140
  });
4141
+ this.bindVideoEvent(['video'+ i])
4012
4142
  }
4143
+ this.bindVideoEvent(['video20', 'video21', 'publish_video1'])
4013
4144
  })
4014
4145
  if (this.props.sessionId) {
4015
4146
  this.getRoomStatus({
@@ -4044,6 +4175,12 @@ class Video extends Component {
4044
4175
  let that = this;
4045
4176
  this.asr_controller.onConnectError = () => {
4046
4177
  this.messageClick('违禁词检测服务连接失败', 'error')
4178
+ this.saveLog('DR_ASR_FAILURE');
4179
+ }
4180
+ this.asr_controller.onAsrError = (info) => {
4181
+ // this.messageClick('违禁词检测服务连接失败', 'error')
4182
+ console.log(`ASR fail event, status=${info.status}, msg=${info.message}, taskId=${info.taskId}`);
4183
+ this.saveLog(`ASR fail event, status=${info.status}, msg=${info.message}, taskId=${info.taskId}`);
4047
4184
  }
4048
4185
 
4049
4186
  this.asr_controller.onConnectOK = () => {
@@ -4212,6 +4349,26 @@ class Video extends Component {
4212
4349
  }
4213
4350
  }
4214
4351
  }
4352
+ setSharedScreenTimer = (state) => {
4353
+ // 设置定时,如果x秒内没有重新开启投屏 则弹出提示
4354
+ if (!this.props.screenSharedInterval || typeof this.props.screenSharedInterval != 'number') return;
4355
+ if (state) {
4356
+ clearTimeout(this.screenSharedTimer)
4357
+ } else {
4358
+ clearTimeout(this.screenSharedTimer)
4359
+ this.screenSharedTimer = setTimeout(() => {
4360
+ if (!document.getElementById('video20').name) {
4361
+ this.setState({
4362
+ screenSharedModalVisible: true
4363
+ })
4364
+ let audio = new Audio(screenSharedIntervalAudio)
4365
+ audio.play()
4366
+ } else {
4367
+ console.log('screenSharedTimer触发时已经在投屏')
4368
+ }
4369
+ }, this.props.screenSharedInterval * 1000)
4370
+ }
4371
+ }
4215
4372
  isFileSuccuse = () => {
4216
4373
  if (!this.state.sessionId || !this.state.sessionType || !this.state.imStatus) {
4217
4374
  this.messageClick('当前程序异常请先退出重开', 'error')
@@ -4262,6 +4419,10 @@ class Video extends Component {
4262
4419
  };
4263
4420
  sharedScreen = () => {
4264
4421
  console.log('投屏', this.state.tabTitles.find(el => el.value == 'staffScreen'))
4422
+ if (this.state.shareLock) {
4423
+ console.log('发布共享点击太快了')
4424
+ return;
4425
+ }
4265
4426
  if (this.isFileSuccuse()) {
4266
4427
  if (!this.state.tabTitles.find(el => el.value == 'staffScreen')) {
4267
4428
  const publish_config = {};
@@ -4270,7 +4431,10 @@ class Video extends Component {
4270
4431
  streamShare = ''
4271
4432
  }
4272
4433
  if (this.state.isSharedScreen) {
4434
+ this.saveLog('unPublish share, reason: change screen content')
4435
+ console.log('unPublish share, reason: change screen content')
4273
4436
  this.test_controller.UnPublish(document.getElementById('video20').name)
4437
+ this.state.shareLock = true;
4274
4438
  setTimeout(() => {
4275
4439
  publish_config.media_type = 1
4276
4440
  publish_config.publish_device = 2
@@ -4283,7 +4447,18 @@ class Video extends Component {
4283
4447
  publish_config.publish_streamId_id = 'subscribe_streamId20'
4284
4448
  publish_config.publish_tag = 'projectionWhiteboard'
4285
4449
  this.test_controller.Publish(publish_config)
4450
+ setTimeout(() => { this.state.shareLock = false; }, 500);
4286
4451
  }, 300);
4452
+ this.setState({
4453
+ screenName: '切换共享',
4454
+ isPDF: false
4455
+ })
4456
+ this.tabTitlesClick(
4457
+ {
4458
+ value: 'RMScreen',
4459
+ name: '共享内容'
4460
+ }, 'add'
4461
+ )
4287
4462
  // const publish_config = {}
4288
4463
  // publish_config.media_type = 1
4289
4464
  // publish_config.publish_device = 2
@@ -4298,7 +4473,10 @@ class Video extends Component {
4298
4473
  // this.state.isScreenSwitching = true
4299
4474
  } else {
4300
4475
  if (document.getElementById('video20').name) {
4476
+ this.saveLog('unPublish share, reason: change screen content')
4477
+ console.log('unPublish share, reason: change screen content')
4301
4478
  this.test_controller.UnPublish(document.getElementById('video20').name)
4479
+ this.state.shareLock = true;
4302
4480
  setTimeout(() => {
4303
4481
  publish_config.media_type = 1
4304
4482
  publish_config.publish_device = 2
@@ -4311,7 +4489,8 @@ class Video extends Component {
4311
4489
  publish_config.publish_streamId_id = 'subscribe_streamId20'
4312
4490
  publish_config.publish_tag = 'projectionWhiteboard'
4313
4491
  this.test_controller.Publish(publish_config)
4314
- }, 300);
4492
+ setTimeout(() => { this.state.shareLock = false; }, 500); // 这个延迟用于防止跳出弹窗后仍可以点击共享按钮,大于debounce300即可
4493
+ }, 300);// 这个延迟用于跟UnPublish 产生时差,防止标签未被释放
4315
4494
  // publish_config.media_type = 1;
4316
4495
  // publish_config.publish_device = 2;
4317
4496
  // publish_config.video_profile_type = 1
@@ -4465,7 +4644,8 @@ class Video extends Component {
4465
4644
  this.pictureInPicture()
4466
4645
  }
4467
4646
  this.saveLog('Start business recording')
4468
- this.enableServerRecording(this.state.businessId)
4647
+ if (!this.state.businessRecordId) this.enableServerRecording(this.state.businessId)
4648
+ if (!this.state.ipadRecordId && this.state.ipadTag) this.enableIpadRecording(this.state.businessId)
4469
4649
  clearTimeout(this.recordLoopPlayTimer)
4470
4650
  }
4471
4651
  handleOkLowPowerConfirm = () => {
@@ -4476,6 +4656,44 @@ class Video extends Component {
4476
4656
  'userId': this.props.tellerAccount
4477
4657
  })
4478
4658
  }
4659
+ // 取消投屏确认
4660
+ handleOkShareConfirm = () => {
4661
+ this.setState({
4662
+ screenSharedModalVisible: false
4663
+ })
4664
+ if (this.state.lastShareType == 'whiteboard') {
4665
+ this.switchExternal()
4666
+ } else {
4667
+ this.sharedScreen()
4668
+ }
4669
+ this.saveLog('Shared overlay click confirm')
4670
+ }
4671
+ handleOkShareCancel = () => {
4672
+ this.setState({
4673
+ screenSharedModalVisible: false,
4674
+ screenSharedSecondaryModalVisible: true
4675
+ })
4676
+ this.saveLog('Shared overlay click cancel')
4677
+ }
4678
+ // 二次取消投屏确认
4679
+ handleOkSecondaryShareConfirm = () => {
4680
+ this.setState({
4681
+ screenSharedSecondaryModalVisible: false
4682
+ })
4683
+ if (this.state.lastShareType == 'whiteboard') {
4684
+ this.switchExternal()
4685
+ } else {
4686
+ this.sharedScreen()
4687
+ }
4688
+ this.saveLog('Shared secondary overlay click confirm')
4689
+ }
4690
+ handleOkSecondaryShareCancel = () => {
4691
+ this.setState({
4692
+ screenSharedSecondaryModalVisible: false
4693
+ })
4694
+ this.saveLog('Shared secondary overlay click cancel')
4695
+ this.saveVideoPoint('cancelShare', 'RM二次确认取消投屏')
4696
+ }
4479
4697
  handleOkMediaErrorConfirm = () => {
4480
4698
  // 刷新重试
4481
4699
  clearTimeout(this.mediaErrorPlayTimer)
@@ -5538,12 +5756,18 @@ class Video extends Component {
5538
5756
  //单击停止共享按钮后,触发这个事件
5539
5757
  streamShare = ''
5540
5758
  if (document.getElementById('video20').name && !this.state.isSharedScreen) {
5759
+ console.log('unPublish share, reason: click stop sharing whiteboard or stream onended')
5760
+ that.saveLog('unPublish share, reason: click stop sharing whiteboard or stream onended')
5541
5761
  that.test_controller.UnPublish(document.getElementById('video20').name)
5542
5762
  }
5543
5763
  }
5544
5764
 
5545
5765
  // 关闭当前共享屏幕
5546
- document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
5766
+ if (document.getElementById('video20') && document.getElementById('video20').name) {
5767
+ console.log('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
5768
+ that.saveLog('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
5769
+ that.test_controller.UnPublish(document.getElementById('video20').name)
5770
+ }
5547
5771
  that.state.isSharedScreen = false
5548
5772
  that.state.isScreenSwitching = false
5549
5773
  // that.setSharedScreenState(false)
@@ -5556,6 +5780,9 @@ class Video extends Component {
5556
5780
  console.log("Unable to acquire screen capture", error);
5557
5781
  console.log('取消签署')
5558
5782
  that.saveLog('Manual cancel share')
5783
+ if (!document.getElementById('video20').name) {
5784
+ that.setSharedScreenTimer(false)
5785
+ }
5559
5786
  });
5560
5787
  }
5561
5788
  publishRecorderDevice = () => {
@@ -5640,6 +5867,8 @@ class Video extends Component {
5640
5867
  //单击停止共享按钮后,触发这个事件
5641
5868
  streamRecord = ''
5642
5869
  if (document.getElementById('record_video').name) {
5870
+ that.saveLog('unPublish share, reason: click stop recording all screen or stream onended')
5871
+ console.log('unPublish share, reason: click stop recording all screen or stream onended')
5643
5872
  that.test_controller.UnPublish(document.getElementById('record_video').name)
5644
5873
  }
5645
5874
  }
@@ -5671,6 +5900,7 @@ class Video extends Component {
5671
5900
  }
5672
5901
  }
5673
5902
  this.navigatorClick()
5903
+ clearTimeout(this.screenSharedTimer)
5674
5904
 
5675
5905
  } else {
5676
5906
  this.messageClick('internal staff正在共享屏幕,请先关闭', 'error')
@@ -6913,6 +7143,24 @@ class Video extends Component {
6913
7143
  ]}>
6914
7144
  <div className='endModal'>双录异常中断,请重新开启</div>
6915
7145
  </Modal>
7146
+ {/* 投屏间隔过长确认 */}
7147
+ <Modal closable={false} centered={true} visible={this.state.screenSharedModalVisible} maskClosable={false} footer={[
7148
+ <div key='end'>
7149
+ <Button className="modelButtonCancel" onClick={this.handleOkShareCancel}>取消操作</Button>
7150
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkShareConfirm}>确认共享</Button>
7151
+ </div>
7152
+ ]}>
7153
+ <div className='endModal' style={{paddingBottom: '20px'}}>当前系统未共享屏幕、未共享声音,请确认是否需要开启共享操作?</div>
7154
+ </Modal>
7155
+ {/* 投屏间隔过长二次确认 */}
7156
+ <Modal closable={false} centered={true} visible={this.state.screenSharedSecondaryModalVisible} maskClosable={false} footer={[
7157
+ <div key='end'>
7158
+ <Button className="modelButtonCancel" onClick={this.handleOkSecondaryShareCancel}>取消操作</Button>
7159
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSecondaryShareConfirm}>确认共享</Button>
7160
+ </div>
7161
+ ]}>
7162
+ <div className='endModal' style={{paddingBottom: '20px'}}>取消操作按钮将无法开启共享屏幕、共享声音,请再次确认</div>
7163
+ </Modal>
6916
7164
  {/* ipad低电量确认 */}
6917
7165
  <Modal closable={false} centered={true} visible={this.state.ipadLowPowerErrorModalVisible} maskClosable={false} footer={[
6918
7166
  <div key='end'>
@@ -6927,7 +7175,7 @@ class Video extends Component {
6927
7175
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkIpadLeaveConfirm}>确定</Button>
6928
7176
  </div>
6929
7177
  ]}>
6930
- <div className='ipadModal'>iPad 摄像头异常退出,请扫码或输入会议号入会</div>
7178
+ <div className='ipadModal'>{this.state.IpadErrorWording}</div>
6931
7179
  <div className='QRCode center'>
6932
7180
  <QRCode
6933
7181
  value={JSON.stringify({
@@ -7439,6 +7687,7 @@ Video.defaultProps = {
7439
7687
  whetherNeedAsr: false, // 是否在双录时开启违禁词检测
7440
7688
  faceDetectInterval: 6, // 人脸检测间隔(秒)
7441
7689
  lightDetectInterval: 6, // 背光检测间隔(秒)
7690
+ screenSharedInterval: 0, // 取消投屏提示间隔(秒), 0不启用
7442
7691
  lightSensitivity: 1, // 光线敏感度系数,默认1
7443
7692
  userSide: 2,
7444
7693
  meetingDuration: null, // 会议时长,单位小时
@@ -68,6 +68,9 @@ export default class MyAsrController {
68
68
  onConnectError(data) {
69
69
  console.log('连接错误');
70
70
  }
71
+ onAsrError(data) {
72
+ console.log('服务端返回错误');
73
+ }
71
74
 
72
75
  initWebSocket() {
73
76
  console.log("初始化weosocket");
@@ -196,6 +199,16 @@ export default class MyAsrController {
196
199
  } else if ( ret.header.name === 'TranscriptionCompleted') {
197
200
  console.log('服务端已停止了语音转写', ret);
198
201
  }
202
+
203
+ if (ret.header.status != 20000000) {
204
+ this.onAsrError({
205
+ status: ret.header.status,
206
+ message: ret.header.status_text,
207
+ taskId: ret.header.task_id,
208
+ });
209
+ } else {
210
+ // console.log('status返回正常')
211
+ }
199
212
  }
200
213
 
201
214
  websocketSend(Data) { // 数据发送