react_hsbc_teller 0.7.6 → 0.8.0

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.
@@ -37,7 +37,7 @@ class Video extends Component {
37
37
  cancel = axios.CancelToken.source()
38
38
  signCanvas = React.createRef();
39
39
  state = {
40
- sessionType: true,
40
+ sessionType: false,
41
41
  isWhiteboard: false,
42
42
  isSelect: '',
43
43
  loading: false,
@@ -72,10 +72,10 @@ class Video extends Component {
72
72
  workSpaceId: '',
73
73
  bizName: '',
74
74
  appId: '',
75
- channelId: this.props.roomId,
76
- rtoken: this.props.mtoken,
77
- sessionId: this.props.sessionId,
78
- imRoomId: this.props.imRoomId,
75
+ channelId: '',
76
+ rtoken: '',
77
+ sessionId: '',
78
+ imRoomId: '',
79
79
  isPictureInPicture: false,
80
80
  clickedFacial: false,
81
81
  clickedOcr: false,
@@ -553,274 +553,285 @@ class Video extends Component {
553
553
 
554
554
  };
555
555
  // 画中画
556
- pictureInPicture = () => {
557
- let interval
556
+ pictureInPicture = (val) => {
558
557
  if (this.isFileSuccuse()) {
559
558
  if (this.state.isPictureInPicture) {
560
- document.exitPictureInPicture()
561
- } else {
562
- const list = []
563
- if (document.getElementById('video1').name) {
564
- list.push({
565
- name: 'video1',
566
- title: this.state.videoOneName,
567
- voice: 'voiceVideoOne'
568
- })
569
- }
570
- if (document.getElementById('publish_video1').name) {
571
- list.push({
572
- name: 'publish_video1',
573
- title: this.props.meetingInfo.host ? this.props.meetingInfo.host : '坐席',
574
- voice: 'voiceStatue'
575
- })
576
- }
577
- if (document.getElementById('video2').name) {
578
- list.push({
579
- name: 'video2',
580
- title: this.state.videoTwoName,
581
- voice: 'voiceVideoTwo'
582
- })
583
- }
584
- if (document.getElementById('video3').name) {
585
- list.push({
586
- name: 'video3',
587
- title: this.state.videoThreeName,
588
- voice: 'voiceVideoThree'
589
- })
590
- }
591
- if (document.getElementById('video4').name) {
592
- list.push({
593
- name: 'video4',
594
- title: this.state.videoFourName,
595
- voice: 'voiceVideoFour'
596
- })
597
- }
598
- if (document.getElementById('video5').name) {
599
- list.push({
600
- name: 'video5',
601
- title: this.state.videoFiveName,
602
- voice: 'voiceVideoFive'
603
- })
559
+ if(!val) {
560
+ document.exitPictureInPicture()
561
+ } else {
562
+ this.pictureInPictureClick()
604
563
  }
605
- if (document.getElementById('video6').name) {
606
- list.push({
607
- name: 'video6',
608
- title: this.state.videoSixName,
609
- voice: 'voiceVideoSix'
610
- })
564
+ } else {
565
+ if(!val) {
566
+ this.pictureInPictureClick()
611
567
  }
568
+ }
569
+ }
570
+ };
571
+ pictureInPictureClick=()=>{
572
+ let interval
573
+ const list = []
574
+ if (document.getElementById('video1').name) {
575
+ list.push({
576
+ name: 'video1',
577
+ title: this.state.videoOneName,
578
+ voice: 'voiceVideoOne'
579
+ })
580
+ }
581
+ if (document.getElementById('publish_video1').name) {
582
+ list.push({
583
+ name: 'publish_video1',
584
+ title: this.props.meetingInfo.host ? this.props.meetingInfo.host : '坐席',
585
+ voice: 'voiceStatue'
586
+ })
587
+ }
588
+ if (document.getElementById('video2').name) {
589
+ list.push({
590
+ name: 'video2',
591
+ title: this.state.videoTwoName,
592
+ voice: 'voiceVideoTwo'
593
+ })
594
+ }
595
+ if (document.getElementById('video3').name) {
596
+ list.push({
597
+ name: 'video3',
598
+ title: this.state.videoThreeName,
599
+ voice: 'voiceVideoThree'
600
+ })
601
+ }
602
+ if (document.getElementById('video4').name) {
603
+ list.push({
604
+ name: 'video4',
605
+ title: this.state.videoFourName,
606
+ voice: 'voiceVideoFour'
607
+ })
608
+ }
609
+ if (document.getElementById('video5').name) {
610
+ list.push({
611
+ name: 'video5',
612
+ title: this.state.videoFiveName,
613
+ voice: 'voiceVideoFive'
614
+ })
615
+ }
616
+ if (document.getElementById('video6').name) {
617
+ list.push({
618
+ name: 'video6',
619
+ title: this.state.videoSixName,
620
+ voice: 'voiceVideoSix'
621
+ })
622
+ }
612
623
 
613
- if (document.getElementById('video7').name) {
614
- list.push({
615
- name: 'video7',
616
- title: this.state.videoSevenName,
617
- voice: 'voiceVideoSeven'
618
- })
619
- }
620
- if (document.getElementById('video8').name) {
621
- list.push({
622
- name: 'video8',
623
- title: this.state.videoEightName,
624
- voice: 'voiceVideoEight'
625
- })
626
- }
627
- if (document.getElementById('video9').name) {
628
- list.push({
629
- name: 'video9',
630
- title: this.state.videoNineName,
631
- voice: 'voiceVideoNine'
632
- })
633
- }
634
- if (document.getElementById('video10').name) {
635
- list.push({
636
- name: 'video10',
637
- title: this.state.videoTenName,
638
- voice: 'voiceVideoTen'
639
- })
640
- }
641
- if (document.getElementById('video11').name) {
642
- list.push({
643
- name: 'video11',
644
- title: this.state.videoElevenName,
645
- voice: 'voiceVideoEleven'
646
- })
647
- }
648
- if (document.getElementById('video12').name) {
649
- list.push({
650
- name: 'video12',
651
- title: this.state.videoTwelveName,
652
- voice: 'voiceVideoTwelve'
653
- })
624
+ if (document.getElementById('video7').name) {
625
+ list.push({
626
+ name: 'video7',
627
+ title: this.state.videoSevenName,
628
+ voice: 'voiceVideoSeven'
629
+ })
630
+ }
631
+ if (document.getElementById('video8').name) {
632
+ list.push({
633
+ name: 'video8',
634
+ title: this.state.videoEightName,
635
+ voice: 'voiceVideoEight'
636
+ })
637
+ }
638
+ if (document.getElementById('video9').name) {
639
+ list.push({
640
+ name: 'video9',
641
+ title: this.state.videoNineName,
642
+ voice: 'voiceVideoNine'
643
+ })
644
+ }
645
+ if (document.getElementById('video10').name) {
646
+ list.push({
647
+ name: 'video10',
648
+ title: this.state.videoTenName,
649
+ voice: 'voiceVideoTen'
650
+ })
651
+ }
652
+ if (document.getElementById('video11').name) {
653
+ list.push({
654
+ name: 'video11',
655
+ title: this.state.videoElevenName,
656
+ voice: 'voiceVideoEleven'
657
+ })
658
+ }
659
+ if (document.getElementById('video12').name) {
660
+ list.push({
661
+ name: 'video12',
662
+ title: this.state.videoTwelveName,
663
+ voice: 'voiceVideoTwelve'
664
+ })
665
+ }
666
+ console.log(list)
667
+ const width = 640;
668
+ const height = 360 * list.length;
669
+ const canvas = document.createElement('canvas');
670
+ const cobj = canvas.getContext('2d'); // 获取绘图环境
671
+ canvas.width = width;
672
+ canvas.height = height;
673
+
674
+ interval = setInterval(() => {
675
+ // cobj.clearRect(0, 0, width, height);
676
+ for (let i = 0; i < list.length; i++) {
677
+
678
+ let videoId = list[i].name;
679
+ let videoDiv = document.getElementById(videoId);
680
+ let videoWidth = videoDiv.videoWidth;
681
+ let videoHeight = videoDiv.videoHeight;
682
+ let newVideoWidth = 640;
683
+ let newVideoHeight = 360;
684
+ if (videoHeight * 640 / videoWidth > 360) {
685
+ newVideoWidth = videoWidth * 360 / videoHeight;
686
+ } else {
687
+ newVideoHeight = videoHeight * 640 / videoWidth;
654
688
  }
655
- console.log(list)
656
- const width = 640;
657
- const height = 360 * list.length;
658
- const canvas = document.createElement('canvas');
659
- const cobj = canvas.getContext('2d'); // 获取绘图环境
660
- canvas.width = width;
661
- canvas.height = height;
662
-
663
- interval = setInterval(() => {
664
- // cobj.clearRect(0, 0, width, height);
665
- for (let i = 0; i < list.length; i++) {
666
-
667
- let videoId = list[i].name;
668
- let videoDiv = document.getElementById(videoId);
669
- let videoWidth = videoDiv.videoWidth;
670
- let videoHeight = videoDiv.videoHeight;
671
- let newVideoWidth = 640;
672
- let newVideoHeight = 360;
673
- if (videoHeight * 640 / videoWidth > 360) {
674
- newVideoWidth = videoWidth * 360 / videoHeight;
675
- } else {
676
- newVideoHeight = videoHeight * 640 / videoWidth;
677
- }
678
689
 
679
- cobj.drawImage(videoDiv, (640 - newVideoWidth) / 2, 360 * i, newVideoWidth, newVideoHeight);
680
- cobj.beginPath();
681
- cobj.strokeStyle = this.props.titleColor;
682
- cobj.fillStyle = this.props.titleBackground;
683
- cobj.fillRect(0, 360 * (i + 1) - 60, 300, 60)
684
- cobj.fill();
685
- cobj.stroke();
686
- cobj.beginPath();
687
- cobj.font = "28px auto";
688
- cobj.textAlign = 'left';
689
- cobj.lineWidth = 1;
690
- // 文字
691
- let str = list[i].title
692
- for (let k = 0; k < str.length; k++){
693
- // console.log(str.substring(0,k+1))
694
- // console.log(cobj.measureText(str.substring(0,k+1)).width)
695
- if (cobj.measureText(str.substring(0,k+1)).width>210){
696
- str = str.substring(0,k-2)
697
- str += '...'
698
- break;
699
- }
700
- }
701
- cobj.strokeText(str, 70, 360 * (i + 1) - 20);
702
- cobj.stroke();
703
- //左边框
704
- cobj.beginPath();
705
- cobj.moveTo(0, 0);
706
- cobj.lineTo(0, 360 * list.length);
707
- cobj.closePath(); //闭合路径
708
- cobj.lineWidth = 5; //线的边框为10像素
709
- cobj.strokeStyle = '#d9363e';
710
- cobj.stroke(); //绘制定义的图形
711
-
712
- //下边框
713
- cobj.beginPath();
714
- cobj.moveTo(0, 0);
715
- cobj.lineTo(640, 0);
716
- cobj.closePath(); //闭合路径
717
- cobj.lineWidth = 5; //线的边框为10像素
718
- cobj.strokeStyle = '#d9363e';
719
- cobj.stroke(); //绘制定义的图形
720
-
721
- //右边框
722
- cobj.beginPath();
723
- cobj.moveTo(640, 360 * list.length);
724
- cobj.lineTo(640, 0);
725
- cobj.closePath(); //闭合路径
726
- cobj.lineWidth = 5; //线的边框为10像素
727
- cobj.strokeStyle = '#d9363e';
728
- cobj.stroke(); //绘制定义的图形
729
-
730
-
731
- //上边框
732
- cobj.beginPath();
733
- cobj.moveTo(0, 360 * list.length);
734
- cobj.lineTo(640, 360 * list.length);
735
- cobj.closePath(); //闭合路径
736
- cobj.lineWidth = 5; //线的边框为10像素
737
- cobj.strokeStyle = '#d9363e';
738
- cobj.stroke(); //绘制定义的图形
739
-
740
- // 绘制话筒图标
741
- let microphoneSize = 50
742
- var img = document.getElementById("icon_huatong");
743
- var img1 = document.getElementById("icon_huatong_close");
744
- if(this.state[list[i].voice]) {
745
- cobj.drawImage(img1, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
746
- } else {
747
- cobj.drawImage(img, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
748
-
749
- // 绘制实时音量
750
- let sid = document.getElementById(list[i].name).name
751
- let analyser = this.state.analyserData.get(sid)
752
- aou(analyser)
753
- // let sid = document.getElementById(list[i].name).name
754
- // let stream = this.test_controller.GetMediaInfo(sid).audio_
755
- // let acc = new AudioContext()
756
- // let mic = acc.createMediaStreamSource(stream)
757
- // let analyser = acc.createAnalyser()
758
- // analyser.fftSize = 256
759
- // mic.connect(analyser)
760
- // aou(analyser)
761
- // let microphoneSize = 50
762
- // var img = document.getElementById("icon_huatong");
763
- // cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
764
- function aou(analyser){
765
- let dataArray = new Uint8Array(analyser.frequencyBinCount);
766
- analyser.getByteFrequencyData(dataArray);
767
- let step = Math.round(dataArray.length / 60); //采样步长
768
- // 以画布左上角为坐标原点
769
- let drawArea = {
770
- x1: 28/50 * microphoneSize + 10, // 波动范围右下角的点坐标
771
- y1: 25/50 * microphoneSize + 360 * (i + 1) - 60,
772
- x2: 22/50 * microphoneSize + 10, // 波动范围左上角的点坐标
773
- y2: 10/50 * microphoneSize + 360 * (i + 1) - 60,
690
+ cobj.drawImage(videoDiv, (640 - newVideoWidth) / 2, 360 * i, newVideoWidth, newVideoHeight);
691
+ cobj.beginPath();
692
+ cobj.strokeStyle = this.props.titleColor;
693
+ cobj.fillStyle = this.props.titleBackground;
694
+ cobj.fillRect(0, 360 * (i + 1) - 60, 300, 60)
695
+ cobj.fill();
696
+ cobj.stroke();
697
+ cobj.beginPath();
698
+ cobj.font = "28px auto";
699
+ cobj.textAlign = 'left';
700
+ cobj.lineWidth = 1;
701
+ // 文字
702
+ let str = list[i].title
703
+ for (let k = 0; k < str.length; k++){
704
+ // console.log(str.substring(0,k+1))
705
+ // console.log(cobj.measureText(str.substring(0,k+1)).width)
706
+ if (cobj.measureText(str.substring(0,k+1)).width>210){
707
+ str = str.substring(0,k-2)
708
+ str += '...'
709
+ break;
774
710
  }
775
-
776
-
777
- for (var j = 0; j < 40; j++) {
778
- let energy = (dataArray[step * j] / 256.0) * 80;
779
- cobj.beginPath();
780
- cobj.fillStyle = "#0AE544";
781
- const { x1,y1,x2,y2} = drawArea
782
- let width = x1-x2;
783
- let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
784
- let startX = x2 // 绘制起始点x
785
- let startY = y1 - height // 绘制起始点y
786
- cobj.fillRect(startX, startY, width, height )
787
- }
788
- requestAnimationFrame(aou.bind(this, analyser));
789
-
790
- }
711
+ }
712
+ cobj.strokeText(str, 70, 360 * (i + 1) - 20);
713
+ cobj.stroke();
714
+ //左边框
715
+ cobj.beginPath();
716
+ cobj.moveTo(0, 0);
717
+ cobj.lineTo(0, 360 * list.length);
718
+ cobj.closePath(); //闭合路径
719
+ cobj.lineWidth = 5; //线的边框为10像素
720
+ cobj.strokeStyle = '#d9363e';
721
+ cobj.stroke(); //绘制定义的图形
722
+
723
+ //下边框
724
+ cobj.beginPath();
725
+ cobj.moveTo(0, 0);
726
+ cobj.lineTo(640, 0);
727
+ cobj.closePath(); //闭合路径
728
+ cobj.lineWidth = 5; //线的边框为10像素
729
+ cobj.strokeStyle = '#d9363e';
730
+ cobj.stroke(); //绘制定义的图形
731
+
732
+ //右边框
733
+ cobj.beginPath();
734
+ cobj.moveTo(640, 360 * list.length);
735
+ cobj.lineTo(640, 0);
736
+ cobj.closePath(); //闭合路径
737
+ cobj.lineWidth = 5; //线的边框为10像素
738
+ cobj.strokeStyle = '#d9363e';
739
+ cobj.stroke(); //绘制定义的图形
740
+
741
+
742
+ //上边框
743
+ cobj.beginPath();
744
+ cobj.moveTo(0, 360 * list.length);
745
+ cobj.lineTo(640, 360 * list.length);
746
+ cobj.closePath(); //闭合路径
747
+ cobj.lineWidth = 5; //线的边框为10像素
748
+ cobj.strokeStyle = '#d9363e';
749
+ cobj.stroke(); //绘制定义的图形
750
+
751
+ // 绘制话筒图标
752
+ let microphoneSize = 50
753
+ var img = document.getElementById("icon_huatong");
754
+ var img1 = document.getElementById("icon_huatong_close");
755
+ if(this.state[list[i].voice]) {
756
+ cobj.drawImage(img1, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
757
+ } else {
758
+ cobj.drawImage(img, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
759
+
760
+ // 绘制实时音量
761
+ let sid = document.getElementById(list[i].name).name
762
+ let analyser = this.state.analyserData.get(sid)
763
+ aou(analyser)
764
+ // let sid = document.getElementById(list[i].name).name
765
+ // let stream = this.test_controller.GetMediaInfo(sid).audio_
766
+ // let acc = new AudioContext()
767
+ // let mic = acc.createMediaStreamSource(stream)
768
+ // let analyser = acc.createAnalyser()
769
+ // analyser.fftSize = 256
770
+ // mic.connect(analyser)
771
+ // aou(analyser)
772
+ // let microphoneSize = 50
773
+ // var img = document.getElementById("icon_huatong");
774
+ // cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
775
+ function aou(analyser){
776
+ if(analyser) {
777
+ let dataArray = new Uint8Array(analyser.frequencyBinCount);
778
+ analyser.getByteFrequencyData(dataArray);
779
+ let step = Math.round(dataArray.length / 60); //采样步长
780
+ // 以画布左上角为坐标原点
781
+ let drawArea = {
782
+ x1: 28/50 * microphoneSize + 10, // 波动范围右下角的点坐标
783
+ y1: 25/50 * microphoneSize + 360 * (i + 1) - 60,
784
+ x2: 22/50 * microphoneSize + 10, // 波动范围左上角的点坐标
785
+ y2: 10/50 * microphoneSize + 360 * (i + 1) - 60,
791
786
  }
792
787
 
788
+
789
+ for (var j = 0; j < 40; j++) {
790
+ let energy = (dataArray[step * j] / 256.0) * 80;
791
+ cobj.beginPath();
792
+ cobj.fillStyle = "#0AE544";
793
+ const { x1,y1,x2,y2} = drawArea
794
+ let width = x1-x2;
795
+ let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
796
+ let startX = x2 // 绘制起始点x
797
+ let startY = y1 - height // 绘制起始点y
798
+ cobj.fillRect(startX, startY, width, height )
799
+ }
800
+ requestAnimationFrame(aou.bind(this, analyser));
793
801
  }
794
- }, 100);
795
- const captureStream = canvas.captureStream();
796
- const mix_stream = new MediaStream(captureStream);
797
- pictureInPictureVideo = document.getElementById('mixedvideo');
798
- pictureInPictureVideo.srcObject = mix_stream;
799
- pictureInPictureVideo.onloadedmetadata = () => {
800
- pictureInPictureVideo.requestPictureInPicture();
801
- };
802
- }
803
802
 
804
803
 
805
- pictureInPictureVideo.addEventListener('enterpictureinpicture', (event) => {
806
- //可获取画中画窗口的一些数据,如宽高等
807
- pictureInPictureVideo.style.display = 'block';
808
- pictureInPictureVideo.play();
809
- this.setState({
810
- isPictureInPicture: true
811
- })
812
- });
804
+ }
805
+ }
806
+
807
+ }
808
+ }, 100);
809
+ const captureStream = canvas.captureStream();
810
+ const mix_stream = new MediaStream(captureStream);
811
+ pictureInPictureVideo = document.getElementById('mixedvideo');
812
+ pictureInPictureVideo.srcObject = mix_stream;
813
+ pictureInPictureVideo.onloadedmetadata = () => {
814
+ pictureInPictureVideo.requestPictureInPicture();
815
+ };
813
816
 
814
- pictureInPictureVideo.addEventListener('leavepictureinpicture', (event) => {
815
- pictureInPictureVideo.srcObject = null;
816
- pictureInPictureVideo.style.display = "none";
817
- clearInterval(interval);
818
- this.setState({
819
- isPictureInPicture: false
820
- })
821
- });
822
- }
823
- };
817
+ pictureInPictureVideo.addEventListener('enterpictureinpicture', (event) => {
818
+ //可获取画中画窗口的一些数据,如宽高等
819
+ pictureInPictureVideo.style.display = 'block';
820
+ pictureInPictureVideo.play();
821
+ this.setState({
822
+ isPictureInPicture: true
823
+ })
824
+ });
825
+
826
+ pictureInPictureVideo.addEventListener('leavepictureinpicture', (event) => {
827
+ pictureInPictureVideo.srcObject = null;
828
+ pictureInPictureVideo.style.display = "none";
829
+ clearInterval(interval);
830
+ this.setState({
831
+ isPictureInPicture: false
832
+ })
833
+ });
834
+ }
824
835
  roomCallBack = (type, manege,code) => {
825
836
  if (this.state.sessionId) {
826
837
  this.props.joinRoomCallback({
@@ -1129,7 +1140,7 @@ class Video extends Component {
1129
1140
  console.log('deviceId' + devicesInfo[i].deviceId);
1130
1141
 
1131
1142
  b.actionid = devicesInfo[i].deviceId;
1132
- b.groupId = devicesInfo[i].groupId;
1143
+ b.groupId = devicesInfo[i].groupId || 'empty';
1133
1144
  if (
1134
1145
  devicesInfo[i].label === '' ||
1135
1146
  devicesInfo[i].label === undefined ||
@@ -1143,7 +1154,7 @@ class Video extends Component {
1143
1154
  } else if (devicesInfo[i].kind === 'audioinput') {
1144
1155
  // 麦克风
1145
1156
  b.actionid = devicesInfo[i].deviceId;
1146
- b.groupId = devicesInfo[i].groupId;
1157
+ b.groupId = devicesInfo[i].groupId || 'empty';
1147
1158
  if (
1148
1159
  devicesInfo[i].label === '' ||
1149
1160
  devicesInfo[i].label === undefined ||
@@ -1157,7 +1168,7 @@ class Video extends Component {
1157
1168
  } else if (devicesInfo[i].kind === 'audiooutput') {
1158
1169
  // 喇叭
1159
1170
  b.actionid = devicesInfo[i].deviceId;
1160
- b.groupId = devicesInfo[i].groupId;
1171
+ b.groupId = devicesInfo[i].groupId || 'empty';
1161
1172
  if (
1162
1173
  devicesInfo[i].label === '' ||
1163
1174
  devicesInfo[i].label === undefined ||
@@ -1194,10 +1205,11 @@ class Video extends Component {
1194
1205
  arr2[obj2[i].groupId] = true;
1195
1206
  }
1196
1207
  }
1208
+ console.log(objList, objList1, objList2 )
1197
1209
  this.setState({
1198
1210
  cameraList: objList,
1199
1211
  microphoneList: objList1,
1200
- speakerList: [objList2[0]]
1212
+ speakerList: [objList2.length>0? objList2[0]: []]
1201
1213
  })
1202
1214
  if (!this.state.appId && this.state.sessionType) {
1203
1215
  this.mpaasSig(data);
@@ -1307,6 +1319,9 @@ class Video extends Component {
1307
1319
  // 发布媒体流成功
1308
1320
  this.test_controller.OnPublishSucc = (sid) => {
1309
1321
  console.log('发布媒体流成功', sid)
1322
+ this.setState({
1323
+ sessionType: true
1324
+ })
1310
1325
  if (sid == document.getElementById('video20').name) {
1311
1326
  callNimIM('sendCustomCmdMsg', {
1312
1327
  customId: this.state.imRoomId,
@@ -1321,12 +1336,12 @@ class Video extends Component {
1321
1336
  if(sid == document.getElementById('publish_video1').name) {
1322
1337
  this.timer = setInterval(
1323
1338
  () => {
1324
- console.log('hhhhhh',this.state.analyserHeight.get(sid))
1325
- if(this.state.analyserHeight.get(sid) > 0 && !this.state.voiceStatue) {
1339
+ if(!this.state.voiceStatue) {
1326
1340
  callNimIM('sendCustomCmdMsg', {
1327
1341
  customId: this.state.imRoomId,
1328
1342
  content: JSON.stringify({
1329
1343
  'typeId': 3200,
1344
+ 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1330
1345
  "data": {
1331
1346
  'sessionId': this.state.sessionId,
1332
1347
  'userId': this.props.tellerAccount
@@ -1336,7 +1351,7 @@ class Video extends Component {
1336
1351
  });
1337
1352
  }
1338
1353
  },
1339
- 3000
1354
+ 1000
1340
1355
  );
1341
1356
  }
1342
1357
  };
@@ -1861,6 +1876,8 @@ class Video extends Component {
1861
1876
  voiceVideoTwelve: false
1862
1877
  })
1863
1878
  }
1879
+ this.state.analyserData.delete(sid)
1880
+ this.pictureInPicture('Refresh')
1864
1881
  };
1865
1882
  // 推送“取消发布”给与会者
1866
1883
  this.test_controller.OnUnPublish = (feed) => {
@@ -2167,10 +2184,13 @@ class Video extends Component {
2167
2184
  let startX = x2 // 绘制起始点x
2168
2185
  let startY = y1 - height // 绘制起始点y
2169
2186
  ctx.fillRect(startX, startY, width, height)
2170
- this.state.analyserHeight.set(sid,startY)
2171
- this.setState({
2172
- analyserHeight: this.state.analyserHeight
2173
- })
2187
+ if(document.getElementById('publish_video1').name == sid) {
2188
+ this.state.analyserHeight.set(sid,energy/80)
2189
+ this.setState({
2190
+ analyserHeight: this.state.analyserHeight
2191
+ })
2192
+ }
2193
+
2174
2194
  }
2175
2195
  requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
2176
2196
 
@@ -2243,18 +2263,38 @@ class Video extends Component {
2243
2263
  if (result.code == 200 && result.data.roomStatus == 1) {
2244
2264
  this.addToScript()
2245
2265
  } else {
2246
- this.messageClick('当前房间状态异常','error')
2247
- this.props.onLeaveRoom({
2248
- code: LEAVE_TYPE.ROOM_DESTROYED,
2249
- errMsg: '当前房间状态异常'
2250
- })
2266
+ this.setState({
2267
+ channelId: '',
2268
+ rtoken: '',
2269
+ sessionId: '',
2270
+ imRoomId: ''
2271
+ });
2272
+ this.addToScript()
2273
+ // this.setState({
2274
+ // sessionType: false
2275
+ // })
2276
+ // this.messageClick('当前房间状态异常','error')
2277
+ // this.props.onLeaveRoom({
2278
+ // code: LEAVE_TYPE.ROOM_DESTROYED,
2279
+ // errMsg: '当前房间状态异常'
2280
+ // })
2251
2281
  }
2252
2282
  } catch (err) {
2253
- this.messageClick('当前房间状态异常','error')
2254
- this.props.onLeaveRoom({
2255
- code: LEAVE_TYPE.ROOM_DESTROYED,
2256
- errMsg: '当前房间状态异常'
2257
- })
2283
+ this.setState({
2284
+ channelId: '',
2285
+ rtoken: '',
2286
+ sessionId: '',
2287
+ imRoomId: ''
2288
+ });
2289
+ this.addToScript()
2290
+ // this.setState({
2291
+ // sessionType: false
2292
+ // })
2293
+ // this.messageClick('当前房间状态异常','error')
2294
+ // this.props.onLeaveRoom({
2295
+ // code: LEAVE_TYPE.ROOM_DESTROYED,
2296
+ // errMsg: '当前房间状态异常'
2297
+ // })
2258
2298
  }
2259
2299
  }
2260
2300
  addToScript = () => {
@@ -2847,6 +2887,7 @@ class Video extends Component {
2847
2887
  videoTwelveName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' : data ? data : '客户12'
2848
2888
  })
2849
2889
  }
2890
+ this.pictureInPicture('Refresh')
2850
2891
  } catch (err) {
2851
2892
 
2852
2893
  }
@@ -3591,10 +3632,10 @@ class Video extends Component {
3591
3632
  <div key='invitation'>
3592
3633
  <Button className="modelButtonCancel" onClick={this.handleCancelInvitation}>取消</Button>
3593
3634
  {
3594
- this.state.employeeName &&<Button className='modelButtonOk'type="primary" danger onClick={this.handleOkInvitation}>发送邮件</Button>
3635
+ this.state.employeeName &&<Button className='modelButtonOk'type="primary" danger onClick={this.handleOkInvitation}>邮件发送会议邀请</Button>
3595
3636
  }
3596
3637
  {
3597
- !this.state.employeeName &&<Button className='modelButtonCancelOne' type="primary" danger >发送邮件</Button>
3638
+ !this.state.employeeName &&<Button className='modelButtonCancelOne' type="primary" danger >邮件发送会议邀请</Button>
3598
3639
  }
3599
3640
  </div>
3600
3641
  ]}>
@@ -3609,7 +3650,7 @@ class Video extends Component {
3609
3650
  </div>
3610
3651
  {
3611
3652
  this.state.employeeName &&<div className='invitationDiv'>
3612
- <span className="modalSpan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><Button className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制链接</Button>
3653
+ <span className="modalSpan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><Button className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制会议链接</Button>
3613
3654
  </div>
3614
3655
  }
3615
3656
 
@@ -3680,9 +3721,9 @@ Video.defaultProps = {
3680
3721
  menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
3681
3722
  customLeaveRoom: '客户离开房间',
3682
3723
  meetingInfo: {
3683
- title: '测试',
3684
- host: 'wmz',
3685
- customers: ['王三', '张思']
3724
+ title: '--',
3725
+ host: '--',
3726
+ customers: ['--']
3686
3727
  }
3687
3728
  }
3688
3729
  export default Video