react_hsbc_teller 1.0.9 → 1.1.2
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/demo/demo.js +5 -5
- package/packages/pages/foot/foot.jsx +15 -4
- package/packages/pages/video/video.jsx +198 -74
- package/packages/pages/video/video.less +18 -7
package/package.json
CHANGED
package/packages/demo/demo.js
CHANGED
|
@@ -4,17 +4,17 @@ import Pdf from './pdf.js'
|
|
|
4
4
|
|
|
5
5
|
class Demo extends Component {
|
|
6
6
|
state = {
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// mtoken: "182f46eea982",
|
|
8
|
+
// roomId: "646380817934933",
|
|
9
|
+
// imRoomId: "E9IYrsxUY@conference.openfire2.leimondata.cn",
|
|
10
|
+
// sessionId: "E9IYrsxUY",
|
|
11
11
|
roomId: '',
|
|
12
12
|
mtoken: '',
|
|
13
13
|
imRoomId: '',
|
|
14
14
|
sessionId: '',
|
|
15
15
|
isVideo: false,
|
|
16
16
|
tellerAccount: '00000000',
|
|
17
|
-
callbackUrl: 'http://
|
|
17
|
+
callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
|
|
18
18
|
businessNumber: '',
|
|
19
19
|
lang: 'zh',
|
|
20
20
|
roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
|
|
@@ -36,9 +36,6 @@ export default class foot extends Component {
|
|
|
36
36
|
customerFaceClick=(item)=>{
|
|
37
37
|
this.props.customerFaceClick(item)
|
|
38
38
|
}
|
|
39
|
-
switchExternal=()=>{
|
|
40
|
-
this.props.switchExternal()
|
|
41
|
-
}
|
|
42
39
|
facialHandleVisibleChange = visible => {
|
|
43
40
|
console.log(visible)
|
|
44
41
|
this.props.facialHandleVisibleChange(visible)
|
|
@@ -53,8 +50,11 @@ export default class foot extends Component {
|
|
|
53
50
|
screenSwitching =()=>{
|
|
54
51
|
this.props.screenSwitching()
|
|
55
52
|
}
|
|
53
|
+
switchExternal=()=>{
|
|
54
|
+
this.props.switchExternal()
|
|
55
|
+
}
|
|
56
56
|
render() {
|
|
57
|
-
const {clickedOcr,clickedFacial,img,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
|
|
57
|
+
const {clickedOcr,clickedFacial,img,isWhiteboard,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
|
|
58
58
|
const content = (
|
|
59
59
|
<div>
|
|
60
60
|
{customerList.map((item,index)=>{
|
|
@@ -69,6 +69,17 @@ export default class foot extends Component {
|
|
|
69
69
|
);
|
|
70
70
|
const defaultList = (
|
|
71
71
|
<div className="total totalTwo">
|
|
72
|
+
{
|
|
73
|
+
isWhiteboard&&<div className='footHover' onClick={this.switchExternal.bind(this)}>
|
|
74
|
+
<div className="one">
|
|
75
|
+
<img className="imgClass" src={require("../../assets/img/Projection_screen.png").default} alt="" />
|
|
76
|
+
<div className="text">
|
|
77
|
+
白板
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
{
|
|
73
84
|
menus.map((item,index)=>{
|
|
74
85
|
return <div key={index}className='footHover'>
|
|
@@ -27,7 +27,9 @@ const LEAVE_TYPE = {
|
|
|
27
27
|
TELLER_EXIT: 1, // 坐席退出
|
|
28
28
|
ROOM_DESTROYED: -1, // 房间异常
|
|
29
29
|
}
|
|
30
|
-
let pictureInPictureVideo
|
|
30
|
+
let pictureInPictureVideo
|
|
31
|
+
let mix_stream
|
|
32
|
+
let worker
|
|
31
33
|
message.config({
|
|
32
34
|
getContainer: ()=>document.getElementById('allHSBC')
|
|
33
35
|
})
|
|
@@ -41,6 +43,7 @@ class Video extends Component {
|
|
|
41
43
|
cancel = axios.CancelToken.source()
|
|
42
44
|
signCanvas = React.createRef();
|
|
43
45
|
state = {
|
|
46
|
+
listVideoPicture: [],
|
|
44
47
|
isScreenSwitching: false,
|
|
45
48
|
whiteboardWidth: '',
|
|
46
49
|
whiteboardHeight: '',
|
|
@@ -592,16 +595,16 @@ class Video extends Component {
|
|
|
592
595
|
if(!val) {
|
|
593
596
|
document.exitPictureInPicture()
|
|
594
597
|
} else {
|
|
595
|
-
this.pictureInPictureClick()
|
|
598
|
+
this.pictureInPictureClick('update')
|
|
596
599
|
}
|
|
597
600
|
} else {
|
|
598
601
|
if(!val) {
|
|
599
|
-
this.pictureInPictureClick()
|
|
602
|
+
this.pictureInPictureClick('add')
|
|
600
603
|
}
|
|
601
604
|
}
|
|
602
605
|
}
|
|
603
606
|
};
|
|
604
|
-
pictureInPictureClick=()=>{
|
|
607
|
+
pictureInPictureClick=(val)=>{
|
|
605
608
|
let interval
|
|
606
609
|
const list = []
|
|
607
610
|
if (document.getElementById('video1').name) {
|
|
@@ -710,12 +713,18 @@ class Video extends Component {
|
|
|
710
713
|
})
|
|
711
714
|
}
|
|
712
715
|
console.log(list)
|
|
713
|
-
|
|
714
|
-
const
|
|
716
|
+
this.state.listVideoPicture = list
|
|
717
|
+
// const width = 640;
|
|
718
|
+
// const height = 360 * this.state.listVideoPicture.length;
|
|
719
|
+
if(val == 'add') {
|
|
720
|
+
pictureInPictureVideo.srcObject = mix_stream;
|
|
721
|
+
let flag1 = true;
|
|
722
|
+
worker.postMessage(flag1);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
workerClick=()=>{
|
|
715
726
|
const canvas = document.createElement('canvas');
|
|
716
727
|
const cobj = canvas.getContext('2d'); // 获取绘图环境
|
|
717
|
-
canvas.width = width;
|
|
718
|
-
canvas.height = height;
|
|
719
728
|
let blob = new Blob([
|
|
720
729
|
`
|
|
721
730
|
let timer;
|
|
@@ -729,15 +738,17 @@ class Video extends Component {
|
|
|
729
738
|
`,
|
|
730
739
|
]);
|
|
731
740
|
let url = window.URL.createObjectURL(blob);
|
|
732
|
-
|
|
741
|
+
worker = new Worker(url);
|
|
733
742
|
window.URL.revokeObjectURL(blob);
|
|
734
|
-
|
|
743
|
+
|
|
735
744
|
|
|
736
745
|
worker.onmessage =() => {
|
|
737
|
-
cobj.clearRect(0, 0,
|
|
738
|
-
|
|
746
|
+
cobj.clearRect(0, 0, 640, 360 * this.state.listVideoPicture.length);
|
|
747
|
+
canvas.width = 640;
|
|
748
|
+
canvas.height = 360 * this.state.listVideoPicture.length;
|
|
749
|
+
for (let i = 0; i < this.state.listVideoPicture.length; i++) {
|
|
739
750
|
|
|
740
|
-
let videoId =
|
|
751
|
+
let videoId = this.state.listVideoPicture[i].name;
|
|
741
752
|
let videoDiv = document.getElementById(videoId);
|
|
742
753
|
let videoWidth = videoDiv.videoWidth;
|
|
743
754
|
let videoHeight = videoDiv.videoHeight;
|
|
@@ -748,7 +759,7 @@ class Video extends Component {
|
|
|
748
759
|
} else {
|
|
749
760
|
newVideoHeight = videoHeight * 640 / videoWidth;
|
|
750
761
|
}
|
|
751
|
-
if(
|
|
762
|
+
if(this.state.listVideoPicture[i].noVideo){
|
|
752
763
|
cobj.fillStyle = '#333';
|
|
753
764
|
cobj.fillRect((640 - newVideoWidth) / 2, 360 * i, newVideoWidth, newVideoHeight)
|
|
754
765
|
} else {
|
|
@@ -762,11 +773,11 @@ class Video extends Component {
|
|
|
762
773
|
cobj.fill();
|
|
763
774
|
cobj.stroke();
|
|
764
775
|
cobj.beginPath();
|
|
765
|
-
cobj.font = "
|
|
776
|
+
cobj.font = "normal lighter 25px sans-serif";
|
|
766
777
|
cobj.textAlign = 'left';
|
|
767
778
|
cobj.lineWidth = 1;
|
|
768
779
|
// 文字
|
|
769
|
-
let str =
|
|
780
|
+
let str = this.state.listVideoPicture[i].title
|
|
770
781
|
for (let k = 0; k < str.length; k++){
|
|
771
782
|
// console.log(str.substring(0,k+1))
|
|
772
783
|
// console.log(cobj.measureText(str.substring(0,k+1)).width)
|
|
@@ -781,7 +792,7 @@ class Video extends Component {
|
|
|
781
792
|
//左边框
|
|
782
793
|
cobj.beginPath();
|
|
783
794
|
cobj.moveTo(0, 0);
|
|
784
|
-
cobj.lineTo(0, 360 *
|
|
795
|
+
cobj.lineTo(0, 360 * this.state.listVideoPicture.length);
|
|
785
796
|
cobj.closePath(); //闭合路径
|
|
786
797
|
cobj.lineWidth = 5; //线的边框为10像素
|
|
787
798
|
cobj.strokeStyle = '#d9363e';
|
|
@@ -798,7 +809,7 @@ class Video extends Component {
|
|
|
798
809
|
|
|
799
810
|
//右边框
|
|
800
811
|
cobj.beginPath();
|
|
801
|
-
cobj.moveTo(640, 360 *
|
|
812
|
+
cobj.moveTo(640, 360 * this.state.listVideoPicture.length);
|
|
802
813
|
cobj.lineTo(640, 0);
|
|
803
814
|
cobj.closePath(); //闭合路径
|
|
804
815
|
cobj.lineWidth = 5; //线的边框为10像素
|
|
@@ -808,8 +819,8 @@ class Video extends Component {
|
|
|
808
819
|
|
|
809
820
|
//上边框
|
|
810
821
|
cobj.beginPath();
|
|
811
|
-
cobj.moveTo(0, 360 *
|
|
812
|
-
cobj.lineTo(640, 360 *
|
|
822
|
+
cobj.moveTo(0, 360 * this.state.listVideoPicture.length);
|
|
823
|
+
cobj.lineTo(640, 360 * this.state.listVideoPicture.length);
|
|
813
824
|
cobj.closePath(); //闭合路径
|
|
814
825
|
cobj.lineWidth = 5; //线的边框为10像素
|
|
815
826
|
cobj.strokeStyle = '#d9363e';
|
|
@@ -819,26 +830,15 @@ class Video extends Component {
|
|
|
819
830
|
let microphoneSize = 50
|
|
820
831
|
var img = document.getElementById("icon_huatong");
|
|
821
832
|
var img1 = document.getElementById("icon_huatong_close");
|
|
822
|
-
if(this.state[
|
|
833
|
+
if(this.state[this.state.listVideoPicture[i].voice]) {
|
|
823
834
|
cobj.drawImage(img1, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
824
835
|
} else {
|
|
825
836
|
cobj.drawImage(img, 10, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
826
837
|
|
|
827
838
|
// 绘制实时音量
|
|
828
|
-
let sid = document.getElementById(
|
|
839
|
+
let sid = document.getElementById(this.state.listVideoPicture[i].name).name
|
|
829
840
|
let analyser = this.state.analyserData.get(sid)
|
|
830
841
|
aou(analyser)
|
|
831
|
-
// let sid = document.getElementById(list[i].name).name
|
|
832
|
-
// let stream = this.test_controller.GetMediaInfo(sid).audio_
|
|
833
|
-
// let acc = new AudioContext()
|
|
834
|
-
// let mic = acc.createMediaStreamSource(stream)
|
|
835
|
-
// let analyser = acc.createAnalyser()
|
|
836
|
-
// analyser.fftSize = 256
|
|
837
|
-
// mic.connect(analyser)
|
|
838
|
-
// aou(analyser)
|
|
839
|
-
// let microphoneSize = 50
|
|
840
|
-
// var img = document.getElementById("icon_huatong");
|
|
841
|
-
// cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
|
|
842
842
|
function aou(analyser){
|
|
843
843
|
if(analyser) {
|
|
844
844
|
let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
@@ -873,11 +873,11 @@ class Video extends Component {
|
|
|
873
873
|
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
|
-
|
|
876
|
+
|
|
877
877
|
const captureStream = canvas.captureStream();
|
|
878
|
-
|
|
878
|
+
mix_stream = new MediaStream(captureStream);
|
|
879
879
|
pictureInPictureVideo = document.getElementById('mixedvideo');
|
|
880
|
-
|
|
880
|
+
|
|
881
881
|
pictureInPictureVideo.onloadedmetadata = () => {
|
|
882
882
|
pictureInPictureVideo.requestPictureInPicture();
|
|
883
883
|
};
|
|
@@ -892,9 +892,11 @@ class Video extends Component {
|
|
|
892
892
|
pictureInPictureVideo.addEventListener('leavepictureinpicture', (event) => {
|
|
893
893
|
pictureInPictureVideo.srcObject = null;
|
|
894
894
|
pictureInPictureVideo.style.display = "none";
|
|
895
|
+
this.state.listVideoPicture = []
|
|
895
896
|
worker.postMessage(false);
|
|
896
897
|
this.state.isPictureInPicture = false
|
|
897
898
|
});
|
|
899
|
+
|
|
898
900
|
}
|
|
899
901
|
roomCallBack = (type, manege,code) => {
|
|
900
902
|
this.setState({
|
|
@@ -1135,7 +1137,10 @@ class Video extends Component {
|
|
|
1135
1137
|
else if (Mival.typeId == 1220) {
|
|
1136
1138
|
// 一炒多的图片
|
|
1137
1139
|
if (Mival.sessionId == this.state.sessionId) {
|
|
1138
|
-
this.props.imgCallback(
|
|
1140
|
+
this.props.imgCallback({
|
|
1141
|
+
type: Mival.data.type,
|
|
1142
|
+
file: Mival.data.file}
|
|
1143
|
+
) // 文字抄录和风险抄录,3--风险,,2--文字
|
|
1139
1144
|
}
|
|
1140
1145
|
} else if (Mival.typeId == 1216) {
|
|
1141
1146
|
// 签字回调
|
|
@@ -1150,10 +1155,16 @@ class Video extends Component {
|
|
|
1150
1155
|
} else if (Mival.type == 2) {
|
|
1151
1156
|
this.tabTitlesClick('RMWhiteboard', 'delect')
|
|
1152
1157
|
if (this.state.isSharedScreen) {
|
|
1153
|
-
this.
|
|
1158
|
+
this.setState({
|
|
1159
|
+
isWhiteboard: false
|
|
1160
|
+
})
|
|
1154
1161
|
} else {
|
|
1155
|
-
|
|
1156
|
-
|
|
1162
|
+
if(document.getElementById('video20').name) {
|
|
1163
|
+
this.test_controller.UnPublish(document.getElementById('video20').name)
|
|
1164
|
+
}
|
|
1165
|
+
this.setState({
|
|
1166
|
+
isWhiteboard: false
|
|
1167
|
+
})
|
|
1157
1168
|
}
|
|
1158
1169
|
}
|
|
1159
1170
|
|
|
@@ -1355,7 +1366,7 @@ class Video extends Component {
|
|
|
1355
1366
|
type: '2',
|
|
1356
1367
|
sigType: 1
|
|
1357
1368
|
};
|
|
1358
|
-
|
|
1369
|
+
this.workerClick()
|
|
1359
1370
|
this.test_controller.GetDevices();
|
|
1360
1371
|
// 获取设备成功
|
|
1361
1372
|
this.test_controller.OnGetDevicesSuccess = (devicesInfo) => {
|
|
@@ -2617,6 +2628,7 @@ class Video extends Component {
|
|
|
2617
2628
|
this.props.resourcePath + "/beauty/beauty.js",
|
|
2618
2629
|
this.props.resourcePath + "/beauty/meeting_beautify_stream.js",
|
|
2619
2630
|
this.props.resourcePath + "/beauty/backgroundBlur.js",
|
|
2631
|
+
|
|
2620
2632
|
this.props.resourcePath + "/adapter.js",
|
|
2621
2633
|
this.props.resourcePath + "/getMediaInfo.js",
|
|
2622
2634
|
// this.props.resourcePath + "/pdf.js",
|
|
@@ -2628,10 +2640,17 @@ class Video extends Component {
|
|
|
2628
2640
|
this.props.resourcePath + "/meeting_im.js",
|
|
2629
2641
|
this.props.resourcePath + "/meeting_vod.js",
|
|
2630
2642
|
this.props.resourcePath + "/meeting_invite.js",
|
|
2631
|
-
this.props.resourcePath + "/client_record.js",
|
|
2643
|
+
this.props.resourcePath + "/client_record.js",
|
|
2632
2644
|
this.props.resourcePath + "/remote_record.js",
|
|
2633
2645
|
this.props.resourcePath + "/meeting_camera_stream.js",
|
|
2634
2646
|
this.props.resourcePath + "/meeting_api.js",
|
|
2647
|
+
|
|
2648
|
+
this.props.resourcePath + "/eruda.js",
|
|
2649
|
+
this.props.resourcePath + "/iconfont.js",
|
|
2650
|
+
this.props.resourcePath + "/dialogue.css",
|
|
2651
|
+
|
|
2652
|
+
|
|
2653
|
+
|
|
2635
2654
|
]
|
|
2636
2655
|
const that = this
|
|
2637
2656
|
let i = 0
|
|
@@ -2807,6 +2826,8 @@ class Video extends Component {
|
|
|
2807
2826
|
publish_config.media_type = 1
|
|
2808
2827
|
publish_config.publish_device = 2
|
|
2809
2828
|
publish_config.video_profile_type = 1
|
|
2829
|
+
publish_config.enableDesktopAudio=true
|
|
2830
|
+
publish_config.degradationType=2
|
|
2810
2831
|
publish_config.sid = document.getElementById('video20').name
|
|
2811
2832
|
this.test_controller.ChangeMediaStream(publish_config)
|
|
2812
2833
|
this.state.isScreenSwitching = true
|
|
@@ -2818,19 +2839,19 @@ class Video extends Component {
|
|
|
2818
2839
|
if (this.isFileSuccuse()) {
|
|
2819
2840
|
const publish_config = {};
|
|
2820
2841
|
if (this.state.isSharedScreen) {
|
|
2821
|
-
if (this.state.isWhiteboard) {
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
} else {
|
|
2842
|
+
// if (this.state.isWhiteboard) {
|
|
2843
|
+
// publish_config.publish_device = 4
|
|
2844
|
+
// publish_config.media_type = 1
|
|
2845
|
+
// publish_config.sid = document.getElementById('video20').name
|
|
2846
|
+
// publish_config.part_of_screen_id = 'touBoxItem'
|
|
2847
|
+
// publish_config.video_profile_type = 5
|
|
2848
|
+
// this.test_controller.ChangeMediaStream(publish_config);
|
|
2849
|
+
// this.setState({
|
|
2850
|
+
// isPDF: true,
|
|
2851
|
+
// })
|
|
2852
|
+
// } else {
|
|
2832
2853
|
this.test_controller.UnPublish(document.getElementById('video20').name)
|
|
2833
|
-
}
|
|
2854
|
+
// }
|
|
2834
2855
|
this.state.isSharedScreen = false
|
|
2835
2856
|
this.state.isScreenSwitching = false
|
|
2836
2857
|
this.setState({
|
|
@@ -2846,6 +2867,8 @@ class Video extends Component {
|
|
|
2846
2867
|
publish_config.media_type = 1;
|
|
2847
2868
|
publish_config.publish_device = 2;
|
|
2848
2869
|
publish_config.video_profile_type = 1;
|
|
2870
|
+
publish_config.enableDesktopAudio=true
|
|
2871
|
+
publish_config.degradationType=2
|
|
2849
2872
|
publish_config.sid = document.getElementById('video20').name;
|
|
2850
2873
|
this.test_controller.ChangeMediaStream(publish_config);
|
|
2851
2874
|
} else {
|
|
@@ -2853,6 +2876,8 @@ class Video extends Component {
|
|
|
2853
2876
|
publish_config.publish_device = 2
|
|
2854
2877
|
publish_config.need_volume_analyser = true
|
|
2855
2878
|
publish_config.video_profile_type = 1
|
|
2879
|
+
publish_config.enableDesktopAudio=true
|
|
2880
|
+
publish_config.degradationType=2
|
|
2856
2881
|
publish_config.publish_video_id = 'video20'
|
|
2857
2882
|
publish_config.publish_streamId_id = 'subscribe_streamId20'
|
|
2858
2883
|
publish_config.publish_tag = 'projectionWhiteboard'
|
|
@@ -3214,6 +3239,7 @@ class Video extends Component {
|
|
|
3214
3239
|
console.log(inp.value, '复制到的内容')
|
|
3215
3240
|
document.execCommand('Copy') // 执行浏览器复制命令
|
|
3216
3241
|
inp.remove()
|
|
3242
|
+
this.messageClick('复制成功','success')
|
|
3217
3243
|
}
|
|
3218
3244
|
queryStaff = async () => {
|
|
3219
3245
|
if(!this.state.employeeNumber) return
|
|
@@ -3246,21 +3272,108 @@ class Video extends Component {
|
|
|
3246
3272
|
this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
|
|
3247
3273
|
)
|
|
3248
3274
|
}
|
|
3275
|
+
switchExternalAge = ()=>{
|
|
3276
|
+
const that = this
|
|
3277
|
+
if(this.state.isSharedScreen) {
|
|
3278
|
+
this.state.isSharedScreen = false
|
|
3279
|
+
this.setState({
|
|
3280
|
+
|
|
3281
|
+
screenName: '共享模式'
|
|
3282
|
+
});
|
|
3283
|
+
this.tabTitlesClick('RMScreen', 'delect')
|
|
3284
|
+
if (this.state.isPictureInPicture) {
|
|
3285
|
+
document.exitPictureInPicture()
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
const publish_config = {};
|
|
3290
|
+
const width = this.state.whiteboardWidth;
|
|
3291
|
+
const height = this.state.whiteboardHeight;
|
|
3292
|
+
const canvas = document.createElement('canvas');
|
|
3293
|
+
const videoMedia = document.getElementById('manedvideo');
|
|
3294
|
+
const cobj = canvas.getContext('2d'); // 获取绘图环境
|
|
3295
|
+
const w = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
|
|
3296
|
+
const h = document.getElementById("whiteboardDIV").getBoundingClientRect().top
|
|
3297
|
+
canvas.width = width;
|
|
3298
|
+
canvas.height = height;
|
|
3299
|
+
videoMedia.addEventListener('play', (event) =>{
|
|
3300
|
+
var $this = this; //cache
|
|
3301
|
+
console.log('333111',!$this.paused,!$this.ended)
|
|
3302
|
+
loop()
|
|
3303
|
+
function loop() {
|
|
3304
|
+
if (!$this.paused && !$this.ended) {
|
|
3305
|
+
cobj.drawImage(videoMedia, w, h, width, height, 0, 0,width, height,);
|
|
3306
|
+
setTimeout(loop, 1000 / 10); // drawing at 30fps
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
if (document.getElementById('video20').name) {
|
|
3311
|
+
// 代表已经有了进行切流
|
|
3312
|
+
publish_config.publish_device = 5
|
|
3313
|
+
publish_config.media_type = 1
|
|
3314
|
+
publish_config.degradationType=2
|
|
3315
|
+
publish_config.sid = document.getElementById('video20').name
|
|
3316
|
+
publish_config.stream = canvas.captureStream(10)
|
|
3317
|
+
publish_config.video_profile_type = 9
|
|
3318
|
+
this.test_controller.ChangeMediaStream(publish_config);
|
|
3319
|
+
} else {
|
|
3320
|
+
|
|
3321
|
+
publish_config.media_type = 1
|
|
3322
|
+
publish_config.publish_device = 5
|
|
3323
|
+
publish_config.need_volume_analyser = true
|
|
3324
|
+
publish_config.video_profile_type = 9
|
|
3325
|
+
publish_config.degradationType=2
|
|
3326
|
+
publish_config.stream = canvas.captureStream(10)
|
|
3327
|
+
publish_config.publish_video_id = 'video20'
|
|
3328
|
+
publish_config.publish_streamId_id = 'subscribe_streamId10'
|
|
3329
|
+
publish_config.publish_tag = 'projectionWhiteboard'
|
|
3330
|
+
this.test_controller.Publish(publish_config)
|
|
3331
|
+
}
|
|
3332
|
+
}, 0);
|
|
3333
|
+
navigator.mediaDevices.getDisplayMedia({
|
|
3334
|
+
video: true
|
|
3335
|
+
})
|
|
3336
|
+
.then((stream) => {
|
|
3337
|
+
videoMedia.srcObject = stream;
|
|
3338
|
+
stream.getVideoTracks()[0].onended = async ()=>{
|
|
3339
|
+
//单击停止共享按钮后,触发这个事件
|
|
3340
|
+
if(document.getElementById('video20').name && !this.state.isSharedScreen) {
|
|
3341
|
+
that.test_controller.UnPublish(document.getElementById('video20').name)
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
}, error => {
|
|
3345
|
+
console.log("Unable to acquire screen capture", error);
|
|
3346
|
+
});
|
|
3347
|
+
}
|
|
3249
3348
|
switchExternal = () => {
|
|
3349
|
+
const that = this
|
|
3250
3350
|
if (!this.state.isWhiteboard) {
|
|
3251
3351
|
const publish_config = {};
|
|
3252
|
-
this.
|
|
3352
|
+
this.setState({
|
|
3353
|
+
isWhiteboard: true
|
|
3354
|
+
})
|
|
3253
3355
|
this.tabTitlesClick({
|
|
3254
3356
|
value: 'RMWhiteboard',
|
|
3255
3357
|
name: 'RM白板'
|
|
3256
3358
|
}, 'add')
|
|
3359
|
+
if(this.state.isSharedScreen) {
|
|
3360
|
+
this.state.isSharedScreen = false
|
|
3361
|
+
this.setState({
|
|
3362
|
+
|
|
3363
|
+
screenName: '共享模式'
|
|
3364
|
+
});
|
|
3365
|
+
this.tabTitlesClick('RMScreen', 'delect')
|
|
3366
|
+
if (this.state.isPictureInPicture) {
|
|
3367
|
+
document.exitPictureInPicture()
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3257
3370
|
const width = this.state.whiteboardWidth;
|
|
3258
3371
|
const height = this.state.whiteboardHeight;
|
|
3259
3372
|
const canvas = document.createElement('canvas');
|
|
3260
3373
|
const videoMedia = document.getElementById('manedvideo');
|
|
3261
3374
|
const cobj = canvas.getContext('2d'); // 获取绘图环境
|
|
3262
|
-
const w =
|
|
3263
|
-
const h =
|
|
3375
|
+
const w = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
|
|
3376
|
+
const h = document.getElementById("whiteboardDIV").getBoundingClientRect().top
|
|
3264
3377
|
canvas.width = width;
|
|
3265
3378
|
canvas.height = height;
|
|
3266
3379
|
videoMedia.addEventListener('play', (event) =>{
|
|
@@ -3269,7 +3382,7 @@ class Video extends Component {
|
|
|
3269
3382
|
loop()
|
|
3270
3383
|
function loop() {
|
|
3271
3384
|
if (!$this.paused && !$this.ended) {
|
|
3272
|
-
cobj.drawImage(videoMedia,
|
|
3385
|
+
cobj.drawImage(videoMedia, w, h, width, height, 0, 0,width, height,);
|
|
3273
3386
|
setTimeout(loop, 1000 / 10); // drawing at 30fps
|
|
3274
3387
|
}
|
|
3275
3388
|
}
|
|
@@ -3278,16 +3391,18 @@ class Video extends Component {
|
|
|
3278
3391
|
// 代表已经有了进行切流
|
|
3279
3392
|
publish_config.publish_device = 5
|
|
3280
3393
|
publish_config.media_type = 1
|
|
3394
|
+
publish_config.degradationType=2
|
|
3281
3395
|
publish_config.sid = document.getElementById('video20').name
|
|
3282
3396
|
publish_config.stream = canvas.captureStream(10)
|
|
3283
|
-
publish_config.video_profile_type =
|
|
3397
|
+
publish_config.video_profile_type = 9
|
|
3284
3398
|
this.test_controller.ChangeMediaStream(publish_config);
|
|
3285
3399
|
} else {
|
|
3286
3400
|
|
|
3287
3401
|
publish_config.media_type = 1
|
|
3288
3402
|
publish_config.publish_device = 5
|
|
3289
3403
|
publish_config.need_volume_analyser = true
|
|
3290
|
-
publish_config.video_profile_type =
|
|
3404
|
+
publish_config.video_profile_type = 9
|
|
3405
|
+
publish_config.degradationType=2
|
|
3291
3406
|
publish_config.stream = canvas.captureStream(10)
|
|
3292
3407
|
publish_config.publish_video_id = 'video20'
|
|
3293
3408
|
publish_config.publish_streamId_id = 'subscribe_streamId10'
|
|
@@ -3300,6 +3415,12 @@ class Video extends Component {
|
|
|
3300
3415
|
})
|
|
3301
3416
|
.then((stream) => {
|
|
3302
3417
|
videoMedia.srcObject = stream;
|
|
3418
|
+
stream.getVideoTracks()[0].onended = async ()=>{
|
|
3419
|
+
//单击停止共享按钮后,触发这个事件
|
|
3420
|
+
if(document.getElementById('video20').name&&!this.state.isSharedScreen) {
|
|
3421
|
+
that.test_controller.UnPublish(document.getElementById('video20').name)
|
|
3422
|
+
}
|
|
3423
|
+
}
|
|
3303
3424
|
}, error => {
|
|
3304
3425
|
console.log("Unable to acquire screen capture", error);
|
|
3305
3426
|
});
|
|
@@ -3518,7 +3639,7 @@ class Video extends Component {
|
|
|
3518
3639
|
id="video20"
|
|
3519
3640
|
autoPlay
|
|
3520
3641
|
muted={true}
|
|
3521
|
-
className="
|
|
3642
|
+
className="videoTab"
|
|
3522
3643
|
/>
|
|
3523
3644
|
<audio id="audio20" autoPlay />
|
|
3524
3645
|
<label style={{ display: 'none' }} id="feedId20" type="text" />
|
|
@@ -3537,7 +3658,7 @@ class Video extends Component {
|
|
|
3537
3658
|
id="video21"
|
|
3538
3659
|
autoPlay
|
|
3539
3660
|
muted={true}
|
|
3540
|
-
className="
|
|
3661
|
+
className="videoTab"
|
|
3541
3662
|
/>
|
|
3542
3663
|
<audio id="audio21" autoPlay />
|
|
3543
3664
|
<label style={{ display: 'none' }} id="feedId21" type="text" />
|
|
@@ -3955,6 +4076,7 @@ class Video extends Component {
|
|
|
3955
4076
|
customerList={this.state.customerList}
|
|
3956
4077
|
clickedOcr={this.state.clickedOcr}
|
|
3957
4078
|
clickedFacial={this.state.clickedFacial}
|
|
4079
|
+
isWhiteboard={this.state.isWhiteboard}
|
|
3958
4080
|
{...this.props}
|
|
3959
4081
|
suspend={this.suspend}
|
|
3960
4082
|
facialHandleVisibleChange={this.facialHandleVisibleChange}
|
|
@@ -3969,7 +4091,7 @@ class Video extends Component {
|
|
|
3969
4091
|
invitationClick={this.invitationClick}
|
|
3970
4092
|
customerFaceClick={this.customerFaceClick}
|
|
3971
4093
|
ocrClick={this.ocrClick}
|
|
3972
|
-
switchExternal={this.
|
|
4094
|
+
switchExternal={this.switchExternalAge}
|
|
3973
4095
|
inspection={this.inspection}
|
|
3974
4096
|
screenSwitching={this.screenSwitching}
|
|
3975
4097
|
></Foot>
|
|
@@ -4027,19 +4149,19 @@ class Video extends Component {
|
|
|
4027
4149
|
<div className="invitationDiv">
|
|
4028
4150
|
<span className="modalSpan"> 姓名:</span><span>{this.state.employeeName}</span>
|
|
4029
4151
|
</div>
|
|
4030
|
-
{
|
|
4031
|
-
this.state.employeeName &&<div className='invitationDiv'>
|
|
4032
|
-
<span className="modalSpan"> </span><Button className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制会议链接</Button>
|
|
4033
|
-
</div>
|
|
4034
|
-
}
|
|
4035
4152
|
|
|
4153
|
+
<div className='invitationDiv' style={{ height: '27px'}}>
|
|
4154
|
+
<span className="modalSpan"> </span>
|
|
4155
|
+
<Button style={{ display: this.state.employeeName? '' : 'none'}} className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制会议链接</Button>
|
|
4156
|
+
</div>
|
|
4157
|
+
|
|
4036
4158
|
</div>
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
<img alt="" src={require("../../assets/img/tooltips2_fail.png").default} />
|
|
4040
|
-
<span>{this.state.employeeError}</span>
|
|
4159
|
+
|
|
4160
|
+
<div className={`errorClassInvitation ${this.state.employeeError ? 'errorClassInvitationColor' : ''}`}>
|
|
4161
|
+
<img style={{ display: this.state.employeeError? '' : 'none'}} alt="" src={require("../../assets/img/tooltips2_fail.png").default} />
|
|
4162
|
+
<span style={{ display: this.state.employeeError? '' : 'none'}}>{this.state.employeeError}</span>
|
|
4041
4163
|
</div>
|
|
4042
|
-
|
|
4164
|
+
|
|
4043
4165
|
|
|
4044
4166
|
</Modal>
|
|
4045
4167
|
<Modal title="签字白板" width={600} destroyOnClose={true} closable={false} centered={true} visible={isTranscribing} footer={
|
|
@@ -4075,7 +4197,9 @@ class Video extends Component {
|
|
|
4075
4197
|
{
|
|
4076
4198
|
this.state.speakerList.length > 0 &&
|
|
4077
4199
|
<span>
|
|
4078
|
-
<div
|
|
4200
|
+
<div>扬声器:
|
|
4201
|
+
<span className='speakerTitle'>(请更改系统设置)</span>
|
|
4202
|
+
</div>
|
|
4079
4203
|
{speaker}
|
|
4080
4204
|
</span>
|
|
4081
4205
|
}
|