react_hsbc_teller 0.8.1 → 0.8.5
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,6 +41,7 @@ class Video extends Component {
|
|
|
37
41
|
cancel = axios.CancelToken.source()
|
|
38
42
|
signCanvas = React.createRef();
|
|
39
43
|
state = {
|
|
44
|
+
isJoinRoom: false,
|
|
40
45
|
sessionType: false,
|
|
41
46
|
isWhiteboard: false,
|
|
42
47
|
isSelect: '',
|
|
@@ -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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
230
|
+
if(err.status == 502 || err.status== 404) {
|
|
231
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
232
|
+
} else {
|
|
233
|
+
this.roomCallBack(2, '签名失败',6)
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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建立连接失败'
|
|
1333
|
+
this.roomCallBack(2, 'im建立连接失败',5)
|
|
1109
1334
|
} else {
|
|
1110
1335
|
this.setState({
|
|
1111
1336
|
imStatus: msg
|
|
@@ -1209,7 +1434,7 @@ class Video extends Component {
|
|
|
1209
1434
|
this.setState({
|
|
1210
1435
|
cameraList: objList,
|
|
1211
1436
|
microphoneList: objList1,
|
|
1212
|
-
speakerList:
|
|
1437
|
+
speakerList: objList2.length>0? [objList2[0]]: []
|
|
1213
1438
|
})
|
|
1214
1439
|
if (!this.state.appId && !this.state.sessionType) {
|
|
1215
1440
|
this.mpaasSig(data);
|
|
@@ -1231,7 +1456,7 @@ class Video extends Component {
|
|
|
1231
1456
|
sessionType: false
|
|
1232
1457
|
})
|
|
1233
1458
|
this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头','error')
|
|
1234
|
-
this.roomCallBack(2, '获取设备失败'
|
|
1459
|
+
this.roomCallBack(2, '获取设备失败',1)
|
|
1235
1460
|
};
|
|
1236
1461
|
// 建立连接成功
|
|
1237
1462
|
this.test_controller.OnConnectOK = () => {
|
|
@@ -1243,7 +1468,7 @@ class Video extends Component {
|
|
|
1243
1468
|
this.setState({
|
|
1244
1469
|
sessionType: false
|
|
1245
1470
|
})
|
|
1246
|
-
this.roomCallBack(2, '连接失败'
|
|
1471
|
+
this.roomCallBack(2, '连接失败',2)
|
|
1247
1472
|
};
|
|
1248
1473
|
// 断开连接回调
|
|
1249
1474
|
this.test_controller.OnConnectClose = (code, msg) => {
|
|
@@ -1260,7 +1485,7 @@ class Video extends Component {
|
|
|
1260
1485
|
this.setState({
|
|
1261
1486
|
sessionType: false
|
|
1262
1487
|
})
|
|
1263
|
-
this.roomCallBack(2, '初始化失败'
|
|
1488
|
+
this.roomCallBack(2, '初始化失败',3)
|
|
1264
1489
|
};
|
|
1265
1490
|
// 初始化成功回调
|
|
1266
1491
|
this.test_controller.OnInitRoomConfigOK = () => {
|
|
@@ -1289,7 +1514,7 @@ class Video extends Component {
|
|
|
1289
1514
|
this.setState({
|
|
1290
1515
|
sessionType: false
|
|
1291
1516
|
})
|
|
1292
|
-
this.roomCallBack(2, '创建房间失败'
|
|
1517
|
+
this.roomCallBack(2, '创建房间失败',7)
|
|
1293
1518
|
};
|
|
1294
1519
|
// 初始化⾳视频成功
|
|
1295
1520
|
this.test_controller.OnMediaCallSucc = (sid) => {
|
|
@@ -1311,10 +1536,25 @@ class Video extends Component {
|
|
|
1311
1536
|
// 加入房间失败
|
|
1312
1537
|
this.test_controller.OnJoinRoomFailed = (err_code, err_msg) => {
|
|
1313
1538
|
console.log('加入房间失败', err_code, err_msg)
|
|
1539
|
+
// this.setState({
|
|
1540
|
+
// sessionType: false,
|
|
1541
|
+
// isJoinRoom: true
|
|
1542
|
+
// })
|
|
1543
|
+
// this.roomCallBack(2, '加入失败',-5)
|
|
1314
1544
|
this.setState({
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1545
|
+
channelId: '',
|
|
1546
|
+
rtoken: '',
|
|
1547
|
+
sessionId: '',
|
|
1548
|
+
imRoomId: ''
|
|
1549
|
+
});
|
|
1550
|
+
|
|
1551
|
+
this.test_controller.Disconnect()
|
|
1552
|
+
let data = {
|
|
1553
|
+
account: this.props.tellerAccount,
|
|
1554
|
+
type: '2',
|
|
1555
|
+
sigType: 1
|
|
1556
|
+
};
|
|
1557
|
+
this.mpaasSig(data);
|
|
1318
1558
|
};
|
|
1319
1559
|
// 发布媒体流成功
|
|
1320
1560
|
this.test_controller.OnPublishSucc = (sid) => {
|
|
@@ -1361,7 +1601,7 @@ class Video extends Component {
|
|
|
1361
1601
|
this.setState({
|
|
1362
1602
|
sessionType: false
|
|
1363
1603
|
})
|
|
1364
|
-
this.roomCallBack(2, '发布失败'
|
|
1604
|
+
this.roomCallBack(2, '发布失败',4)
|
|
1365
1605
|
};
|
|
1366
1606
|
// 订阅媒体流成功
|
|
1367
1607
|
this.test_controller.OnSubscribeSucc = (feed, sid) => {
|
|
@@ -1785,12 +2025,14 @@ class Video extends Component {
|
|
|
1785
2025
|
this.setState({
|
|
1786
2026
|
publishDevic: 1,
|
|
1787
2027
|
isSharedScreen: false,
|
|
1788
|
-
screenName: '投屏'
|
|
2028
|
+
screenName: '投屏',
|
|
2029
|
+
sessionType: false
|
|
1789
2030
|
});
|
|
1790
2031
|
this.tabTitlesClick('RMScreen', 'delect')
|
|
1791
2032
|
if (this.state.isPictureInPicture) {
|
|
1792
2033
|
document.exitPictureInPicture()
|
|
1793
2034
|
}
|
|
2035
|
+
|
|
1794
2036
|
}
|
|
1795
2037
|
};
|
|
1796
2038
|
// 取消订阅媒体流成功
|
|
@@ -1906,7 +2148,7 @@ class Video extends Component {
|
|
|
1906
2148
|
// 退出房间回调
|
|
1907
2149
|
this.test_controller.OnLeaveRoom = (leaveType) => {
|
|
1908
2150
|
console.log('退出房间回调', leaveType);
|
|
1909
|
-
|
|
2151
|
+
|
|
1910
2152
|
};
|
|
1911
2153
|
// 推送“退出房间者”给与会者
|
|
1912
2154
|
this.test_controller.OnParticipantLeaveRoom = (
|
|
@@ -2227,6 +2469,9 @@ class Video extends Component {
|
|
|
2227
2469
|
|
|
2228
2470
|
} catch (err) {
|
|
2229
2471
|
console.error(err);
|
|
2472
|
+
if(err.status == 502 || err.status== 404) {
|
|
2473
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
2474
|
+
}
|
|
2230
2475
|
}
|
|
2231
2476
|
};
|
|
2232
2477
|
finishSession = async () => {
|
|
@@ -2239,6 +2484,9 @@ class Video extends Component {
|
|
|
2239
2484
|
tellerId: this.props.tellerAccount
|
|
2240
2485
|
});
|
|
2241
2486
|
} catch (err) {
|
|
2487
|
+
if(err.status == 502 || err.status== 404) {
|
|
2488
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
2489
|
+
}
|
|
2242
2490
|
}
|
|
2243
2491
|
}
|
|
2244
2492
|
this.setState({
|
|
@@ -2247,12 +2495,18 @@ class Video extends Component {
|
|
|
2247
2495
|
isPictureInPicture: false,
|
|
2248
2496
|
imStatus: false,
|
|
2249
2497
|
imJoinRoom: false,
|
|
2250
|
-
sessionType:
|
|
2498
|
+
sessionType: false
|
|
2251
2499
|
});
|
|
2252
2500
|
this.props.onLeaveRoom({
|
|
2253
2501
|
code: LEAVE_TYPE.TELLER_EXIT,
|
|
2254
2502
|
errMsg: '坐席退出'
|
|
2255
2503
|
})
|
|
2504
|
+
if(this.state.sessionType) {
|
|
2505
|
+
this.test_controller.LeaveRoom()
|
|
2506
|
+
this.test_controller.Disconnect()
|
|
2507
|
+
disconnect();
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2256
2510
|
|
|
2257
2511
|
}
|
|
2258
2512
|
getRoomStatus = async data => {
|
|
@@ -2301,13 +2555,15 @@ class Video extends Component {
|
|
|
2301
2555
|
this.setState({
|
|
2302
2556
|
loading: true,
|
|
2303
2557
|
})
|
|
2558
|
+
const that = this
|
|
2304
2559
|
axios.get(this.props.resourcePath + "/beauty/beauty.js")
|
|
2305
2560
|
.then(response => this.addToScriptClick()).catch(function (error) {
|
|
2306
2561
|
console.log(error);
|
|
2307
|
-
|
|
2308
|
-
sessionType: false
|
|
2562
|
+
that.setState({
|
|
2563
|
+
sessionType: false,
|
|
2564
|
+
loading: false
|
|
2309
2565
|
})
|
|
2310
|
-
|
|
2566
|
+
that.roomCallBack(2, '加载资源失败','SYS-01')
|
|
2311
2567
|
|
|
2312
2568
|
|
|
2313
2569
|
})
|
|
@@ -2357,9 +2613,6 @@ class Video extends Component {
|
|
|
2357
2613
|
script.onload = () => {
|
|
2358
2614
|
that.test_controller = new McuController();
|
|
2359
2615
|
that.mountClick()
|
|
2360
|
-
that.setState({
|
|
2361
|
-
loading: false,
|
|
2362
|
-
})
|
|
2363
2616
|
}
|
|
2364
2617
|
}
|
|
2365
2618
|
} else {
|
|
@@ -2729,7 +2982,9 @@ class Video extends Component {
|
|
|
2729
2982
|
this.messageClick('发送失败','error')
|
|
2730
2983
|
}
|
|
2731
2984
|
} catch (err) {
|
|
2732
|
-
|
|
2985
|
+
if(err.status == 502 || err.status== 404) {
|
|
2986
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
2987
|
+
}
|
|
2733
2988
|
}
|
|
2734
2989
|
}
|
|
2735
2990
|
handleCancelInvitation = () => {
|
|
@@ -2780,6 +3035,7 @@ class Video extends Component {
|
|
|
2780
3035
|
})
|
|
2781
3036
|
}
|
|
2782
3037
|
componentWillReceiveProps(props) {
|
|
3038
|
+
console.log('componentWillReceiveProps',props)
|
|
2783
3039
|
this.setState({
|
|
2784
3040
|
channelId: props.roomId,
|
|
2785
3041
|
rtoken: props.mtoken,
|
|
@@ -2831,7 +3087,7 @@ class Video extends Component {
|
|
|
2831
3087
|
console.log(result)
|
|
2832
3088
|
let data
|
|
2833
3089
|
if (result.code == 200) {
|
|
2834
|
-
data = result.data.
|
|
3090
|
+
data = result.data.username ? result.data.username : ''
|
|
2835
3091
|
} else {
|
|
2836
3092
|
this.messageClick('查询失败','error')
|
|
2837
3093
|
}
|
|
@@ -2889,7 +3145,9 @@ class Video extends Component {
|
|
|
2889
3145
|
}
|
|
2890
3146
|
this.pictureInPicture('Refresh')
|
|
2891
3147
|
} catch (err) {
|
|
2892
|
-
|
|
3148
|
+
if(err.status == 502 || err.status== 404) {
|
|
3149
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
3150
|
+
}
|
|
2893
3151
|
}
|
|
2894
3152
|
}
|
|
2895
3153
|
linkClick=()=>{
|
|
@@ -2944,7 +3202,9 @@ class Video extends Component {
|
|
|
2944
3202
|
this.messageClick('签字失败','error')
|
|
2945
3203
|
}
|
|
2946
3204
|
} catch (err) {
|
|
2947
|
-
|
|
3205
|
+
if(err.status == 502 || err.status== 404) {
|
|
3206
|
+
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
3207
|
+
}
|
|
2948
3208
|
}
|
|
2949
3209
|
}
|
|
2950
3210
|
handleOkSign = () => {
|
|
@@ -3133,7 +3393,7 @@ class Video extends Component {
|
|
|
3133
3393
|
margin: 'auto'
|
|
3134
3394
|
};
|
|
3135
3395
|
return (
|
|
3136
|
-
<div className="all">
|
|
3396
|
+
<div className="all" id="allHSBC">
|
|
3137
3397
|
<Spin spinning={this.state.loading} tip="视频初始化中...">
|
|
3138
3398
|
<Header></Header>
|
|
3139
3399
|
<div className="health">
|
|
@@ -3243,7 +3503,7 @@ class Video extends Component {
|
|
|
3243
3503
|
id="video1"
|
|
3244
3504
|
autoPlay
|
|
3245
3505
|
muted={true}
|
|
3246
|
-
className=
|
|
3506
|
+
className={`video1 ${this.state.noVideoOne ? 'isNoVideo' : ''}`}
|
|
3247
3507
|
/>
|
|
3248
3508
|
<audio id="audio1" autoPlay />
|
|
3249
3509
|
<label style={{ display: 'none' }} id="feedId1" type="text" />
|
|
@@ -3271,7 +3531,7 @@ class Video extends Component {
|
|
|
3271
3531
|
id="video2"
|
|
3272
3532
|
autoPlay
|
|
3273
3533
|
muted={true}
|
|
3274
|
-
className=
|
|
3534
|
+
className={`video ${this.state.noVideoTwo ? 'isNoVideo' : ''}`}
|
|
3275
3535
|
/>
|
|
3276
3536
|
<audio id="audio2" autoPlay />
|
|
3277
3537
|
<label style={{ display: 'none' }} id="feedId2" type="text" />
|
|
@@ -3297,7 +3557,7 @@ class Video extends Component {
|
|
|
3297
3557
|
id="video3"
|
|
3298
3558
|
autoPlay
|
|
3299
3559
|
muted={true}
|
|
3300
|
-
className=
|
|
3560
|
+
className={`video ${this.state.noVideoThree ? 'isNoVideo' : ''}`}
|
|
3301
3561
|
/>
|
|
3302
3562
|
<audio id="audio3" autoPlay />
|
|
3303
3563
|
<label style={{ display: 'none' }} id="feedId3" type="text" />
|
|
@@ -3322,7 +3582,7 @@ class Video extends Component {
|
|
|
3322
3582
|
id="video4"
|
|
3323
3583
|
autoPlay
|
|
3324
3584
|
muted={true}
|
|
3325
|
-
className=
|
|
3585
|
+
className={`video ${this.state.noVideoFour ? 'isNoVideo' : ''}`}
|
|
3326
3586
|
/>
|
|
3327
3587
|
<audio id="audio4" autoPlay />
|
|
3328
3588
|
<label style={{ display: 'none' }} id="feedId4" type="text" />
|
|
@@ -3348,7 +3608,7 @@ class Video extends Component {
|
|
|
3348
3608
|
id="video5"
|
|
3349
3609
|
autoPlay
|
|
3350
3610
|
muted={true}
|
|
3351
|
-
className=
|
|
3611
|
+
className={`video ${this.state.noVideoFive ? 'isNoVideo' : ''}`}
|
|
3352
3612
|
/>
|
|
3353
3613
|
<audio id="audio5" autoPlay />
|
|
3354
3614
|
<label style={{ display: 'none' }} id="feedId5" type="text" />
|
|
@@ -3373,7 +3633,7 @@ class Video extends Component {
|
|
|
3373
3633
|
id="video6"
|
|
3374
3634
|
autoPlay
|
|
3375
3635
|
muted={true}
|
|
3376
|
-
className=
|
|
3636
|
+
className={`video ${this.state.noVideoSix ? 'isNoVideo' : ''}`}
|
|
3377
3637
|
/>
|
|
3378
3638
|
<audio id="audio6" autoPlay />
|
|
3379
3639
|
<label style={{ display: 'none' }} id="feedId6" type="text" />
|
|
@@ -3410,7 +3670,7 @@ class Video extends Component {
|
|
|
3410
3670
|
id="video7"
|
|
3411
3671
|
autoPlay
|
|
3412
3672
|
muted={true}
|
|
3413
|
-
className=
|
|
3673
|
+
className={`video ${this.state.noVideoSeven ? 'isNoVideo' : ''}`}
|
|
3414
3674
|
/>
|
|
3415
3675
|
<audio id="audio7" autoPlay />
|
|
3416
3676
|
<label style={{ display: 'none' }} id="feedId7" type="text" />
|
|
@@ -3438,7 +3698,7 @@ class Video extends Component {
|
|
|
3438
3698
|
id="video8"
|
|
3439
3699
|
autoPlay
|
|
3440
3700
|
muted={true}
|
|
3441
|
-
className=
|
|
3701
|
+
className={`video ${this.state.noVideoEight ? 'isNoVideo' : ''}`}
|
|
3442
3702
|
/>
|
|
3443
3703
|
<audio id="audio8" autoPlay />
|
|
3444
3704
|
<label style={{ display: 'none' }} id="feedId8" type="text" />
|
|
@@ -3463,7 +3723,7 @@ class Video extends Component {
|
|
|
3463
3723
|
id="video9"
|
|
3464
3724
|
autoPlay
|
|
3465
3725
|
muted={true}
|
|
3466
|
-
className=
|
|
3726
|
+
className={`video ${this.state.noVideoNine ? 'isNoVideo' : ''}`}
|
|
3467
3727
|
/>
|
|
3468
3728
|
<audio id="audio9" autoPlay />
|
|
3469
3729
|
<label style={{ display: 'none' }} id="feedId9" type="text" />
|
|
@@ -3490,7 +3750,7 @@ class Video extends Component {
|
|
|
3490
3750
|
id="video10"
|
|
3491
3751
|
autoPlay
|
|
3492
3752
|
muted={true}
|
|
3493
|
-
className=
|
|
3753
|
+
className={`video ${this.state.noVideoTen ? 'isNoVideo' : ''}`}
|
|
3494
3754
|
/>
|
|
3495
3755
|
<audio id="audio10" autoPlay />
|
|
3496
3756
|
<label style={{ display: 'none' }} id="feedId10" type="text" />
|
|
@@ -3515,7 +3775,7 @@ class Video extends Component {
|
|
|
3515
3775
|
id="video11"
|
|
3516
3776
|
autoPlay
|
|
3517
3777
|
muted={true}
|
|
3518
|
-
className=
|
|
3778
|
+
className={`video ${this.state.noVideoEleven ? 'isNoVideo' : ''}`}
|
|
3519
3779
|
/>
|
|
3520
3780
|
<audio id="audio11" autoPlay />
|
|
3521
3781
|
<label style={{ display: 'none' }} id="feedId11" type="text" />
|
|
@@ -3541,7 +3801,7 @@ class Video extends Component {
|
|
|
3541
3801
|
id="video12"
|
|
3542
3802
|
autoPlay
|
|
3543
3803
|
muted={true}
|
|
3544
|
-
className=
|
|
3804
|
+
className={`video ${this.state.noVideoTwelve ? 'isNoVideo' : ''}`}
|
|
3545
3805
|
/>
|
|
3546
3806
|
<audio id="audio12" autoPlay />
|
|
3547
3807
|
<label style={{ display: 'none' }} id="feedId12" type="text" />
|
|
@@ -3693,8 +3953,14 @@ class Video extends Component {
|
|
|
3693
3953
|
{camera}
|
|
3694
3954
|
<div>麦克风设备:</div>
|
|
3695
3955
|
{microphone}
|
|
3696
|
-
|
|
3956
|
+
{
|
|
3957
|
+
this.state.speakerList.length > 0 &&
|
|
3958
|
+
<span>
|
|
3959
|
+
<div>扬声器设备:</div>
|
|
3697
3960
|
{speaker}
|
|
3961
|
+
</span>
|
|
3962
|
+
}
|
|
3963
|
+
|
|
3698
3964
|
</div>
|
|
3699
3965
|
</Modal>
|
|
3700
3966
|
<video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="0" height="0"></video>
|
|
@@ -3703,6 +3969,10 @@ class Video extends Component {
|
|
|
3703
3969
|
}
|
|
3704
3970
|
}
|
|
3705
3971
|
Video.defaultProps = {
|
|
3972
|
+
mtoken: "26364ded9b83",
|
|
3973
|
+
roomId: "645157287240850",
|
|
3974
|
+
imRoomId: "Fwua8kGB6@conference.openfire2.leimondata.cn",
|
|
3975
|
+
sessionId: "Fwua8kGB6",
|
|
3706
3976
|
tellerAccount: 't001',
|
|
3707
3977
|
businessNumber: '123',
|
|
3708
3978
|
callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
|