react_hsbc_teller 2.0.46 → 2.0.48

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,11 +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';
30
+ import MediaErrorAudio from '../../assets/mp3/media_error.mp3';
29
31
  import internalJoin from '../../assets/mp3/internalJoin.mp3'
30
32
  import internalLeft from '../../assets/mp3/internalLeft.mp3'
31
33
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
32
34
  import networkWeakAudio from '../../assets/mp3/networkweak.mp3'
33
35
  import PIPictureClosedAudio from '../../assets/mp3/pip_close.mp3'
36
+ import screenSharedIntervalAudio from '../../assets/mp3/share_stop_audio.mp3'
34
37
  import errorPng from '../../assets/img/tooltips2_fail.png'
35
38
  import Modal from "antd/lib/modal";
36
39
  import 'antd/lib/modal/style'
@@ -60,7 +63,7 @@ import MultiModule from '../multiModule/multiModule'//签字、抄录
60
63
  import axios from 'axios';
61
64
  import CryptoJS from "crypto-js";
62
65
 
63
- const SDK_VERISON = '2.0.46'
66
+ const SDK_VERISON = '2.0.48'
64
67
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
65
68
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
66
69
  const { Option } = Select;
@@ -80,7 +83,9 @@ const POINT_TYPE = {
80
83
  mute: "静音",
81
84
  expDark: '曝光、背光',
82
85
  fcd: '人脸变化检测',
83
- padConnected: 'ipad已连接'
86
+ padConnected: 'ipad已连接',
87
+ cancelShare: '取消投屏',
88
+ conFail: '媒体流服务断开'
84
89
  }
85
90
  const RECORD_DEVICE_NAME = 'screen-capture-recorder'
86
91
  // const RECORD_DEVICE_NAME = 'Full HD webcam'
@@ -743,7 +748,7 @@ class Video extends Component {
743
748
  enable: true,
744
749
  xPosition: 16 * SCALE, // x 轴位置
745
750
  yPosition: 8 * SCALE, // y 轴位置
746
- text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.state.salesBranchCode || ''} ${this.state.branchName || ''} ${this.state.financialOffice || ''}`,
751
+ text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.state.branchName || ''} ${this.props.financialOffice || ''}`,
747
752
  fontSize: 16 * SCALE, // 字体⼤⼩
748
753
  url: '' // ⽔印图⽚ HTTP 地址
749
754
  },
