react_hsbc_teller 0.7.6 → 0.7.7
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.
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/pages/video/video.jsx +288 -264
package/package.json
CHANGED
|
@@ -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
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
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
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
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,
|
|
774
|
-
}
|
|
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 )
|
|
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;
|
|
787
710
|
}
|
|
788
|
-
|
|
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
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
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
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
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({
|
|
@@ -1321,12 +1332,13 @@ class Video extends Component {
|
|
|
1321
1332
|
if(sid == document.getElementById('publish_video1').name) {
|
|
1322
1333
|
this.timer = setInterval(
|
|
1323
1334
|
() => {
|
|
1324
|
-
console.log('hhhhhh',this.state.analyserHeight.get(sid))
|
|
1325
|
-
if(
|
|
1335
|
+
console.log('hhhhhh',this.state.analyserHeight.get(sid),this.state.analyserHeight.get(sid).toFixed(2))
|
|
1336
|
+
if(!this.state.voiceStatue) {
|
|
1326
1337
|
callNimIM('sendCustomCmdMsg', {
|
|
1327
1338
|
customId: this.state.imRoomId,
|
|
1328
1339
|
content: JSON.stringify({
|
|
1329
1340
|
'typeId': 3200,
|
|
1341
|
+
'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
|
|
1330
1342
|
"data": {
|
|
1331
1343
|
'sessionId': this.state.sessionId,
|
|
1332
1344
|
'userId': this.props.tellerAccount
|
|
@@ -1336,7 +1348,7 @@ class Video extends Component {
|
|
|
1336
1348
|
});
|
|
1337
1349
|
}
|
|
1338
1350
|
},
|
|
1339
|
-
|
|
1351
|
+
1000
|
|
1340
1352
|
);
|
|
1341
1353
|
}
|
|
1342
1354
|
};
|
|
@@ -1861,6 +1873,8 @@ class Video extends Component {
|
|
|
1861
1873
|
voiceVideoTwelve: false
|
|
1862
1874
|
})
|
|
1863
1875
|
}
|
|
1876
|
+
this.state.analyserData.delete(sid)
|
|
1877
|
+
this.pictureInPicture('Refresh')
|
|
1864
1878
|
};
|
|
1865
1879
|
// 推送“取消发布”给与会者
|
|
1866
1880
|
this.test_controller.OnUnPublish = (feed) => {
|
|
@@ -2167,10 +2181,13 @@ class Video extends Component {
|
|
|
2167
2181
|
let startX = x2 // 绘制起始点x
|
|
2168
2182
|
let startY = y1 - height // 绘制起始点y
|
|
2169
2183
|
ctx.fillRect(startX, startY, width, height)
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2184
|
+
if(document.getElementById('publish_video1').name == sid) {
|
|
2185
|
+
this.state.analyserHeight.set(sid,energy/80)
|
|
2186
|
+
this.setState({
|
|
2187
|
+
analyserHeight: this.state.analyserHeight
|
|
2188
|
+
})
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2174
2191
|
}
|
|
2175
2192
|
requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
|
|
2176
2193
|
|
|
@@ -2243,6 +2260,9 @@ class Video extends Component {
|
|
|
2243
2260
|
if (result.code == 200 && result.data.roomStatus == 1) {
|
|
2244
2261
|
this.addToScript()
|
|
2245
2262
|
} else {
|
|
2263
|
+
this.setState({
|
|
2264
|
+
sessionType: false
|
|
2265
|
+
})
|
|
2246
2266
|
this.messageClick('当前房间状态异常','error')
|
|
2247
2267
|
this.props.onLeaveRoom({
|
|
2248
2268
|
code: LEAVE_TYPE.ROOM_DESTROYED,
|
|
@@ -2250,6 +2270,9 @@ class Video extends Component {
|
|
|
2250
2270
|
})
|
|
2251
2271
|
}
|
|
2252
2272
|
} catch (err) {
|
|
2273
|
+
this.setState({
|
|
2274
|
+
sessionType: false
|
|
2275
|
+
})
|
|
2253
2276
|
this.messageClick('当前房间状态异常','error')
|
|
2254
2277
|
this.props.onLeaveRoom({
|
|
2255
2278
|
code: LEAVE_TYPE.ROOM_DESTROYED,
|
|
@@ -2847,6 +2870,7 @@ class Video extends Component {
|
|
|
2847
2870
|
videoTwelveName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' : data ? data : '客户12'
|
|
2848
2871
|
})
|
|
2849
2872
|
}
|
|
2873
|
+
this.pictureInPicture('Refresh')
|
|
2850
2874
|
} catch (err) {
|
|
2851
2875
|
|
|
2852
2876
|
}
|
|
@@ -3680,9 +3704,9 @@ Video.defaultProps = {
|
|
|
3680
3704
|
menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
|
|
3681
3705
|
customLeaveRoom: '客户离开房间',
|
|
3682
3706
|
meetingInfo: {
|
|
3683
|
-
title: '
|
|
3684
|
-
host: '
|
|
3685
|
-
customers: ['
|
|
3707
|
+
title: '--',
|
|
3708
|
+
host: '--',
|
|
3709
|
+
customers: ['--']
|
|
3686
3710
|
}
|
|
3687
3711
|
}
|
|
3688
3712
|
export default Video
|