react_hsbc_teller 0.7.9 → 0.8.3

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.
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable eqeqeq */
4
4
  import React, { Component, useState } from 'react';
5
5
  import API from '../../api/api';
6
- import { initWebSocket, joinRoom } from '../../common/websocket';
6
+ import { initWebSocket, joinRoom, disconnect } from '../../common/websocket';
7
7
  import './video.less'
8
8
  import Header from '../header/header.jsx'
9
9
  import Foot from '../foot/foot.jsx'
@@ -28,7 +28,11 @@ const LEAVE_TYPE = {
28
28
  ROOM_DESTROYED: -1, // 房间异常
29
29
  }
30
30
  let pictureInPictureVideo = ''
31
+ message.config({
32
+ getContainer: ()=>document.getElementById('allHSBC')
33
+ })
31
34
  @injectIntl
35
+
32
36
  class Video extends Component {
33
37
  constructor(props) {
34
38
  super(props)
@@ -37,7 +41,8 @@ class Video extends Component {
37
41
  cancel = axios.CancelToken.source()
38
42
  signCanvas = React.createRef();
39
43
  state = {
40
- sessionType: true,
44
+ isJoinRoom: false,
45
+ sessionType: false,
41
46
  isWhiteboard: false,
42
47
  isSelect: '',
43
48
  loading: false,
@@ -115,7 +120,19 @@ class Video extends Component {
115
120
  imStatus: false,
116
121
  imJoinRoom: false,
117
122
  analyserData: new Map(),
118
- analyserHeight: new Map()
123
+ analyserHeight: new Map(),
124
+ noVideoOne: false,
125
+ noVideoTwo: false,
126
+ noVideoThree: false,
127
+ noVideoFour: false,
128
+ noVideoFive: false,
129
+ noVideoSix: false,
130
+ noVideoSeven: false,
131
+ noVideoEight: false,
132
+ noVideoNine: false,
133
+ noVideoTen: false,
134
+ noVideoEleven: false,
135
+ noVideoTwelve: false,
119
136
  };
120
137
  // eslint-disable-next-line no-undef
121
138
  test_controller = '';
@@ -142,7 +159,8 @@ class Video extends Component {
142
159
  console.log(result);
143
160
  this.setState({
144
161
  imRoomId: result.imRoomId,
145
- sessionId: result.sessionId
162
+ sessionId: result.sessionId,
163
+ loading: false,
146
164
  });
147
165
  // eslint-disable-next-line no-undef
148
166
  if(this.state.imStatus) {
@@ -165,15 +183,21 @@ class Video extends Component {
165
183
  })
166
184
  } catch (err) {
167
185
  console.error(err);
186
+
168
187
  this.setState({
169
188
  sessionType: false
170
189
  })
171
- this.props.createRoomCallback({
172
- type: 2,
173
- errorManage: '保存房间信息失败',
174
- errorCode:-9,
175
- data: {}
176
- })
190
+ if(err.status == 502 || err.status== 404) {
191
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
192
+ } else {
193
+ this.props.createRoomCallback({
194
+ type: 2,
195
+ errorManage: '保存房间信息失败',
196
+ errorCode:-9,
197
+ data: {}
198
+ })
199
+ }
200
+
177
201
  }
178
202
  };
179
203
  /**
@@ -203,7 +227,12 @@ class Video extends Component {
203
227
  }
204
228
  } catch (err) {
205
229
  console.error(err);
206
- this.roomCallBack(2, '签名失败',-8)
230
+ if(err.status == 502 || err.status== 404) {
231
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
232
+ } else {
233
+ this.roomCallBack(2, '签名失败',8)
234
+ }
235
+
207
236
  }
208
237
  };
209
238
  handleEdit = () => {
@@ -357,6 +386,9 @@ class Video extends Component {
357
386
 
358
387
 
359
388
  } catch (err) {
389
+ if(err.status == 502 || err.status== 404) {
390
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
391
+ }
360
392
  console.error(err);
361
393
  }
362
394
  };
@@ -376,6 +408,9 @@ class Video extends Component {
376
408
 
377
409
  } catch (err) {
378
410
  console.error(err);
411
+ if(err.status == 502 || err.status== 404) {
412
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
413
+ }
379
414
  }
380
415
  };
381
416
  dataURLtoFile = (dataURI, type) => {
@@ -514,13 +549,15 @@ class Video extends Component {
514
549
  message.error({
515
550
  content: value,
516
551
  icon: <img src={require("../../assets/img/tooltips2_fail.png").default} alt="" ></img>,
517
- className: 'errorClassName'
552
+ className: 'errorClassName',
553
+ top: 200
518
554
  })
519
555
  } else if(valueOne == 'success') {
520
556
  message.success({
521
557
  content: value,
522
558
  icon: <img src={require("../../assets/img/tooltips1_pass.png").default} alt="" ></img>,
523
- className: 'successClassName'
559
+ className: 'successClassName',
560
+ top: 200
524
561
  })
525
562
  }
526
563
 
@@ -545,11 +582,7 @@ class Video extends Component {
545
582
  }
546
583
  };
547
584
  endSessionValue = () => {
548
- if(this.state.sessionType) {
549
- this.test_controller.LeaveRoom()
550
- } else {
551
585
  this.finishSession()
552
- }
553
586
 
554
587
  };
555
588
  // 画中画
@@ -575,49 +608,56 @@ class Video extends Component {
575
608
  list.push({
576
609
  name: 'video1',
577
610
  title: this.state.videoOneName,
578
- voice: 'voiceVideoOne'
611
+ voice: 'voiceVideoOne',
612
+ noVideo: this.state.noVideoOne
579
613
  })
580
614
  }
581
615
  if (document.getElementById('publish_video1').name) {
582
616
  list.push({
583
617
  name: 'publish_video1',
584
618
  title: this.props.meetingInfo.host ? this.props.meetingInfo.host : '坐席',
585
- voice: 'voiceStatue'
619
+ voice: 'voiceStatue',
620
+ noVideo: false
586
621
  })
587
622
  }
588
623
  if (document.getElementById('video2').name) {
589
624
  list.push({
590
625
  name: 'video2',
591
626
  title: this.state.videoTwoName,
592
- voice: 'voiceVideoTwo'
627
+ voice: 'voiceVideoTwo',
628
+ noVideo: this.state.noVideoTwo
593
629
  })
594
630
  }
595
631
  if (document.getElementById('video3').name) {
596
632
  list.push({
597
633
  name: 'video3',
598
634
  title: this.state.videoThreeName,
599
- voice: 'voiceVideoThree'
635
+ voice: 'voiceVideoThree',
636
+ noVideo: this.state.noVideoThree
600
637
  })
601
638
  }
602
639
  if (document.getElementById('video4').name) {
603
640
  list.push({
604
641
  name: 'video4',
605
642
  title: this.state.videoFourName,
606
- voice: 'voiceVideoFour'
643
+ voice: 'voiceVideoFour',
644
+ noVideo: this.state.noVideoFour
607
645
  })
608
646
  }
609
647
  if (document.getElementById('video5').name) {
610
648
  list.push({
611
649
  name: 'video5',
612
650
  title: this.state.videoFiveName,
613
- voice: 'voiceVideoFive'
651
+ voice: 'voiceVideoFive',
652
+ noVideo: this.state.noVideoFive
614
653
  })
615
654
  }
616
655
  if (document.getElementById('video6').name) {
617
656
  list.push({
618
657
  name: 'video6',
619
658
  title: this.state.videoSixName,
620
- voice: 'voiceVideoSix'
659
+ voice: 'voiceVideoSix',
660
+ noVideo: this.state.noVideoSix
621
661
  })
622
662
  }
623
663
 
@@ -625,42 +665,48 @@ class Video extends Component {
625
665
  list.push({
626
666
  name: 'video7',
627
667
  title: this.state.videoSevenName,
628
- voice: 'voiceVideoSeven'
668
+ voice: 'voiceVideoSeven',
669
+ noVideo: this.state.noVideoSeven
629
670
  })
630
671
  }
631
672
  if (document.getElementById('video8').name) {
632
673
  list.push({
633
674
  name: 'video8',
634
675
  title: this.state.videoEightName,
635
- voice: 'voiceVideoEight'
676
+ voice: 'voiceVideoEight',
677
+ noVideo: this.state.noVideoEight
636
678
  })
637
679
  }
638
680
  if (document.getElementById('video9').name) {
639
681
  list.push({
640
682
  name: 'video9',
641
683
  title: this.state.videoNineName,
642
- voice: 'voiceVideoNine'
684
+ voice: 'voiceVideoNine',
685
+ noVideo: this.state.noVideoNine
643
686
  })
644
687
  }
645
688
  if (document.getElementById('video10').name) {
646
689
  list.push({
647
690
  name: 'video10',
648
691
  title: this.state.videoTenName,
649
- voice: 'voiceVideoTen'
692
+ voice: 'voiceVideoTen',
693
+ noVideo: this.state.noVideoTen
650
694
  })
651
695
  }
652
696
  if (document.getElementById('video11').name) {
653
697
  list.push({
654
698
  name: 'video11',
655
699
  title: this.state.videoElevenName,
656
- voice: 'voiceVideoEleven'
700
+ voice: 'voiceVideoEleven',
701
+ noVideo: this.state.noVideoEleven
657
702
  })
658
703
  }
659
704
  if (document.getElementById('video12').name) {
660
705
  list.push({
661
706
  name: 'video12',
662
707
  title: this.state.videoTwelveName,
663
- voice: 'voiceVideoTwelve'
708
+ voice: 'voiceVideoTwelve',
709
+ noVideo: this.state.noVideoTwelve
664
710
  })
665
711
  }
666
712
  console.log(list)
@@ -672,7 +718,7 @@ class Video extends Component {
672
718
  canvas.height = height;
673
719
 
674
720
  interval = setInterval(() => {
675
- // cobj.clearRect(0, 0, width, height);
721
+ cobj.clearRect(0, 0, width, height);
676
722
  for (let i = 0; i < list.length; i++) {
677
723
 
678
724
  let videoId = list[i].name;
@@ -686,8 +732,13 @@ class Video extends Component {
686
732
  } else {
687
733
  newVideoHeight = videoHeight * 640 / videoWidth;
688
734
  }
735
+ if(list[i].noVideo){
736
+ cobj.fillStyle = '#333';
737
+ cobj.fillRect((640 - newVideoWidth) / 2, 360 * i, newVideoWidth, newVideoHeight)
738
+ } else {
739
+ cobj.drawImage(videoDiv, (640 - newVideoWidth) / 2, 360 * i, 640, 360);
689
740
 
690
- cobj.drawImage(videoDiv, (640 - newVideoWidth) / 2, 360 * i, newVideoWidth, newVideoHeight);
741
+ }
691
742
  cobj.beginPath();
692
743
  cobj.strokeStyle = this.props.titleColor;
693
744
  cobj.fillStyle = this.props.titleBackground;
@@ -833,8 +884,29 @@ class Video extends Component {
833
884
  });
834
885
  }
835
886
  roomCallBack = (type, manege,code) => {
887
+ this.setState({
888
+ loading: false,
889
+ })
836
890
  if (this.state.sessionId) {
837
- this.props.joinRoomCallback({
891
+ if(code == 'SYS-01' || code == 'SYS-02') {
892
+ this.props.joinRoomCallback({
893
+ type: type,
894
+ errorManage: manege,
895
+ errorCode: code,
896
+ data: {}
897
+ })
898
+ } else {
899
+ this.props.joinRoomCallback({
900
+ type: type,
901
+ errorManage: manege,
902
+ errorCode: 'Join-0' + code,
903
+ data: {}
904
+ })
905
+ }
906
+
907
+ } else {
908
+ if(code == 'SYS-01' || code == 'SYS-02') {
909
+ this.props.createRoomCallback({
838
910
  type: type,
839
911
  errorManage: manege,
840
912
  errorCode: code,
@@ -844,10 +916,11 @@ class Video extends Component {
844
916
  this.props.createRoomCallback({
845
917
  type: type,
846
918
  errorManage: manege,
847
- errorCode: code,
919
+ errorCode: 'Create-0' + code,
848
920
  data: {}
849
921
  })
850
922
  }
923
+ }
851
924
  }
852
925
  tabTitlesClick = (value, type) => {
853
926
  const { tabTitles } = this.state;
@@ -894,6 +967,158 @@ class Video extends Component {
894
967
  // this.endSession('customerHangUp')
895
968
  // }
896
969
  // }
970
+ else if (Mival.typeId == 3002) {
971
+ if (Mival.data.sessionId == this.state.sessionId) {
972
+ if (Mival.data.userId == this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid) {
973
+ this.setState({
974
+ noVideoOne: true
975
+ })
976
+ }
977
+ if (Mival.data.userId == (document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : '')) {
978
+
979
+ this.setState({
980
+ noVideoTwo: true
981
+ })
982
+ }
983
+ if (Mival.data.userId == (document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : '')) {
984
+ this.setState({
985
+ noVideoThree: true
986
+ })
987
+
988
+ }
989
+ if (Mival.data.userId == (document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : '')) {
990
+
991
+ this.setState({
992
+ noVideoFour: true
993
+ })
994
+ }
995
+ if (Mival.data.userId == (document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : '')) {
996
+ this.setState({
997
+ noVideoFive: true
998
+ })
999
+
1000
+ }
1001
+ if (Mival.data.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1002
+
1003
+ this.setState({
1004
+ noVideoSix: true
1005
+ })
1006
+ }
1007
+ if (Mival.data.userId == (document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : '')) {
1008
+
1009
+ this.setState({
1010
+ noVideoSeven: true
1011
+ })
1012
+ }
1013
+ if (Mival.data.userId == (document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : '')) {
1014
+ this.setState({
1015
+ noVideoEight: true
1016
+ })
1017
+
1018
+ }
1019
+ if (Mival.data.userId == (document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : '')) {
1020
+
1021
+ this.setState({
1022
+ noVideoNine: true
1023
+ })
1024
+ }
1025
+ if (Mival.data.userId == (document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : '')) {
1026
+ this.setState({
1027
+ noVideoTen: true
1028
+ })
1029
+
1030
+ }
1031
+ if (Mival.data.userId == (document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : '')) {
1032
+
1033
+ this.setState({
1034
+ noVideoEleven: true
1035
+ })
1036
+ }
1037
+ if (Mival.data.userId == (document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : '')) {
1038
+
1039
+ this.setState({
1040
+ noVideoTwelve: true
1041
+ })
1042
+ }
1043
+ this.pictureInPicture('Refresh')
1044
+ }
1045
+ }
1046
+ else if (Mival.typeId == 3003) {
1047
+ if (Mival.data.sessionId == this.state.sessionId) {
1048
+ if (Mival.data.userId == this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid) {
1049
+ this.setState({
1050
+ noVideoOne: false
1051
+ })
1052
+ }
1053
+ if (Mival.data.userId == (document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : '')) {
1054
+
1055
+ this.setState({
1056
+ noVideoTwo: false
1057
+ })
1058
+ }
1059
+ if (Mival.data.userId == (document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : '')) {
1060
+ this.setState({
1061
+ noVideoThree: false
1062
+ })
1063
+
1064
+ }
1065
+ if (Mival.data.userId == (document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : '')) {
1066
+
1067
+ this.setState({
1068
+ noVideoFour: false
1069
+ })
1070
+ }
1071
+ if (Mival.data.userId == (document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : '')) {
1072
+ this.setState({
1073
+ noVideoFive: false
1074
+ })
1075
+
1076
+ }
1077
+ if (Mival.data.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1078
+
1079
+ this.setState({
1080
+ noVideoSix: false
1081
+ })
1082
+ }
1083
+ if (Mival.data.userId == (document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : '')) {
1084
+
1085
+ this.setState({
1086
+ noVideoSeven: false
1087
+ })
1088
+ }
1089
+ if (Mival.data.userId == (document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : '')) {
1090
+ this.setState({
1091
+ noVideoEight: false
1092
+ })
1093
+
1094
+ }
1095
+ if (Mival.data.userId == (document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : '')) {
1096
+
1097
+ this.setState({
1098
+ noVideoNine: false
1099
+ })
1100
+ }
1101
+ if (Mival.data.userId == (document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : '')) {
1102
+ this.setState({
1103
+ noVideoTen: false
1104
+ })
1105
+
1106
+ }
1107
+ if (Mival.data.userId == (document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : '')) {
1108
+
1109
+ this.setState({
1110
+ noVideoEleven: false
1111
+ })
1112
+ }
1113
+ if (Mival.data.userId == (document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : '')) {
1114
+
1115
+ this.setState({
1116
+ noVideoTwelve: false
1117
+ })
1118
+ }
1119
+ this.pictureInPicture('Refresh')
1120
+ }
1121
+ }
897
1122
  else if (Mival.typeId == 1215) {
898
1123
  // 一炒多的图片
899
1124
  if (Mival.sessionId == this.state.sessionId) {
@@ -1105,7 +1330,7 @@ class Video extends Component {
1105
1330
  this.setState({
1106
1331
  sessionType: false
1107
1332
  })
1108
- this.roomCallBack(2, 'im建立连接失败',-7)
1333
+ this.roomCallBack(2, 'im建立连接失败',7)
1109
1334
  } else {
1110
1335
  this.setState({
1111
1336
  imStatus: msg
@@ -1140,7 +1365,7 @@ class Video extends Component {
1140
1365
  console.log('deviceId' + devicesInfo[i].deviceId);
1141
1366
 
1142
1367
  b.actionid = devicesInfo[i].deviceId;
1143
- b.groupId = devicesInfo[i].groupId;
1368
+ b.groupId = devicesInfo[i].groupId || 'empty';
1144
1369
  if (
1145
1370
  devicesInfo[i].label === '' ||
1146
1371
  devicesInfo[i].label === undefined ||
@@ -1154,7 +1379,7 @@ class Video extends Component {
1154
1379
  } else if (devicesInfo[i].kind === 'audioinput') {
1155
1380
  // 麦克风
1156
1381
  b.actionid = devicesInfo[i].deviceId;
1157
- b.groupId = devicesInfo[i].groupId;
1382
+ b.groupId = devicesInfo[i].groupId || 'empty';
1158
1383
  if (
1159
1384
  devicesInfo[i].label === '' ||
1160
1385
  devicesInfo[i].label === undefined ||
@@ -1168,7 +1393,7 @@ class Video extends Component {
1168
1393
  } else if (devicesInfo[i].kind === 'audiooutput') {
1169
1394
  // 喇叭
1170
1395
  b.actionid = devicesInfo[i].deviceId;
1171
- b.groupId = devicesInfo[i].groupId;
1396
+ b.groupId = devicesInfo[i].groupId || 'empty';
1172
1397
  if (
1173
1398
  devicesInfo[i].label === '' ||
1174
1399
  devicesInfo[i].label === undefined ||
@@ -1205,12 +1430,13 @@ class Video extends Component {
1205
1430
  arr2[obj2[i].groupId] = true;
1206
1431
  }
1207
1432
  }
1433
+ console.log(objList, objList1, objList2 )
1208
1434
  this.setState({
1209
1435
  cameraList: objList,
1210
1436
  microphoneList: objList1,
1211
- speakerList: [objList2[0]]
1437
+ speakerList: objList2.length>0? [objList2[0]]: []
1212
1438
  })
1213
- if (!this.state.appId && this.state.sessionType) {
1439
+ if (!this.state.appId && !this.state.sessionType) {
1214
1440
  this.mpaasSig(data);
1215
1441
  this.setState({
1216
1442
  cameraValue: obj[0].actionid,
@@ -1230,7 +1456,7 @@ class Video extends Component {
1230
1456
  sessionType: false
1231
1457
  })
1232
1458
  this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
1233
- this.roomCallBack(2, '获取设备失败',-1)
1459
+ this.roomCallBack(2, '获取设备失败',1)
1234
1460
  };
1235
1461
  // 建立连接成功
1236
1462
  this.test_controller.OnConnectOK = () => {
@@ -1242,7 +1468,7 @@ class Video extends Component {
1242
1468
  this.setState({
1243
1469
  sessionType: false
1244
1470
  })
1245
- this.roomCallBack(2, '连接失败',-2)
1471
+ this.roomCallBack(2, '连接失败',2)
1246
1472
  };
1247
1473
  // 断开连接回调
1248
1474
  this.test_controller.OnConnectClose = (code, msg) => {
@@ -1259,7 +1485,7 @@ class Video extends Component {
1259
1485
  this.setState({
1260
1486
  sessionType: false
1261
1487
  })
1262
- this.roomCallBack(2, '初始化失败',-3)
1488
+ this.roomCallBack(2, '初始化失败',3)
1263
1489
  };
1264
1490
  // 初始化成功回调
1265
1491
  this.test_controller.OnInitRoomConfigOK = () => {
@@ -1288,7 +1514,7 @@ class Video extends Component {
1288
1514
  this.setState({
1289
1515
  sessionType: false
1290
1516
  })
1291
- this.roomCallBack(2, '创建房间失败',-4)
1517
+ this.roomCallBack(2, '创建房间失败',4)
1292
1518
  };
1293
1519
  // 初始化⾳视频成功
1294
1520
  this.test_controller.OnMediaCallSucc = (sid) => {
@@ -1310,14 +1536,25 @@ class Video extends Component {
1310
1536
  // 加入房间失败
1311
1537
  this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
1312
1538
  console.log('加入房间失败', err_code, err_msg)
1539
+ // this.setState({
1540
+ // sessionType: false,
1541
+ // isJoinRoom: true
1542
+ // })
1543
+ // this.roomCallBack(2, '加入失败',-5)
1313
1544
  this.setState({
1314
- sessionType: false
1315
- })
1316
- this.roomCallBack(2, '加入失败',-5)
1545
+ channelId: '',
1546
+ rtoken: '',
1547
+ sessionId: '',
1548
+ imRoomId: ''
1549
+ });
1550
+ this.addToScript()
1317
1551
  };
1318
1552
  // 发布媒体流成功
1319
1553
  this.test_controller.OnPublishSucc = (sid) => {
1320
1554
  console.log('发布媒体流成功', sid)
1555
+ this.setState({
1556
+ sessionType: true
1557
+ })
1321
1558
  if (sid == document.getElementById('video20').name) {
1322
1559
  callNimIM('sendCustomCmdMsg', {
1323
1560
  customId: this.state.imRoomId,
@@ -1357,7 +1594,7 @@ class Video extends Component {
1357
1594
  this.setState({
1358
1595
  sessionType: false
1359
1596
  })
1360
- this.roomCallBack(2, '发布失败',-6)
1597
+ this.roomCallBack(2, '发布失败',6)
1361
1598
  };
1362
1599
  // 订阅媒体流成功
1363
1600
  this.test_controller.OnSubscribeSucc = (feed, sid) => {
@@ -1781,12 +2018,14 @@ class Video extends Component {
1781
2018
  this.setState({
1782
2019
  publishDevic: 1,
1783
2020
  isSharedScreen: false,
1784
- screenName: '投屏'
2021
+ screenName: '投屏',
2022
+ sessionType: false
1785
2023
  });
1786
2024
  this.tabTitlesClick('RMScreen', 'delect')
1787
2025
  if (this.state.isPictureInPicture) {
1788
2026
  document.exitPictureInPicture()
1789
2027
  }
2028
+
1790
2029
  }
1791
2030
  };
1792
2031
  // 取消订阅媒体流成功
@@ -1902,7 +2141,7 @@ class Video extends Component {
1902
2141
  // 退出房间回调
1903
2142
  this.test_controller.OnLeaveRoom = (leaveType) => {
1904
2143
  console.log('退出房间回调', leaveType);
1905
- this.finishSession()
2144
+
1906
2145
  };
1907
2146
  // 推送“退出房间者”给与会者
1908
2147
  this.test_controller.OnParticipantLeaveRoom = (
@@ -2223,6 +2462,9 @@ class Video extends Component {
2223
2462
 
2224
2463
  } catch (err) {
2225
2464
  console.error(err);
2465
+ if(err.status == 502 || err.status== 404) {
2466
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
2467
+ }
2226
2468
  }
2227
2469
  };
2228
2470
  finishSession = async () => {
@@ -2235,6 +2477,9 @@ class Video extends Component {
2235
2477
  tellerId: this.props.tellerAccount
2236
2478
  });
2237
2479
  } catch (err) {
2480
+ if(err.status == 502 || err.status== 404) {
2481
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
2482
+ }
2238
2483
  }
2239
2484
  }
2240
2485
  this.setState({
@@ -2243,12 +2488,18 @@ class Video extends Component {
2243
2488
  isPictureInPicture: false,
2244
2489
  imStatus: false,
2245
2490
  imJoinRoom: false,
2246
- sessionType: true
2491
+ sessionType: false
2247
2492
  });
2248
2493
  this.props.onLeaveRoom({
2249
2494
  code: LEAVE_TYPE.TELLER_EXIT,
2250
2495
  errMsg: '坐席退出'
2251
2496
  })
2497
+ if(this.state.sessionType) {
2498
+ this.test_controller.LeaveRoom()
2499
+ this.test_controller.Disconnect()
2500
+ disconnect();
2501
+ }
2502
+
2252
2503
 
2253
2504
  }
2254
2505
  getRoomStatus = async data => {
@@ -2303,7 +2554,7 @@ class Video extends Component {
2303
2554
  this.setState({
2304
2555
  sessionType: false
2305
2556
  })
2306
- this.roomCallBack(2, '创建房间失败',-4)
2557
+ this.roomCallBack(2, '加载资源失败','SYS-01')
2307
2558
 
2308
2559
 
2309
2560
  })
@@ -2353,9 +2604,6 @@ class Video extends Component {
2353
2604
  script.onload = () => {
2354
2605
  that.test_controller = new McuController();
2355
2606
  that.mountClick()
2356
- that.setState({
2357
- loading: false,
2358
- })
2359
2607
  }
2360
2608
  }
2361
2609
  } else {
@@ -2725,7 +2973,9 @@ class Video extends Component {
2725
2973
  this.messageClick('发送失败','error')
2726
2974
  }
2727
2975
  } catch (err) {
2728
-
2976
+ if(err.status == 502 || err.status== 404) {
2977
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
2978
+ }
2729
2979
  }
2730
2980
  }
2731
2981
  handleCancelInvitation = () => {
@@ -2827,7 +3077,7 @@ class Video extends Component {
2827
3077
  console.log(result)
2828
3078
  let data
2829
3079
  if (result.code == 200) {
2830
- data = result.data.userInfo ? result.data.userInfo.userName ? result.data.userInfo.userName : '' : ''
3080
+ data = result.data.username ? result.data.username : ''
2831
3081
  } else {
2832
3082
  this.messageClick('查询失败','error')
2833
3083
  }
@@ -2885,7 +3135,9 @@ class Video extends Component {
2885
3135
  }
2886
3136
  this.pictureInPicture('Refresh')
2887
3137
  } catch (err) {
2888
-
3138
+ if(err.status == 502 || err.status== 404) {
3139
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
3140
+ }
2889
3141
  }
2890
3142
  }
2891
3143
  linkClick=()=>{
@@ -2940,7 +3192,9 @@ class Video extends Component {
2940
3192
  this.messageClick('签字失败','error')
2941
3193
  }
2942
3194
  } catch (err) {
2943
-
3195
+ if(err.status == 502 || err.status== 404) {
3196
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
3197
+ }
2944
3198
  }
2945
3199
  }
2946
3200
  handleOkSign = () => {
@@ -3129,7 +3383,7 @@ class Video extends Component {
3129
3383
  margin: 'auto'
3130
3384
  };
3131
3385
  return (
3132
- <div className="all">
3386
+ <div className="all" id="allHSBC">
3133
3387
  <Spin spinning={this.state.loading} tip="视频初始化中...">
3134
3388
  <Header></Header>
3135
3389
  <div className="health">
@@ -3239,7 +3493,7 @@ class Video extends Component {
3239
3493
  id="video1"
3240
3494
  autoPlay
3241
3495
  muted={true}
3242
- className="video1"
3496
+ className={`video1 ${this.state.noVideoOne ? 'isNoVideo' : ''}`}
3243
3497
  />
3244
3498
  <audio id="audio1" autoPlay />
3245
3499
  <label style={{ display: 'none' }} id="feedId1" type="text" />
@@ -3267,7 +3521,7 @@ class Video extends Component {
3267
3521
  id="video2"
3268
3522
  autoPlay
3269
3523
  muted={true}
3270
- className="video"
3524
+ className={`video ${this.state.noVideoTwo ? 'isNoVideo' : ''}`}
3271
3525
  />
3272
3526
  <audio id="audio2" autoPlay />
3273
3527
  <label style={{ display: 'none' }} id="feedId2" type="text" />
@@ -3293,7 +3547,7 @@ class Video extends Component {
3293
3547
  id="video3"
3294
3548
  autoPlay
3295
3549
  muted={true}
3296
- className="video"
3550
+ className={`video ${this.state.noVideoThree ? 'isNoVideo' : ''}`}
3297
3551
  />
3298
3552
  <audio id="audio3" autoPlay />
3299
3553
  <label style={{ display: 'none' }} id="feedId3" type="text" />
@@ -3318,7 +3572,7 @@ class Video extends Component {
3318
3572
  id="video4"
3319
3573
  autoPlay
3320
3574
  muted={true}
3321
- className="video"
3575
+ className={`video ${this.state.noVideoFour ? 'isNoVideo' : ''}`}
3322
3576
  />
3323
3577
  <audio id="audio4" autoPlay />
3324
3578
  <label style={{ display: 'none' }} id="feedId4" type="text" />
@@ -3344,7 +3598,7 @@ class Video extends Component {
3344
3598
  id="video5"
3345
3599
  autoPlay
3346
3600
  muted={true}
3347
- className="video"
3601
+ className={`video ${this.state.noVideoFive ? 'isNoVideo' : ''}`}
3348
3602
  />
3349
3603
  <audio id="audio5" autoPlay />
3350
3604
  <label style={{ display: 'none' }} id="feedId5" type="text" />
@@ -3369,7 +3623,7 @@ class Video extends Component {
3369
3623
  id="video6"
3370
3624
  autoPlay
3371
3625
  muted={true}
3372
- className="video"
3626
+ className={`video ${this.state.noVideoSix ? 'isNoVideo' : ''}`}
3373
3627
  />
3374
3628
  <audio id="audio6" autoPlay />
3375
3629
  <label style={{ display: 'none' }} id="feedId6" type="text" />
@@ -3406,7 +3660,7 @@ class Video extends Component {
3406
3660
  id="video7"
3407
3661
  autoPlay
3408
3662
  muted={true}
3409
- className="video"
3663
+ className={`video ${this.state.noVideoSeven ? 'isNoVideo' : ''}`}
3410
3664
  />
3411
3665
  <audio id="audio7" autoPlay />
3412
3666
  <label style={{ display: 'none' }} id="feedId7" type="text" />
@@ -3434,7 +3688,7 @@ class Video extends Component {
3434
3688
  id="video8"
3435
3689
  autoPlay
3436
3690
  muted={true}
3437
- className="video"
3691
+ className={`video ${this.state.noVideoEight ? 'isNoVideo' : ''}`}
3438
3692
  />
3439
3693
  <audio id="audio8" autoPlay />
3440
3694
  <label style={{ display: 'none' }} id="feedId8" type="text" />
@@ -3459,7 +3713,7 @@ class Video extends Component {
3459
3713
  id="video9"
3460
3714
  autoPlay
3461
3715
  muted={true}
3462
- className="video"
3716
+ className={`video ${this.state.noVideoNine ? 'isNoVideo' : ''}`}
3463
3717
  />
3464
3718
  <audio id="audio9" autoPlay />
3465
3719
  <label style={{ display: 'none' }} id="feedId9" type="text" />
@@ -3486,7 +3740,7 @@ class Video extends Component {
3486
3740
  id="video10"
3487
3741
  autoPlay
3488
3742
  muted={true}
3489
- className="video"
3743
+ className={`video ${this.state.noVideoTen ? 'isNoVideo' : ''}`}
3490
3744
  />
3491
3745
  <audio id="audio10" autoPlay />
3492
3746
  <label style={{ display: 'none' }} id="feedId10" type="text" />
@@ -3511,7 +3765,7 @@ class Video extends Component {
3511
3765
  id="video11"
3512
3766
  autoPlay
3513
3767
  muted={true}
3514
- className="video"
3768
+ className={`video ${this.state.noVideoEleven ? 'isNoVideo' : ''}`}
3515
3769
  />
3516
3770
  <audio id="audio11" autoPlay />
3517
3771
  <label style={{ display: 'none' }} id="feedId11" type="text" />
@@ -3537,7 +3791,7 @@ class Video extends Component {
3537
3791
  id="video12"
3538
3792
  autoPlay
3539
3793
  muted={true}
3540
- className="video"
3794
+ className={`video ${this.state.noVideoTwelve ? 'isNoVideo' : ''}`}
3541
3795
  />
3542
3796
  <audio id="audio12" autoPlay />
3543
3797
  <label style={{ display: 'none' }} id="feedId12" type="text" />
@@ -3628,7 +3882,7 @@ class Video extends Component {
3628
3882
  <div key='invitation'>
3629
3883
  <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
3630
3884
  {
3631
- this.state.employeeName &&<Button className='modelButtonOk'type="primary" danger onClick={this.handleOkInvitation}>邮件发送会议邀请</Button>
3885
+ this.state.employeeName &&<Button className='modelButtonOkInvitation'type="primary" danger onClick={this.handleOkInvitation}>邮件发送会议邀请</Button>
3632
3886
  }
3633
3887
  {
3634
3888
  !this.state.employeeName &&<Button className='modelButtonCancelOne' type="primary" danger >邮件发送会议邀请</Button>
@@ -3689,8 +3943,14 @@ class Video extends Component {
3689
3943
  {camera}
3690
3944
  <div>麦克风设备:</div>
3691
3945
  {microphone}
3692
- <div>扬声器设备:</div>
3946
+ {
3947
+ this.state.speakerList.length > 0 &&
3948
+ <span>
3949
+ <div>扬声器设备:</div>
3693
3950
  {speaker}
3951
+ </span>
3952
+ }
3953
+
3694
3954
  </div>
3695
3955
  </Modal>
3696
3956
  <video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="0" height="0"></video>