@@ -786,7 +791,7 @@ class Video extends Component {
786
791
  enable: true,
787
792
  xPosition: 16, // x 轴位置
788
793
  yPosition: 8, // y 轴位置
789
- text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.state.salesBranchCode || ''} ${this.state.branchName || ''} ${this.state.financialOffice || ''}`,
794
+ text: `${this.props.recordMode ==1 ?'远程录制' :'网点录制'} ${this.props.salesBranchCode || ''} ${this.state.branchName || ''} ${this.props.financialOffice || ''}`,
790
795
  fontSize: 16, // 字体⼤⼩
791
796
  url: '' // ⽔印图⽚ HTTP 地址
792
797
  },
@@ -1801,6 +1806,8 @@ class Video extends Component {
1801
1806
  })
1802
1807
  } else {
1803
1808
  if (document.getElementById('video20').name) {
1809
+ this.saveLog('unPublish share, reason: receive stop whiteboard message 1218')
1810
+ console.log('unPublish share, reason: receive stop whiteboard message 1218')
1804
1811
  this.test_controller.UnPublish(document.getElementById('video20').name)
1805
1812
  if(this.state.drawCanvasInterval) clearInterval(this.state.drawCanvasInterval)
1806
1813
  }
@@ -1814,12 +1821,12 @@ class Video extends Component {
1814
1821
  }
1815
1822
 
1816
1823
  } else if (Mival.typeId == 1219) {
1817
- // 传入分行信息
1818
- if (Mival.sessionId == this.state.sessionId && this.props.recordMode == 2) {
1819
- this.state.salesBranchCode = Mival.salesBranchCode;
1820
- this.state.financialOffice = Mival.financialOffice;
1821
- this.state.branchName = Mival.salesBranchName;
1822
- }
1824
+ // 旧逻辑废弃。现在无论什么模式均为sdk外部传入
1825
+ // if (Mival.sessionId == this.state.sessionId && this.props.recordMode == 2) {
1826
+ // this.state.salesBranchCode = Mival.salesBranchCode;
1827
+ // this.state.financialOffice = Mival.financialOffice;
1828
+ // this.state.branchName = Mival.salesBranchName;
1829
+ // }
1823
1830
  } else if (Mival.typeId == 3100) {
1824
1831
  if(Mival.data.sessionId == this.state.sessionId) {
1825
1832
  muteJson.set(Mival.data.userId, JSON.stringify(Mival))
@@ -1934,22 +1941,47 @@ class Video extends Component {
1934
1941
  }
1935
1942
  } else if (Mival.typeId == 10020) {
1936
1943
  // 录制中断(模拟测试)
1937
- // this.messageClick('双录异常中断,请重新开启', 'error')
1938
- // this.setState({
1939
- // isRecordingeErrorModalVisible: true,
1940
- // businessRecordId: '',
1941
- // })
1942
- // // 循环播放录制中断语音
1943
- // clearTimeout(this.recordLoopPlayTimer)
1944
- // this.recordLoopPlay = () => {
1945
- // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1946
- // if(!this.state.businessRecordId && document.getElementById("publish_video1")){
1947
- // let audio = new Audio(recordErrorAudio)
1948
- // audio.play()
1949
- // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1950
- // }
1951
- // }
1952
- // setTimeout(this.recordLoopPlay, 0);
1944
+ const recordId = Mival.recordId;
1945
+
1946
+ // if (this.state.businessRecordId == recordId) {
1947
+ // // 双录录制中断
1948
+ // this.messageClick('双录异常中断,请重新开启', 'error')
1949
+ // this.setState({
1950
+ // isRecordingeErrorModalVisible: true,
1951
+ // businessRecordId: '',
1952
+ // })
1953
+ // this.saveLog(`dual recording crash, recordId=${recordId}`);
1954
+ // // 循环播放录制中断语音
1955
+ // clearTimeout(this.recordLoopPlayTimer)
1956
+ // this.recordLoopPlay = () => {
1957
+ // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1958
+ // if(!this.state.businessRecordId && document.getElementById("publish_streamId1")){
1959
+ // let audio = new Audio(recordErrorAudio)
1960
+ // audio.play()
1961
+ // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1962
+ // }
1963
+ // }
1964
+ // setTimeout(this.recordLoopPlay, 0);
1965
+ // } else if (this.state.ipadRecordId == recordId) {
1966
+ // // ipad录制中断
1967
+ // this.messageClick('双录异常中断,请重新开启', 'error')
1968
+ // this.setState({
1969
+ // isRecordingeErrorModalVisible: true,
1970
+ // ipadRecordId: '',
1971
+ // })
1972
+ // this.saveLog(`ipad dual recording crash, recordId=${recordId}`);
1973
+ // // 循环播放录制中断语音
1974
+ // clearTimeout(this.recordLoopPlayTimer)
1975
+ // this.recordLoopPlay = () => {
1976
+ // console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
1977
+ // if(!this.state.ipadRecordId && document.getElementById("publish_streamId1")){
1978
+ // let audio = new Audio(recordErrorAudio)
1979
+ // audio.play()
1980
+ // this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
1981
+ // }
1982
+ // }
1983
+ // setTimeout(this.recordLoopPlay, 0);
1984
+ // }
1953
1985
 
1954
1986
  } else if (Mival.typeId == 33001 && this.state.sessionId == Mival.data.sessionId) {
1955
1987
  if (Mival.type == 1) {
@@ -2329,6 +2361,24 @@ class Video extends Component {
2329
2361
  console.log('初始化音视频失败', err_code, err_msg)
2330
2362
  this.saveLog('OnMediaCallFail, code=' + err_code)
2331
2363
  };
2364
+
2365
+ const playAudioTip = () => {
2366
+ this.messageClick('媒体流服务异常断开,请退出重试', 'error')
2367
+ this.setState({
2368
+ mediaErrorModalVisible: true,
2369
+ })
2370
+ // 循环播放提醒
2371
+ clearTimeout(this.mediaErrorPlayTimer)
2372
+ this.mediaErrorPlay = () => {
2373
+ if(this.state.mediaErrorModalVisible){
2374
+ if (this.mediaErrorAudio) this.mediaErrorAudio.pause()
2375
+ this.mediaErrorAudio = new Audio(MediaErrorAudio)
2376
+ this.mediaErrorAudio.play()
2377
+ this.mediaErrorPlayTimer = setTimeout(this.mediaErrorPlay, 3000);
2378
+ }
2379
+ }
2380
+ setTimeout(this.mediaErrorPlay, 0);
2381
+ }
2332
2382
  // 音视频关闭通知
2333
2383
  this.test_controller.OnMediaClose = (code, sid) => {
2334
2384
  console.log('OnMediaClose',code, sid)
@@ -2336,9 +2386,18 @@ class Video extends Component {
2336
2386
  if (sid == this.state.publishSid) {
2337
2387
  this.saveLog('Audio and video close notification,' + code)
2338
2388
  this.roomCallBack(2, '音视频异常关闭', 8)
2389
+ if (code == 5007 || code == 5007 || code == 5009 || code == 5010 || code == 5011) {
2390
+ this.saveVideoPoint('conFail', `RM端媒体链路断开, err_code=${code}`)
2391
+ playAudioTip();
2392
+ }
2339
2393
  } else if (sid == this.state.publishScreenSid) {
2340
2394
  this.state.isScreenSwitching = false
2341
2395
  this.setSharedScreenState(false)
2396
+ this.setSharedScreenTimer(false)
2397
+ if (code == 5007 || code == 5007 || code == 5009 || code == 5010 || code == 5011) {
2398
+ this.saveVideoPoint('conFail', `RM投屏媒体链路断开, err_code=${code}`)
2399
+ playAudioTip();
2400
+ }
2342
2401
  if (code == 5012) {
2343
2402
  this.saveLog('Manual cancel share'); // 点了取消,拒绝系统授权
2344
2403
  } else {
@@ -2479,15 +2538,19 @@ class Video extends Component {
2479
2538
  if ( stream.getVideoTracks()[0] instanceof BrowserCaptureMediaStreamTrack) {
2480
2539
  console.log('tab共享')
2481
2540
  this.saveLog('Share type = tab')
2541
+ this.state.lastShareType = 'share'
2482
2542
  } else if (stream.getVideoTracks()[0] instanceof MediaStreamTrack && stream.getVideoTracks()[0].label.includes('screen')) {
2483
2543
  console.log('屏幕共享')
2484
2544
  this.saveLog('Share type = screen')
2545
+ this.state.lastShareType = 'share'
2485
2546
  } else if (stream.getVideoTracks()[0].label.includes('window')){
2486
2547
  console.log('窗口共享')
2487
2548
  this.saveLog('Share type = window')
2549
+ this.state.lastShareType = 'share'
2488
2550
  } else if (stream.getVideoTracks()[0] instanceof CanvasCaptureMediaStreamTrack){
2489
2551
  console.log('白板共享')
2490
2552
  this.saveLog('Share type = whiteboard')
2553
+ this.state.lastShareType = 'whiteboard'
2491
2554
  }
2492
2555
  } catch (err) {
2493
2556
  console.log('不支持此浏览器记录投屏类型日志')
@@ -2540,6 +2603,7 @@ class Video extends Component {
2540
2603
  if (sid == document.getElementById('video20').name) {
2541
2604
  this.state.publishScreenSid = document.getElementById('video20').name
2542
2605
  this.setSharedScreenState(true)
2606
+ this.setSharedScreenTimer(true)
2543
2607
  this.saveLog('Share success')
2544
2608
  this.sendMessage({
2545
2609
  'typeId': 2030,
@@ -2611,6 +2675,7 @@ class Video extends Component {
2611
2675
  } else {
2612
2676
  this.messageClick('投屏失败请重新投屏', 'error')
2613
2677
  this.setSharedScreenState(false)
2678
+ this.setSharedScreenTimer(false)
2614
2679
  this.saveLog('Share fail, code=' + err_code)
2615
2680
  }
2616
2681
 
@@ -2870,6 +2935,7 @@ class Video extends Component {
2870
2935
  })
2871
2936
  this.state.isSharedScreen = false
2872
2937
  this.setSharedScreenState(false)
2938
+ this.setSharedScreenTimer(false)
2873
2939
  this.saveLog('Stop share')
2874
2940
  this.setState({
2875
2941
 
@@ -2930,6 +2996,41 @@ class Video extends Component {
2930
2996
  // 推送“取消发布”给与会者
2931
2997
  this.test_controller.OnUnPublish = (feed) => {
2932
2998
  console.log('取消发布者', feed)
2999
+
3000
+ // ipad取消发布提醒
3001
+ if (feed.uid.includes(IPAD_SUFFIX) && this.state.businessId){
3002
+ // ipad单独处理,双录过程中ipad如果取消发布,要提示+循环播报直到ipad重新入会
3003
+ this.setState({
3004
+ IpadLeaveErrorModalVisible: true,
3005
+ IpadErrorWording: 'iPad 媒体流异常,请重新扫码或输入会议号入会',
3006
+ ipadTag: '',
3007
+ })
3008
+ // 循环播放ipad退出语音
3009
+ clearTimeout(this.ipadLeavePlayTimer)
3010
+ this.ipadMediaClosePlay = () => {
3011
+ if(!this.state.ipadTag && document.getElementById("publish_streamId1")){
3012
+ if (this.ipadLeaveAudio) this.ipadLeaveAudio.pause()
3013
+ setTimeout(() => {
3014
+ this.ipadLeaveAudio = new Audio(ipadMediaCloseAudio)
3015
+ this.ipadLeaveAudio.play()
3016
+ }, 800); // 防止退出房间时重音
3017
+ this.ipadLeavePlayTimer = setTimeout(this.ipadMediaClosePlay, 3000);
3018
+ }
3019
+ }
3020
+ setTimeout(this.ipadMediaClosePlay, 0);
3021
+ } else if (feed.uid.includes(IPAD_SUFFIX)) {
3022
+ // 非双录下ipad离开提示iPad已断开
3023
+ this.setState({
3024
+ ipadTag: '',
3025
+ })
3026
+ this.messageClick(('iPad 媒体流异常,请调整'), 'error')
3027
+ this.saveLog('iPad media close')
3028
+ if (this.props.isOpenSound) {
3029
+ let audio = new Audio(ipadMediaCloseAudio)
3030
+ audio.play()
3031
+ }
3032
+ }
3033
+
2933
3034
  for (let i = 0; i < this.state.roomCustomerList.length; i++) {
2934
3035
  if (this.state.roomCustomerList[i].feedId == feed.feedId) {
2935
3036
  this.state.roomCustomerList.splice(i, 1)
@@ -2986,18 +3087,21 @@ class Video extends Component {
2986
3087
  // ipad单独处理,双录过程中ipad如果离开,要提示+循环播报直到ipad重新入会
2987
3088
  this.setState({
2988
3089
  IpadLeaveErrorModalVisible: true,
3090
+ IpadErrorWording: 'iPad 摄像头异常退出,请扫码或输入会议号入会',
2989
3091
  ipadTag: '',
2990
3092
  })
2991
3093
  // 循环播放ipad退出语音
2992
3094
  clearTimeout(this.ipadLeavePlayTimer)
2993
3095
  this.ipadLeavePlay = () => {
2994
3096
  if(!this.state.ipadTag && document.getElementById("publish_streamId1")){
2995
- let audio = new Audio(IpadLeaveAudio)
2996
- audio.play()
3097
+ if (this.ipadLeaveAudio) this.ipadLeaveAudio.pause()
3098
+ this.ipadLeaveAudio = new Audio(IpadLeaveAudio)
3099
+ this.ipadLeaveAudio.play()
2997
3100
  this.ipadLeavePlayTimer = setTimeout(this.ipadLeavePlay, 3000);
2998
3101
  }
2999
3102
  }
3000
3103
  setTimeout(this.ipadLeavePlay, 0);
3104
+ this.saveLog('iPad leave room during recording')
3001
3105
  return
3002
3106
  } else if (participant.includes(IPAD_SUFFIX)) {
3003
3107
  // 非双录下ipad离开提示iPad已断开
@@ -3237,7 +3341,7 @@ class Video extends Component {
3237
3341
 
3238
3342
  // 如果在业务双录中,需要重新开启;如果是full录制出错,则不用处理
3239
3343
  if (this.state.businessRecordId == recordId) {
3240
- // 录制中断
3344
+ // 双录录制中断
3241
3345
  this.messageClick('双录异常中断,请重新开启', 'error')
3242
3346
  this.setState({
3243
3347
  isRecordingeErrorModalVisible: true,
@@ -3255,6 +3359,25 @@ class Video extends Component {
3255
3359
  }
3256
3360
  }
3257
3361
  setTimeout(this.recordLoopPlay, 0);
3362
+ } else if (this.state.ipadRecordId == recordId) {
3363
+ // ipad录制中断
3364
+ this.messageClick('双录异常中断,请重新开启', 'error')
3365
+ this.setState({
3366
+ isRecordingeErrorModalVisible: true,
3367
+ ipadRecordId: '',
3368
+ })
3369
+ this.saveLog(`ipad dual recording crash, recordId=${recordId}`);
3370
+ // 循环播放录制中断语音
3371
+ clearTimeout(this.recordLoopPlayTimer)
3372
+ this.recordLoopPlay = () => {
3373
+ console.log('loop recordId', this.state.recordId, 'businessRecordId ', this.state.businessRecordId)
3374
+ if(!this.state.ipadRecordId && document.getElementById("publish_streamId1")){
3375
+ let audio = new Audio(recordErrorAudio)
3376
+ audio.play()
3377
+ this.recordLoopPlayTimer = setTimeout(this.recordLoopPlay, 3000);
3378
+ }
3379
+ }
3380
+ setTimeout(this.recordLoopPlay, 0);
3258
3381
  }
3259
3382
  };
3260
3383
  // 停止浏览器录制成功回调
@@ -3346,6 +3469,7 @@ class Video extends Component {
3346
3469
  this.state.isSharedScreen = true
3347
3470
  this.state.isScreenSwitching = false
3348
3471
  this.setSharedScreenState(true)
3472
+ this.setSharedScreenTimer(true)
3349
3473
  this.saveLog('Share changed')
3350
3474
  }
3351
3475
  }
@@ -3364,10 +3488,13 @@ class Video extends Component {
3364
3488
  })
3365
3489
  this.messageClick('切换摄像头或麦克风失败,请先检查设备', 'error')
3366
3490
  } else if (this.state.screenName == '切换共享') {
3491
+ this.saveLog('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3492
+ console.log('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3367
3493
  this.test_controller.UnPublish(document.getElementById('video20').name)
3368
3494
  this.state.isSharedScreen = false
3369
3495
  this.state.isScreenSwitching = false
3370
3496
  this.setSharedScreenState(false)
3497
+ this.setSharedScreenTimer(false)
3371
3498
  this.saveLog('Share fail, code=' + code)
3372
3499
  this.setState({
3373
3500
  screenName: '共享模式'
@@ -3502,6 +3629,8 @@ class Video extends Component {
3502
3629
  this.state.isScreenSwitching = false
3503
3630
  } else {
3504
3631
  if (!streamShare) {
3632
+ this.saveLog('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
3633
+ console.log('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
3505
3634
  document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
3506
3635
  } else {
3507
3636
  console.log('白板')
@@ -3509,6 +3638,7 @@ class Video extends Component {
3509
3638
  this.state.isSharedScreen = false
3510
3639
  this.state.isScreenSwitching = false
3511
3640
  this.setSharedScreenState(false)
3641
+ this.setSharedScreenTimer(false)
3512
3642
  this.setState({
3513
3643
  screenName: '共享模式'
3514
3644
  });
@@ -3731,9 +3861,15 @@ class Video extends Component {
3731
3861
  clearTimeout(this.recordLoopPlayTimer)
3732
3862
  clearTimeout(this.ipadLeavePlayTimer)
3733
3863
  clearTimeout(this.ipadLowPowerPlayTimer)
3864
+ clearTimeout(this.mediaErrorPlayTimer)
3865
+ clearTimeout(this.screenSharedTimer)
3734
3866
  clearInterval(this.state.drawCanvasInterval)
3735
3867
  clearInterval(this.state.faceDetectionTimer);
3736
3868
  clearInterval(this.state.imageDetectionTimer);
3869
+ this.removeVideoEvent(['video20', 'video21', 'publish_video1'])
3870
+ for(let i=1;i<=12;i++){
3871
+ this.removeVideoEvent(['video'+ i])
3872
+ }
3737
3873
  }
3738
3874
  finishSession = () => {
3739
3875
  // clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
@@ -3967,6 +4103,27 @@ class Video extends Component {
3967
4103
  hasOcr: 0,
3968
4104
  })
3969
4105
  }
4106
+ this.videoErrorEvent = (event) => {
4107
+ console.log(event)
4108
+ console.log(`video load ${event.type || 'error'}: sid=${event.target.name}, domid=${event.target.id}`)
4109
+ this.saveLog(`video load ${event.type || 'error'}: sid=${event.target.name}, domid=${event.target.id}`)
4110
+ }
4111
+ this.bindVideoEvent = (domArr) => {
4112
+ domArr.forEach((domId) => {
4113
+ document.getElementById(domId).addEventListener("error", this.videoErrorEvent);
4114
+ document.getElementById(domId).addEventListener("emptied", this.videoErrorEvent);
4115
+ document.getElementById(domId).addEventListener("stalled", this.videoErrorEvent);
4116
+ document.getElementById(domId).addEventListener("suspend", this.videoErrorEvent);
4117
+ })
4118
+ }
4119
+ this.removeVideoEvent = (domArr) => {
4120
+ domArr.forEach((domId) => {
4121
+ document.getElementById(domId).removeEventListener("error", this.videoErrorEvent);
4122
+ document.getElementById(domId).removeEventListener("emptied", this.videoErrorEvent);
4123
+ document.getElementById(domId).removeEventListener("stalled", this.videoErrorEvent);
4124
+ document.getElementById(domId).removeEventListener("suspend", this.videoErrorEvent);
4125
+ })
4126
+ }
3970
4127
  this.setState({
3971
4128
  videoList: arr
3972
4129
  }, () => {
@@ -3980,7 +4137,9 @@ class Video extends Component {
3980
4137
  // console.log(arrItem.videoName)
3981
4138
 
3982
4139
  });
4140
+ this.bindVideoEvent(['video'+ i])
3983
4141
  }
4142
+ this.bindVideoEvent(['video20', 'video21', 'publish_video1'])
3984
4143
  })
3985
4144
  if (this.props.sessionId) {
3986
4145
  this.getRoomStatus({
@@ -4015,6 +4174,12 @@ class Video extends Component {
4015
4174
  let that = this;
4016
4175
  this.asr_controller.onConnectError = () => {
4017
4176
  this.messageClick('违禁词检测服务连接失败', 'error')
4177
+ this.saveLog('DR_ASR_FAILURE');
4178
+ }
4179
+ this.asr_controller.onAsrError = (info) => {
4180
+ // this.messageClick('违禁词检测服务连接失败', 'error')
4181
+ console.log(`ASR fail event, status=${info.status}, msg=${info.message}, taskId=${info.taskId}`);
4182
+ this.saveLog(`ASR fail event, status=${info.status}, msg=${info.message}, taskId=${info.taskId}`);
4018
4183
  }
4019
4184
 
4020
4185
  this.asr_controller.onConnectOK = () => {
@@ -4183,6 +4348,26 @@ class Video extends Component {
4183
4348
  }
4184
4349
  }
4185
4350
  }
4351
+ setSharedScreenTimer = (state) => {
4352
+ // 设置定时,如果x秒内没有重新开启投屏 则弹出提示
4353
+ if (!this.props.screenSharedInterval || typeof this.props.screenSharedInterval != 'number') return;
4354
+ if (state) {
4355
+ clearTimeout(this.screenSharedTimer)
4356
+ } else {
4357
+ clearTimeout(this.screenSharedTimer)
4358
+ this.screenSharedTimer = setTimeout(() => {
4359
+ if (!document.getElementById('video20').name) {
4360
+ this.setState({
4361
+ screenSharedModalVisible: true
4362
+ })
4363
+ let audio = new Audio(screenSharedIntervalAudio)
4364
+ audio.play()
4365
+ } else {
4366
+ console.log('screenSharedTimer触发时已经在投屏')
4367
+ }
4368
+ }, this.props.screenSharedInterval * 1000)
4369
+ }
4370
+ }
4186
4371
  isFileSuccuse = () => {
4187
4372
  if (!this.state.sessionId || !this.state.sessionType || !this.state.imStatus) {
4188
4373
  this.messageClick('当前程序异常请先退出重开', 'error')
@@ -4233,6 +4418,10 @@ class Video extends Component {
4233
4418
  };
4234
4419
  sharedScreen = () => {
4235
4420
  console.log('投屏', this.state.tabTitles.find(el => el.value == 'staffScreen'))
4421
+ if (this.state.shareLock) {
4422
+ console.log('发布共享点击太快了')
4423
+ return;
4424
+ }
4236
4425
  if (this.isFileSuccuse()) {
4237
4426
  if (!this.state.tabTitles.find(el => el.value == 'staffScreen')) {
4238
4427
  const publish_config = {};
@@ -4241,7 +4430,10 @@ class Video extends Component {
4241
4430
  streamShare = ''
4242
4431
  }
4243
4432
  if (this.state.isSharedScreen) {
4433
+ this.saveLog('unPublish share, reason: change screen content')
4434
+ console.log('unPublish share, reason: change screen content')
4244
4435
  this.test_controller.UnPublish(document.getElementById('video20').name)
4436
+ this.state.shareLock = true;
4245
4437
  setTimeout(() => {
4246
4438
  publish_config.media_type = 1
4247
4439
  publish_config.publish_device = 2
@@ -4254,7 +4446,18 @@ class Video extends Component {
4254
4446
  publish_config.publish_streamId_id = 'subscribe_streamId20'
4255
4447
  publish_config.publish_tag = 'projectionWhiteboard'
4256
4448
  this.test_controller.Publish(publish_config)
4449
+ setTimeout(() => { this.state.shareLock = false; }, 500);
4257
4450
  }, 300);
4451
+ this.setState({
4452
+ screenName: '切换共享',
4453
+ isPDF: false
4454
+ })
4455
+ this.tabTitlesClick(
4456
+ {
4457
+ value: 'RMScreen',
4458
+ name: '共享内容'
4459
+ }, 'add'
4460
+ )
4258
4461
  // const publish_config = {}
4259
4462
  // publish_config.media_type = 1
4260
4463
  // publish_config.publish_device = 2
@@ -4269,7 +4472,10 @@ class Video extends Component {
4269
4472
  // this.state.isScreenSwitching = true
4270
4473
  } else {
4271
4474
  if (document.getElementById('video20').name) {
4475
+ this.saveLog('unPublish share, reason: change screen content')
4476
+ console.log('unPublish share, reason: change screen content')
4272
4477
  this.test_controller.UnPublish(document.getElementById('video20').name)
4478
+ this.state.shareLock = true;
4273
4479
  setTimeout(() => {
4274
4480
  publish_config.media_type = 1
4275
4481
  publish_config.publish_device = 2
@@ -4282,7 +4488,8 @@ class Video extends Component {
4282
4488
  publish_config.publish_streamId_id = 'subscribe_streamId20'
4283
4489
  publish_config.publish_tag = 'projectionWhiteboard'
4284
4490
  this.test_controller.Publish(publish_config)
4285
- }, 300);
4491
+ setTimeout(() => { this.state.shareLock = false; }, 500); // 这个延迟用于防止跳出弹窗后仍可以点击共享按钮,大于debounce300即可
4492
+ }, 300);// 这个延迟用于跟UnPublish 产生时差,防止标签未被释放
4286
4493
  // publish_config.media_type = 1;
4287
4494
  // publish_config.publish_device = 2;
4288
4495
  // publish_config.video_profile_type = 1
@@ -4436,7 +4643,8 @@ class Video extends Component {
4436
4643
  this.pictureInPicture()
4437
4644
  }
4438
4645
  this.saveLog('Start business recording')
4439
- this.enableServerRecording(this.state.businessId)
4646
+ if (!this.state.businessRecordId) this.enableServerRecording(this.state.businessId)
4647
+ if (!this.state.ipadRecordId && this.state.ipadTag) this.enableIpadRecording(this.state.businessId)
4440
4648
  clearTimeout(this.recordLoopPlayTimer)
4441
4649
  }
4442
4650
  handleOkLowPowerConfirm = () => {
@@ -4447,6 +4655,53 @@ class Video extends Component {
4447
4655
  'userId': this.props.tellerAccount
4448
4656
  })
4449
4657
  }
4658
+ // 取消投屏确认
4659
+ handleOkShareConfirm = () => {
4660
+ this.setState({
4661
+ screenSharedModalVisible: false
4662
+ })
4663
+ if (this.state.lastShareType == 'whiteboard') {
4664
+ this.switchExternal()
4665
+ } else {
4666
+ this.sharedScreen()
4667
+ }
4668
+ this.saveLog('Shared overlay click confirm')
4669
+ }
4670
+ handleOkShareCancel = () => {
4671
+ this.setState({
4672
+ screenSharedModalVisible: false,
4673
+ screenSharedSecondaryModalVisible: true
4674
+ })
4675
+ this.saveLog('Shared overlay click cancel')
4676
+ }
4677
+ // 二次取消投屏确认
4678
+ handleOkSecondaryShareConfirm = () => {
4679
+ this.setState({
4680
+ screenSharedSecondaryModalVisible: false
4681
+ })
4682
+ if (this.state.lastShareType == 'whiteboard') {
4683
+ this.switchExternal()
4684
+ } else {
4685
+ this.sharedScreen()
4686
+ }
4687
+ this.saveLog('Shared secondary overlay click confirm')
4688
+ }
4689
+ handleOkSecondaryShareCancel = () => {
4690
+ this.setState({
4691
+ screenSharedSecondaryModalVisible: false
4692
+ })
4693
+ this.saveLog('Shared secondary overlay click cancel')
4694
+ this.saveVideoPoint('cancelShare', 'RM二次确认取消投屏')
4695
+ }
4696
+ handleOkMediaErrorConfirm = () => {
4697
+ // 刷新重试
4698
+ clearTimeout(this.mediaErrorPlayTimer)
4699
+ this.handleOkEnd()
4700
+ }
4701
+ handleCancelMediaError = () => {
4702
+ clearTimeout(this.mediaErrorPlayTimer)
4703
+ this.setState({ mediaErrorModalVisible: false })
4704
+ }
4450
4705
  handleOkIpadLeaveConfirm = () => {
4451
4706
  // 检测ipad是否入会
4452
4707
  if (!this.state.ipadTag) {
@@ -5226,7 +5481,8 @@ class Video extends Component {
5226
5481
  try {
5227
5482
  let result = await API.appGetUsername({
5228
5483
  userId: userId,
5229
- sessionId: this.state.sessionId
5484
+ sessionId: this.state.sessionId,
5485
+ activityId: this.props.businessNumber
5230
5486
  });
5231
5487
  console.log(result)
5232
5488
 
@@ -5499,12 +5755,18 @@ class Video extends Component {
5499
5755
  //单击停止共享按钮后,触发这个事件
5500
5756
  streamShare = ''
5501
5757
  if (document.getElementById('video20').name && !this.state.isSharedScreen) {
5758
+ console.log('unPublish share, reason: click stop sharing whiteboard or stream onended')
5759
+ that.saveLog('unPublish share, reason: click stop sharing whiteboard or stream onended')
5502
5760
  that.test_controller.UnPublish(document.getElementById('video20').name)
5503
5761
  }
5504
5762
  }
5505
5763
 
5506
5764
  // 关闭当前共享屏幕
5507
- document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
5765
+ if (document.getElementById('video20') && document.getElementById('video20').name) {
5766
+ console.log('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
5767
+ that.saveLog('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
5768
+ that.test_controller.UnPublish(document.getElementById('video20').name)
5769
+ }
5508
5770
  that.state.isSharedScreen = false
5509
5771
  that.state.isScreenSwitching = false
5510
5772
  // that.setSharedScreenState(false)
@@ -5517,6 +5779,9 @@ class Video extends Component {
5517
5779
  console.log("Unable to acquire screen capture", error);
5518
5780
  console.log('取消签署')
5519
5781
  that.saveLog('Manual cancel share')
5782
+ if (!document.getElementById('video20').name) {
5783
+ that.setSharedScreenTimer(false)
5784
+ }
5520
5785
  });
5521
5786
  }
5522
5787
  publishRecorderDevice = () => {
@@ -5601,6 +5866,8 @@ class Video extends Component {
5601
5866
  //单击停止共享按钮后,触发这个事件
5602
5867
  streamRecord = ''
5603
5868
  if (document.getElementById('record_video').name) {
5869
+ that.saveLog('unPublish share, reason: click stop recording all screen or stream onended')
5870
+ console.log('unPublish share, reason: click stop recording all screen or stream onended')
5604
5871
  that.test_controller.UnPublish(document.getElementById('record_video').name)
5605
5872
  }
5606
5873
  }
@@ -5632,6 +5899,7 @@ class Video extends Component {
5632
5899
  }
5633
5900
  }
5634
5901
  this.navigatorClick()
5902
+ clearTimeout(this.screenSharedTimer)
5635
5903
 
5636
5904
  } else {
5637
5905
  this.messageClick('internal staff正在共享屏幕,请先关闭', 'error')
@@ -6874,6 +7142,24 @@ class Video extends Component {
6874
7142
  ]}>
6875
7143
  <div className='endModal'>双录异常中断,请重新开启</div>
6876
7144
  </Modal>
7145
+ {/* 投屏间隔过长确认 */}
7146
+ <Modal closable={false} centered={true} visible={this.state.screenSharedModalVisible} maskClosable={false} footer={[
7147
+ <div key='end'>
7148
+ <Button className="modelButtonCancel" onClick={this.handleOkShareCancel}>取消操作</Button>
7149
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkShareConfirm}>确认共享</Button>
7150
+ </div>
7151
+ ]}>
7152
+ <div className='endModal' style={{paddingBottom: '20px'}}>当前系统未共享屏幕、未共享声音,请确认是否需要开启共享操作?</div>
7153
+ </Modal>
7154
+ {/* 投屏间隔过长二次确认 */}
7155
+ <Modal closable={false} centered={true} visible={this.state.screenSharedSecondaryModalVisible} maskClosable={false} footer={[
7156
+ <div key='end'>
7157
+ <Button className="modelButtonCancel" onClick={this.handleOkSecondaryShareCancel}>取消操作</Button>
7158
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkSecondaryShareConfirm}>确认共享</Button>
7159
+ </div>
7160
+ ]}>
7161
+ <div className='endModal' style={{paddingBottom: '20px'}}>取消操作按钮将无法开启共享屏幕、共享声音,请再次确认</div>
7162
+ </Modal>
6877
7163
  {/* ipad低电量确认 */}
6878
7164
  <Modal closable={false} centered={true} visible={this.state.ipadLowPowerErrorModalVisible} maskClosable={false} footer={[
6879
7165
  <div key='end'>
@@ -6888,7 +7174,7 @@ class Video extends Component {
6888
7174
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkIpadLeaveConfirm}>确定</Button>
6889
7175
  </div>
6890
7176
  ]}>
6891
- <div className='ipadModal'>iPad 摄像头异常退出,请扫码或输入会议号入会</div>
7177
+ <div className='ipadModal'>{this.state.IpadErrorWording}</div>
6892
7178
  <div className='QRCode center'>
6893
7179
  <QRCode
6894
7180
  value={JSON.stringify({
@@ -6903,6 +7189,15 @@ class Video extends Component {
6903
7189
  <div className='sessionDiv'><span>会议号码</span><div className='num'>{this.state.sessionId}</div></div>
6904
7190
  </div>
6905
7191
  </Modal>
7192
+ {/* 媒体流断开提示 */}
7193
+ <Modal closable={false} centered={true} visible={this.state.mediaErrorModalVisible} maskClosable={false} footer={[
7194
+ <div key='end'>
7195
+ <Button className="modelButtonCancel" onClick={this.handleCancelMediaError}>取消</Button>
7196
+ <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkMediaErrorConfirm}>确定</Button>
7197
+ </div>
7198
+ ]}>
7199
+ <div className='endModal'>媒体流服务异常断开,请退出重试</div>
7200
+ </Modal>
6906
7201
  {/* 是否退出会议*/}
6907
7202
  <Modal closable={false} centered={true} visible={this.state.isModalVisibleEnd} maskClosable={false} footer={[
6908
7203
  <div key='end'>
@@ -7391,6 +7686,7 @@ Video.defaultProps = {
7391
7686
  whetherNeedAsr: false, // 是否在双录时开启违禁词检测
7392
7687
  faceDetectInterval: 6, // 人脸检测间隔(秒)
7393
7688
  lightDetectInterval: 6, // 背光检测间隔(秒)
7689
+ screenSharedInterval: 0, // 取消投屏提示间隔(秒), 0不启用
7394
7690
  lightSensitivity: 1, // 光线敏感度系数,默认1
7395
7691
  userSide: 2,
7396
7692
  meetingDuration: null, // 会议时长,单位小时