react_hsbc_teller 0.3.8 → 0.3.9

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.
@@ -32,8 +32,7 @@ class Video extends Component {
32
32
  signCanvas = React.createRef();
33
33
  state = {
34
34
  isWhiteboard: false,
35
- isSelect: 'video',
36
- isPDF: false,
35
+ isSelect: '',
37
36
  loading: false,
38
37
  isModalVisibleSign: false,
39
38
  titleModal: '人脸识别',
@@ -77,7 +76,9 @@ class Video extends Component {
77
76
  videoThreeName: '',
78
77
  videoFourName: '',
79
78
  videoFiveName: '',
80
- videoSixName: ''
79
+ videoSixName: '',
80
+ tabTitles: [
81
+ ]
81
82
  };
82
83
  // eslint-disable-next-line no-undef
83
84
  test_controller = '';
@@ -162,14 +163,11 @@ class Video extends Component {
162
163
  // 初始化视频
163
164
  ConnectMRTC = () => {
164
165
  const config_param = {};
165
- config_param.auto_publish_subscribe = 3;
166
+ config_param.auto_publish_subscribe = 2;
166
167
  config_param.media_type = 1;
167
168
  config_param.publish_device = 1;
168
169
  config_param.video_profile_type = '3';
169
170
  config_param.need_volume_analyser = true;
170
- // config_param.audioSource = that.microphone[0].actionid
171
- // config_param.videoSource = that.checkOne[0]
172
- // config_param.transport_ = 'relay'
173
171
  config_param.initPublish = [
174
172
  {
175
173
  publish_video_id: 'publish_video1',
@@ -510,12 +508,12 @@ class Video extends Component {
510
508
  title: this.state.videoSixName
511
509
  })
512
510
  }
513
- if(document.getElementById('video10').name) {
514
- list.push({
515
- name: 'video10',
516
- title: '互动白板'
517
- })
518
- }
511
+ // if(document.getElementById('video10').name) {
512
+ // list.push({
513
+ // name: 'video10',
514
+ // title: '互动白板'
515
+ // })
516
+ // }
519
517
  console.log(list)
520
518
  const width = 640;
521
519
  const height = 360 * list.length;
@@ -523,10 +521,11 @@ class Video extends Component {
523
521
  const cobj = canvas.getContext('2d'); // 获取绘图环境
524
522
  canvas.width = width;
525
523
  canvas.height = height;
524
+
526
525
  interval = setInterval(() => {
527
526
  cobj.clearRect(0, 0, width, height);
528
527
  for(let i=0;i<list.length;i++){
529
-
528
+
530
529
  let videoId = list[i].name;
531
530
  let videoDiv = document.getElementById(videoId);
532
531
  let videoWidth = videoDiv.videoWidth;
@@ -538,54 +537,94 @@ class Video extends Component {
538
537
  } else {
539
538
  newVideoHeight = videoHeight * 640 / videoWidth;
540
539
  }
541
- console.log(newVideoWidth,videoHeight)
542
540
 
543
541
  cobj.drawImage(videoDiv, (640 - newVideoWidth)/2, 360 * i, newVideoWidth, newVideoHeight);
544
- var img = document.getElementById("icon_huatong");
545
- cobj.drawImage(img, 600, 320, canvas.width, canvas.height);
546
542
  cobj.beginPath();
547
543
  cobj.strokeStyle = this.props.titleColor;
548
544
  cobj.fillStyle = this.props.titleBackground;
549
545
  cobj.fillRect(0, 360 * (i + 1) - 60, 300, 60 )
550
- cobj.closePath();
551
546
  cobj.fill();
552
547
  cobj.stroke();
548
+ cobj.beginPath();
553
549
  cobj.font = "28px auto";
554
550
  cobj.textAlign = 'center';
551
+ cobj.lineWidth = 1;
555
552
  cobj.strokeText(list[i].title, 150, 360 * (i + 1) - 20);
556
- console.log(videoDiv.srcObject, videoDiv.srcObject.getAudioTracks(), videoDiv.srcObject.getAudioTracks()[0])
557
- // const acc = new AudioContext()
558
- // // 返回一个多媒体流
559
- // const mic = acc.createMediaStreamSource(videoDiv.srcObject.getAudioTracks()[0])
560
- // // creates an AnalyserNode 创建一个分析节点
561
- // this.analyser = acc.createAnalyser()
562
- // // fftsize默认值2048,是快速傅立叶变换用于频域分析的值,必须为2的幂,而我们得到的数据通常为其的一半,下面会说道
563
- // this.analyser.fftSize = 256
564
- // // 调用绘图函数
565
- // mic.connect(this.analyser)
566
- // let dataArray = new Uint8Array(this.analyser);
567
- // this.analyser.getByteFrequencyData(dataArray);
568
- // let step = Math.round(dataArray.length / 60); //采样步长
569
- // 以画布左上角为坐标原点
570
- // let drawArea = {
571
- // x1: 28/50 * canvas.width, // 波动范围右下角的点坐标
572
- // y1: 25/50 * canvas.height,
573
- // x2: 22/50 * canvas.width, // 波动范围左上角的点坐标
574
- // y2: 10/50 * canvas.height,
575
- // }
576
-
577
- // for (var j = 0; j < 40; j++) {
578
- // let energy = (dataArray[step * j] / 256.0) * 80;
579
- // ctx.beginPath();
580
- // ctx.fillStyle = "#0AE544";
581
- // const { x1,y1,x2,y2} = drawArea
582
- // let width = x1-x2;
583
- // let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
584
- // let startX = x2 // 绘制起始点x
585
- // let startY = y1 - height // 绘制起始点y
586
- // cobj.fillRect(startX, startY, width, height )
587
- // }
588
- // cobj.drawImage(videoDiv, 320 * i, (480 - newVideoHeight)/2, 320, newVideoHeight);
553
+ cobj.stroke();
554
+ //左边框
555
+ cobj.beginPath();
556
+ cobj.moveTo( 0, 0);
557
+ cobj.lineTo( 0, 360 * list.length);
558
+ cobj.closePath(); //闭合路径
559
+ cobj.lineWidth = 5; //线的边框为10像素
560
+ cobj.strokeStyle = '#d9363e';
561
+ cobj.stroke(); //绘制定义的图形
562
+
563
+ //下边框
564
+ cobj.beginPath();
565
+ cobj.moveTo( 0, 0);
566
+ cobj.lineTo( 640, 0);
567
+ cobj.closePath(); //闭合路径
568
+ cobj.lineWidth = 5; //线的边框为10像素
569
+ cobj.strokeStyle = '#d9363e';
570
+ cobj.stroke(); //绘制定义的图形
571
+
572
+ //右边框
573
+ cobj.beginPath();
574
+ cobj.moveTo( 640, 360 * list.length);
575
+ cobj.lineTo( 640, 0);
576
+ cobj.closePath(); //闭合路径
577
+ cobj.lineWidth = 5; //线的边框为10像素
578
+ cobj.strokeStyle = '#d9363e';
579
+ cobj.stroke(); //绘制定义的图形
580
+
581
+
582
+ //上边框
583
+ cobj.beginPath();
584
+ cobj.moveTo( 0, 360 * list.length);
585
+ cobj.lineTo( 640, 360 * list.length);
586
+ cobj.closePath(); //闭合路径
587
+ cobj.lineWidth = 5; //线的边框为10像素
588
+ cobj.strokeStyle = '#d9363e';
589
+ cobj.stroke(); //绘制定义的图形
590
+
591
+ // let sid = document.getElementById(list[i].name).name
592
+ // let stream = this.test_controller.GetMediaInfo(sid).audio_
593
+ // let acc = new AudioContext()
594
+ // let mic = acc.createMediaStreamSource(stream)
595
+ // let analyser = acc.createAnalyser()
596
+ // analyser.fftSize = 256
597
+ // mic.connect(analyser)
598
+ // aou(analyser)
599
+ // let microphoneSize = this.props.microphoneSize
600
+ // var img = document.getElementById("icon_huatong");
601
+ // cobj.drawImage(img, 600, 360 * (i + 1) - 60, microphoneSize, microphoneSize);
602
+ // function aou(analyser){
603
+ // let dataArray = new Uint8Array(analyser.frequencyBinCount);
604
+ // analyser.getByteFrequencyData(dataArray);
605
+ // let step = Math.round(dataArray.length / 60); //采样步长
606
+ // // 以画布左上角为坐标原点
607
+ // let drawArea = {
608
+ // x1: 28/50 * microphoneSize + 600, // 波动范围右下角的点坐标
609
+ // y1: 25/50 * microphoneSize + 360 * (i + 1) - 60,
610
+ // x2: 22/50 * microphoneSize + 600, // 波动范围左上角的点坐标
611
+ // y2: 10/50 * microphoneSize + 360 * (i + 1) - 60,
612
+ // }
613
+
614
+ // for (var j = 0; j < 40; j++) {
615
+ // let energy = (dataArray[step * j] / 256.0) * 80;
616
+ // cobj.beginPath();
617
+ // cobj.fillStyle = "#0AE544";
618
+ // const { x1,y1,x2,y2} = drawArea
619
+ // let width = x1-x2;
620
+ // let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
621
+ // let startX = x2 // 绘制起始点x
622
+ // let startY = y1 - height // 绘制起始点y
623
+ // cobj.fillRect(startX, startY, width, height )
624
+ // }
625
+ // requestAnimationFrame(aou.bind(this, analyser));
626
+
627
+ // }
589
628
  }
590
629
  }, 100);
591
630
  const captureStream = canvas.captureStream();
@@ -632,6 +671,30 @@ class Video extends Component {
632
671
  })
633
672
  }
634
673
  }
674
+ tabTitlesClick = (value,type) =>{
675
+ const { tabTitles } = this.state;
676
+ if(type == 'add') {
677
+ tabTitles.unshift(value)
678
+ }else {
679
+ this.state.tabTitles.map((item,index)=>{
680
+ if(item.value == value) {
681
+ tabTitles.splice(index, 1)
682
+ this.setState({
683
+ tabTitles
684
+ })
685
+ }
686
+ })
687
+ }
688
+ if(this.state.tabTitles.length >0) {
689
+ this.setState({
690
+ isSelect: this.state.tabTitles[0].value
691
+ })
692
+ } else {
693
+ this.setState({
694
+ isSelect: 0
695
+ })
696
+ }
697
+ }
635
698
  mountClick = () => {
636
699
  window.IMEvt = msg => {
637
700
  console.log(JSON.parse(msg));
@@ -667,6 +730,7 @@ class Video extends Component {
667
730
  if(Mival.type == 1) {
668
731
  this.switchExternal()
669
732
  } else if(Mival.type == 2) {
733
+ this.tabTitlesClick('RMWhiteboard','delect')
670
734
  if(this.state.isSharedScreen) {
671
735
  this.setState({
672
736
  isWhiteboard: false,
@@ -674,8 +738,6 @@ class Video extends Component {
674
738
  }else {
675
739
  this.test_controller.UnPublish(document.getElementById('video10').name)
676
740
  this.setState({
677
- isPDF: false,
678
- isSelect: 'video',
679
741
  isWhiteboard: false,
680
742
  })
681
743
  }
@@ -881,6 +943,85 @@ class Video extends Component {
881
943
  this.setState({
882
944
  roomCustomerList: newArray
883
945
  })
946
+ let config_param
947
+ if(feed.uid != this.state.tellerAccount) {
948
+ if(feed.tag == 'VIDEO_SOURCE_SCREEN') {
949
+ config_param = {
950
+ subscribe_video_id: 'video11',
951
+ subscribe_audio_id: 'audio11',
952
+ subscribe_streamId_id: 'subscribe_streamId11',
953
+ feedId_id: 'feedId11',
954
+ feedId: feed.feedId
955
+ }
956
+
957
+ this.tabTitlesClick(
958
+ {
959
+ value: 'customerScreen',
960
+ name: '客户投屏'
961
+ },'add'
962
+ )
963
+ } else {
964
+ if(!document.getElementById('video1').name) {
965
+ config_param = {
966
+ subscribe_video_id: 'video1',
967
+ subscribe_audio_id: 'audio1',
968
+ subscribe_streamId_id: 'subscribe_streamId1',
969
+ feedId_id: 'feedId1',
970
+ feedId: feed.feedId
971
+ }
972
+ }
973
+ else if(!document.getElementById('video2').name) {
974
+ config_param = {
975
+ subscribe_video_id: 'video2',
976
+ subscribe_audio_id: 'audio2',
977
+ subscribe_streamId_id: 'subscribe_streamId2',
978
+ feedId_id: 'feedId2',
979
+ feedId: feed.feedId
980
+ }
981
+ }
982
+ else if(!document.getElementById('video3').name) {
983
+ config_param = {
984
+ subscribe_video_id: 'video3',
985
+ subscribe_audio_id: 'audio3',
986
+ subscribe_streamId_id: 'subscribe_streamId3',
987
+ feedId_id: 'feedId3',
988
+ feedId: feed.feedId
989
+ }
990
+ }
991
+ else if(!document.getElementById('video4').name) {
992
+ config_param = {
993
+ subscribe_video_id: 'video4',
994
+ subscribe_audio_id: 'audio4',
995
+ subscribe_streamId_id: 'subscribe_streamId4',
996
+ feedId_id: 'feedId4',
997
+ feedId: feed.feedId
998
+ }
999
+ }
1000
+ else if(!document.getElementById('video5').name) {
1001
+ config_param = {
1002
+ subscribe_video_id: 'video5',
1003
+ subscribe_audio_id: 'audio5',
1004
+ subscribe_streamId_id: 'subscribe_streamId5',
1005
+ feedId_id: 'feedId5',
1006
+ feedId: feed.feedId
1007
+ }
1008
+ }
1009
+ else if(!document.getElementById('video6').name) {
1010
+ config_param = {
1011
+ subscribe_video_id: 'video6',
1012
+ subscribe_audio_id: 'audio6',
1013
+ subscribe_streamId_id: 'subscribe_streamId6',
1014
+ feedId_id: 'feedId6',
1015
+ feedId: feed.feedId
1016
+ }
1017
+ }
1018
+ }
1019
+
1020
+ }
1021
+ if (config_param !== undefined) {
1022
+ config_param.need_volume_analyser = true
1023
+ this.test_controller.Subscribe(config_param)
1024
+ }
884
1025
  };
885
1026
  // 推送“有新订阅”给与会者
886
1027
  this.test_controller.OnNewSubscribe = (subscriber, feed) => {
@@ -899,11 +1040,27 @@ class Video extends Component {
899
1040
  'tellerId': this.props.tellerAccount
900
1041
  })
901
1042
  })
1043
+ this.setState({
1044
+ publishDevic: 1,
1045
+ isSharedScreen: false,
1046
+ screenName: '投屏'
1047
+ });
1048
+ this.tabTitlesClick('RMScreen','delect')
1049
+ if(this.state.isPictureInPicture) {
1050
+ document.exitPictureInPicture()
1051
+ }
902
1052
  }
903
1053
  };
904
1054
  // 取消订阅媒体流成功
905
1055
  this.test_controller.OnUnSubscribeSucc = (sid) => {
906
1056
  console.log('取消订阅媒体流成功', sid)
1057
+ this.state.tabTitles.map((item) => {
1058
+ if(item.value == 'customerScreen') {
1059
+ if(!document.getElementById("video11").name) {
1060
+ this.tabTitlesClick('customerScreen','delect')
1061
+ }
1062
+ }
1063
+ })
907
1064
  if(!document.getElementById("video1").name) {
908
1065
  this.setState({
909
1066
  videoOneName: ''
@@ -1184,18 +1341,9 @@ class Video extends Component {
1184
1341
  canvas.width = this.props.microphoneSize
1185
1342
  canvas.height = this.props.microphoneSize
1186
1343
  let ctx = canvas.getContext("2d");
1187
-
1188
- let outcanvas = document.createElement("canvas");
1189
- outcanvas.width = canvas.width;
1190
- outcanvas.height = canvas.height;
1191
- ctx.strokeStyle = "#db0011";
1192
- ctx.lineWidth = 2;
1193
1344
  ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
1194
- // ctx.fillStyle ='rgba(0, 0, 0, 0.2)';
1195
- // ctx.fillRect(0, 0, canvas.width, canvas.height, )
1196
1345
  let dataArray = new Uint8Array(analyser.frequencyBinCount);
1197
1346
  analyser.getByteFrequencyData(dataArray);
1198
- // console.log('wwww', dataArray.length, document.getElementById('publish_video1').srcObject)
1199
1347
  let step = Math.round(dataArray.length / 60); //采样步长
1200
1348
  var img = document.getElementById("icon_huatong");
1201
1349
  ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
@@ -1218,67 +1366,7 @@ class Video extends Component {
1218
1366
  let startY = y1 - height // 绘制起始点y
1219
1367
  ctx.fillRect(startX, startY, width, height )
1220
1368
  }
1221
-
1222
- //制造半透明投影
1223
- function draw() {
1224
- ctx.drawImage(outcanvas, 0, 0);
1225
- ctx.save();
1226
- ctx.translate(canvas.width / 2, canvas.height / 2);
1227
- ctx.rotate(Math.PI);
1228
- ctx.scale(-1, 1);
1229
- ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
1230
- ctx.restore();
1231
- ctx.fillStyle = 'rgba(192,192,192, .0)';
1232
- ctx.fillRect(0, 0, canvas.width, canvas.height);
1233
- }
1234
-
1235
- draw();
1236
1369
  requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
1237
- // let canvas = document.getElementById(volumeView);
1238
- // let ctx = canvas.getContext("2d");
1239
-
1240
- // let outcanvas = document.createElement("canvas");
1241
- // outcanvas.width = canvas.width;
1242
- // outcanvas.height = canvas.height;
1243
- // ctx.strokeStyle = this.props.voiceColor;
1244
- // ctx.lineWidth = 2;
1245
- // ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
1246
- // let dataArray = new Uint8Array(analyser.frequencyBinCount);
1247
- // analyser.getByteFrequencyData(dataArray);
1248
- // let step = Math.round(dataArray.length / 60); //采样步长
1249
- // for (var i = 0; i < 40; i++) {
1250
- // let energy = (dataArray[step * i] / 256.0) * 50;
1251
- // for (var j = 0; j < energy; j++) {
1252
- // ctx.beginPath();
1253
- // ctx.moveTo(20 * i + 2, 200 + 4 * j);
1254
- // ctx.lineTo(20 * (i + 1) - 2, 200 + 4 * j);
1255
- // ctx.stroke();
1256
- // ctx.beginPath();
1257
- // ctx.moveTo(20 * i + 2, 200 - 4 * j);
1258
- // ctx.lineTo(20 * (i + 1) - 2, 200 - 4 * j);
1259
- // ctx.stroke();
1260
- // }
1261
- // ctx.beginPath();
1262
- // ctx.moveTo(20 * i + 2, 200);
1263
- // ctx.lineTo(20 * (i + 1) - 2, 200);
1264
- // ctx.stroke();
1265
- // }
1266
-
1267
- // //制造半透明投影
1268
- // function draw() {
1269
- // ctx.drawImage(outcanvas, 0, 0);
1270
- // ctx.save();
1271
- // ctx.translate(canvas.width / 4, canvas.height / 2);
1272
- // ctx.rotate(Math.PI);
1273
- // ctx.scale(-1, 1);
1274
- // ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
1275
- // ctx.restore();
1276
- // ctx.fillStyle = 'rgba(192,192,192, .0)';
1277
- // ctx.fillRect(0, 0, canvas.width, canvas.height);
1278
- // }
1279
-
1280
- // draw();
1281
- // requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
1282
1370
  }
1283
1371
  // 停止共享
1284
1372
  this.test_controller.OnDesktopDisplayClosed = () => {
@@ -1430,12 +1518,6 @@ class Video extends Component {
1430
1518
  sessionId: this.props.sessionId
1431
1519
  })
1432
1520
  } else {
1433
- setTimeout(() => {
1434
- this.setState({
1435
- screenName: this.props.intl.formatMessage({ id: 'shareScreen' }),
1436
- suspendName: this.props.intl.formatMessage({ id: 'suspend' }),
1437
- })
1438
- }, 50);
1439
1521
  this.addToScript()
1440
1522
  }
1441
1523
  }
@@ -1463,6 +1545,7 @@ class Video extends Component {
1463
1545
  }, function (code, message, data) {
1464
1546
  console.log(data)
1465
1547
  })
1548
+
1466
1549
  } else if (this.state.voiceStatue) {
1467
1550
  // 打开本地
1468
1551
  this.setState({
@@ -1557,22 +1640,17 @@ class Video extends Component {
1557
1640
  this.test_controller.ChangeMediaStream(publish_config);
1558
1641
  this.setState({
1559
1642
  isPDF: true,
1560
- isSelect: 'noVideo',
1561
1643
  })
1562
1644
  } else {
1563
1645
  this.test_controller.UnPublish(document.getElementById('video10').name)
1564
- this.setState({
1565
- isPDF: false,
1566
- isSelect: 'video',
1567
- })
1568
1646
  }
1569
1647
  this.setState({
1570
1648
  publishDevic: 1,
1571
1649
  isSharedScreen: false,
1572
-
1573
1650
  screenName: '投屏'
1574
1651
  });
1575
1652
  console.log(pictureInPictureVideo)
1653
+ this.tabTitlesClick('RMScreen','delect')
1576
1654
  if(this.state.isPictureInPicture) {
1577
1655
  document.exitPictureInPicture()
1578
1656
  }
@@ -1593,20 +1671,18 @@ class Video extends Component {
1593
1671
  publish_config.publish_tag = 'projectionWhiteboard'
1594
1672
  this.test_controller.Publish(publish_config)
1595
1673
  }
1596
-
1597
-
1598
- // publish_config.media_type = 1;
1599
- // publish_config.publish_device = 2;
1600
- // publish_config.video_profile_type = 5;
1601
- // publish_config.sid = document.getElementById('publish_video1').name;
1602
- // this.test_controller.ChangeMediaStream(publish_config);
1603
1674
  this.setState({
1604
1675
  publishDevic: 2,
1605
- isSelect: 'noVideo',
1606
1676
  isSharedScreen: true,
1607
1677
  screenName: '取消共享',
1608
1678
  isPDF: false
1609
1679
  })
1680
+ this.tabTitlesClick(
1681
+ {
1682
+ value: 'RMScreen',
1683
+ name: '坐席投屏'
1684
+ },'add'
1685
+ )
1610
1686
  if(!this.state.isPictureInPicture) {
1611
1687
  this.pictureInPicture()
1612
1688
  }
@@ -1909,10 +1985,12 @@ class Video extends Component {
1909
1985
  if(!this.state.isWhiteboard) {
1910
1986
  const publish_config = {};
1911
1987
  this.setState({
1912
- isPDF: true,
1913
1988
  isWhiteboard: true,
1914
- isSelect: 'noVideo',
1915
1989
  })
1990
+ this.tabTitlesClick({
1991
+ value: 'RMWhiteboard',
1992
+ name: 'RM白板'
1993
+ },'add')
1916
1994
  if (document.getElementById('video10').name) {
1917
1995
  // 代表已经有了进行切流
1918
1996
  publish_config.publish_device = 4
@@ -1939,21 +2017,24 @@ class Video extends Component {
1939
2017
 
1940
2018
 
1941
2019
  }
1942
- switchSelect = () => {
1943
- if (this.state.isSelect == 'video') {
1944
- if (document.getElementById('video10').name) {
1945
- this.setState({
1946
- isSelect: 'noVideo',
2020
+ switchSelect = (value) => {
2021
+ this.setState({
2022
+ isSelect: value,
1947
2023
  })
1948
- } else {
1949
- message.success('当前无签字白板')
1950
- }
2024
+ // if (this.state.isSelect == 'video') {
2025
+ // if (document.getElementById('video10').name) {
2026
+ // this.setState({
2027
+ // isSelect: 'noVideo',
2028
+ // })
2029
+ // } else {
2030
+ // message.success('当前无签字白板')
2031
+ // }
1951
2032
 
1952
- } else {
1953
- this.setState({
1954
- isSelect: 'video',
1955
- })
1956
- }
2033
+ // } else {
2034
+ // this.setState({
2035
+ // isSelect: 'video',
2036
+ // })
2037
+ // }
1957
2038
  }
1958
2039
  facialHandleVisibleChange=(value)=>{
1959
2040
  if(!value) {
@@ -1970,25 +2051,46 @@ class Video extends Component {
1970
2051
  }
1971
2052
  }
1972
2053
  render() {
2054
+ const {theme} = this.props
1973
2055
  var pdfChildren
1974
2056
  if (this.props.children) {
1975
2057
  pdfChildren = React.cloneElement(this.props.children, { width: 100, height: 100, id: 12 })
1976
2058
  }
2059
+ const customerNameList = (
2060
+ <span>
2061
+ {
2062
+ theme.customers.map((item,index)=>{
2063
+ return <label>
2064
+ {item}
2065
+ {
2066
+ theme.customers.length > 0 && index != theme.customers.length-1 &&<span>,</span>
2067
+ }
2068
+
2069
+ </label>
2070
+ })
2071
+ }
2072
+ </span>
2073
+ )
2074
+ const tabTitleList = (
2075
+ <div className="button">
2076
+ {
2077
+ this.state.tabTitles.map((item)=>{
2078
+ return <div className={`${this.state.isSelect == item.value ? 'selectSee' : "noSelest"}`} onClick={this.switchSelect.bind(this,item.value)}>
2079
+ {item.name}
2080
+ </div>
2081
+ })
2082
+ }
2083
+ </div>
2084
+ )
1977
2085
  return (
1978
2086
  <div className="all">
1979
2087
  <Spin spinning={this.state.loading} tip="视频初始化中...">
1980
2088
  <Header></Header>
1981
- <div className="health">
2089
+ {tabTitleList}
2090
+ <div className="health" style={{'margin-top': (this.state.tabTitles.length > 0) ? '0px' : '20px' }}>
1982
2091
  <div className="projection" style={{ display: (this.state.isCustomer) ? '' : 'none', }}>
1983
- <div className="button">
1984
- <div className={`${this.state.isSelect == 'video' ? 'selectSee' : "noSelest"}`} onClick={this.switchSelect.bind(this)}>视频画面</div>
1985
- <div className={`${this.state.isSelect == 'noVideo' ? 'selectSee' : "noSelest"}`} onClick={this.switchSelect.bind(this)}>投屏白板</div>
1986
- </div>
1987
- <div className="videoDiv" style={{ display: (this.state.isSelect == 'noVideo') ? '' : 'none', }}>
1988
- <div style={{ display: (this.state.isPDF) ? '' : 'none', }} id="touBoxItem">
1989
- {pdfChildren}
1990
- </div>
1991
- <div className="videoDiv" style={this.state.isPDF ? { display: 'none' } : {}}>
2092
+ <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMScreen') ? '' : 'none', }}>
2093
+ <div className="videoDiv">
1992
2094
  <video
1993
2095
  id="video10"
1994
2096
  autoPlay
@@ -1997,18 +2099,86 @@ class Video extends Component {
1997
2099
  />
1998
2100
  <audio id="audio10" autoPlay />
1999
2101
  <label style={{ display: 'none' }} id="feedId10" type="text" />
2000
- {/* <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="subscribe_volumeView10" width="70" height="70"></canvas> */}
2102
+ </div>
2001
2103
 
2104
+ </div>
2105
+ <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMWhiteboard') ? '' : 'none', }}>
2106
+ <div id="touBoxItem">
2107
+ {pdfChildren}
2108
+ </div>
2109
+ </div>
2110
+ <div className="videoDiv" style={{ display: (this.state.isSelect == 'customerScreen') ? '' : 'none', }}>
2111
+ <div className="videoDiv">
2112
+ <video
2113
+ id="video11"
2114
+ autoPlay
2115
+ muted={true}
2116
+ className="video"
2117
+ />
2118
+ <audio id="audio11" autoPlay />
2119
+ <label style={{ display: 'none' }} id="feedId11" type="text" />
2120
+ {/* <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="subscribe_volumeView10" width="70" height="70"></canvas> */}
2002
2121
  </div>
2003
2122
 
2004
2123
  </div>
2124
+ {
2125
+ this.state.tabTitles.length == 0 &&
2126
+ <div className='themeClass'>
2127
+ <div>
2128
+ <ul>
2129
+ <li>
2130
+ <span>会议主题:</span>
2131
+ <label>{theme.title}</label>
2132
+ </li>
2133
+ <li>
2134
+ <span>支持人:</span>
2135
+ <label>{theme.host}</label>
2136
+ </li>
2137
+ <li>
2138
+ <span>参会客户:</span>
2139
+ {customerNameList}
2140
+ </li>
2141
+ </ul>
2142
+ </div>
2143
+ </div>
2144
+ }
2145
+
2146
+
2005
2147
  </div>
2006
- <div className="wrapper">
2148
+ <div className="wrapper" style={{ width: (this.state.isCustomer) ? '20%' : '100%', }}>
2149
+ <div
2150
+ className={`itemed ${this.state.publishDevic == 4 ? '' : (this.state.isBigVideo == 'publish_video1' ? 'isBack' : (this.state.isCustomer ? 'isBack' : ''))} ${this.state.isCustomer ? '' : 'video1Div'}`}
2151
+ >
2152
+ <div className="publishVideoDiv">
2153
+
2154
+ <video
2155
+ id="publish_video1"
2156
+ className={`publishVideoClass ${this.state.isCustomer ? '' : "videoFit"}`}
2157
+ autoPlay
2158
+ muted={true}
2159
+ webkit-playsinline={true}
2160
+ playsinline={true}
2161
+ />
2162
+ <label style={{ display: 'none' }} id="publish_streamId1" type="text" />
2163
+ {
2164
+ this.state.voiceStatue && <img
2165
+ alt=""
2166
+ src={require("../../assets/img/icon_MuteOne.png").default}
2167
+ className="imgClass voiceClass"
2168
+ />
2169
+ }
2170
+ <div id="publish_video_div" style={{ display: (this.state.isCustomer) ? '' : 'none'}} className={`tellerTitle titleSamlle`}>
2171
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>坐席</div>
2172
+ </div>
2173
+ <canvas style={{ display: (this.state.isCustomer && !this.state.voiceStatue) ? '' : 'none', }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
2174
+ </div>
2175
+
2176
+ </div>
2177
+ <div style={{ display: (this.state.isCustomer) ? '' : 'none', }}>
2007
2178
  <div
2008
2179
  className={`itemed ${this.state.isBigVideo == 'video1' ? 'item1' : ""}`}
2009
2180
  // className="itemed item1"
2010
- style={{ position: "relative",'margin-right': '5px'}}
2011
- onClick={this.enlargeClick.bind(this, 'isLangVideo1')}
2181
+ style={{ position: "relative"}}
2012
2182
  >
2013
2183
  {
2014
2184
  this.state.customAudioed && <img
@@ -2019,7 +2189,6 @@ class Video extends Component {
2019
2189
  }
2020
2190
  <div className="video1Div" style={{ display: (!this.state.customAudioed) ? '' : 'none', }}>
2021
2191
  <video
2022
- style={{display: (this.state.isBigVideo == 'video1' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2023
2192
  id="video1"
2024
2193
  autoPlay
2025
2194
  muted={true}
@@ -2027,53 +2196,18 @@ class Video extends Component {
2027
2196
  />
2028
2197
  <audio id="audio1" autoPlay />
2029
2198
  <label style={{ display: 'none' }} id="feedId1" type="text" />
2030
- <div style={{ display: (this.state.videoOneName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video1' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoOneName}</div>
2199
+ <div style={{ display: (this.state.videoOneName) ? '' : 'none'}} className={`customerTitle titleSamlle`}>
2200
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2201
+ {this.state.videoOneName}
2202
+ </div>
2203
+
2204
+
2205
+ </div>
2031
2206
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView1" width="40" height="70"></canvas>
2032
2207
  </div>
2033
2208
  </div>
2034
- <div
2035
- className={`itemed ${this.state.publishDevic == 4 ? '' : (this.state.isBigVideo == 'publish_video1' ? 'item1 isBack' : (this.state.isCustomer ? 'isBack' : 'itemPublic'))}`}
2036
- onClick={this.enlargeClick.bind(this, 'isLangPublishVideo1')}
2037
- >
2038
- <div className="publishVideoDiv">
2039
- {
2040
- this.state.audioed && <img
2041
- alt=""
2042
- src={require("../../assets/img/yingpin.png").default}
2043
- className="imgClass"
2044
- />
2045
- }
2046
- {
2047
- this.state.isSuspend && <img
2048
- alt=""
2049
- src={require("../../assets/img/zanTing.png").default}
2050
- className="imgClass"
2051
- />
2052
- }
2053
- {/* {
2054
- this.state.isSharedScreen && <span
2055
- className="sharedScreen"
2056
- >
2057
- 屏幕共享中
2058
- </span>
2059
- } */}
2209
+ <div className={`itemed`}>
2060
2210
  <video
2061
- style={{ display: (!this.state.audioed && !this.state.isSuspend) ? ((this.state.isBigVideo == 'publish_video1' && this.state.isSelect == 'noVideo') ? 'none' : '') : 'none', }}
2062
- id="publish_video1"
2063
- className={`publishVideoClass ${this.state.isCustomer ? '' : "videoFit"}`}
2064
- onClick={this.enlargeClick.bind(this, 'isLangVideo2')}
2065
- autoPlay
2066
- muted={true}
2067
- />
2068
- {/* <audio id="publish_audio1" autoPlay /> */}
2069
- <label style={{ display: 'none' }} id="publish_streamId1" type="text" />
2070
- <div id="publish_video_div" style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}} className={`tellerTitle ${this.state.isBigVideo == 'publish_video1' ? 'titleBig' : "titleSamlle"}`}>坐席</div>
2071
- <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
2072
- </div>
2073
-
2074
- </div>
2075
- <div className={`itemed ${this.state.isBigVideo == 'video2' ? 'item1' : ""}`} style={{'margin-top': '5px'}} onClick={this.enlargeClick.bind(this, 'isLangVideo2')}>
2076
- <video style={{display: (this.state.isBigVideo == 'video2' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2077
2211
  id="video2"
2078
2212
  autoPlay
2079
2213
  muted={true}
@@ -2081,14 +2215,16 @@ class Video extends Component {
2081
2215
  />
2082
2216
  <audio id="audio2" autoPlay />
2083
2217
  <label style={{ display: 'none' }} id="feedId2" type="text" />
2084
- <div style={{ display: (this.state.videoTwoName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video2' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoTwoName}</div>
2218
+ <div style={{ display: (this.state.videoTwoName) ? '' : 'none'}} className={`customerTitle titleSamlle`}>
2219
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2220
+ {this.state.videoTwoName}
2221
+ </div>
2222
+ </div>
2085
2223
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView2" width="40" height="70"></canvas>
2086
2224
  </div>
2087
- <div className={`itemed ${this.state.isBigVideo == 'video3' ? 'item1' : ""}`}
2088
- style={{'margin-top': '5px' }}
2089
- onClick={this.enlargeClick.bind(this, 'isLangVideo3')}>
2225
+ <div className={`itemed`}
2226
+ style={{'margin-top': '5px' }}>
2090
2227
  <video
2091
- style={{ display: (this.state.isBigVideo == 'video3' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2092
2228
  id="video3"
2093
2229
  autoPlay
2094
2230
  muted={true}
@@ -2096,14 +2232,15 @@ class Video extends Component {
2096
2232
  />
2097
2233
  <audio id="audio3" autoPlay />
2098
2234
  <label style={{ display: 'none' }} id="feedId3" type="text" />
2099
- <div style={{ display: (this.state.videoThreeName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video3' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoThreeName}</div>
2235
+ <div style={{ display: (this.state.videoThreeName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle titleSamlle`}>
2236
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2237
+ {this.state.videoThreeName}
2238
+ </div>
2239
+ </div>
2100
2240
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView3" width="40" height="70"></canvas>
2101
2241
  </div>
2102
- <div className={`itemed ${this.state.isBigVideo == 'video4' ? 'item1' : ""}`}
2103
- style={{'margin-right': '5px'}}
2104
- onClick={this.enlargeClick.bind(this, 'isLangVideo4')}>
2242
+ <div className={`itemed`}>
2105
2243
  <video
2106
- style={{display: (this.state.isBigVideo == 'video4' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2107
2244
  id="video4"
2108
2245
  autoPlay
2109
2246
  muted={true}
@@ -2111,14 +2248,16 @@ class Video extends Component {
2111
2248
  />
2112
2249
  <audio id="audio4" autoPlay />
2113
2250
  <label style={{ display: 'none' }} id="feedId4" type="text" />
2114
- <div style={{ display: (this.state.videoFourName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video4' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoFourName}</div>
2251
+ <div style={{ display: (this.state.videoFourName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle titleSamlle`}>
2252
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2253
+ {this.state.videoFourName}
2254
+ </div>
2255
+ </div>
2115
2256
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView4" width="40" height="70"></canvas>
2116
2257
  </div>
2117
- <div className={`itemed ${this.state.isBigVideo == 'video5' ? 'item1' : ""}`}
2118
- style={{'margin-top': '5px' }}
2119
- onClick={this.enlargeClick.bind(this, 'isLangVideo5')}>
2258
+ <div className={`itemed`}
2259
+ style={{'margin-top': '5px' }}>
2120
2260
  <video
2121
- style={{display: (this.state.isBigVideo == 'video5' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2122
2261
  id="video5"
2123
2262
  autoPlay
2124
2263
  muted={true}
@@ -2126,12 +2265,15 @@ class Video extends Component {
2126
2265
  />
2127
2266
  <audio id="audio5" autoPlay />
2128
2267
  <label style={{ display: 'none' }} id="feedId5" type="text" />
2129
- <div style={{ display: (this.state.videoFiveName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video5' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoFiveName}</div>
2268
+ <div style={{ display: (this.state.videoFiveName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle titleSamlle`}>
2269
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2270
+ {this.state.videoFiveName}
2271
+ </div>
2272
+ </div>
2130
2273
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView5" width="40" height="70"></canvas>
2131
2274
  </div>
2132
- <div onClick={this.enlargeClick.bind(this, 'isLangVideo6')} style={{'margin-top': '5px'}} className={`${this.state.isBigVideo == 'video6' ? 'item1' : "itemed"}`}>
2275
+ <div className={`"itemed"`}>
2133
2276
  <video
2134
- style={{display: (this.state.isBigVideo == 'video6' && this.state.isSelect == 'noVideo') ? 'none' : '' }}
2135
2277
  id="video6"
2136
2278
  autoPlay
2137
2279
  muted={true}
@@ -2139,10 +2281,15 @@ class Video extends Component {
2139
2281
  />
2140
2282
  <audio id="audio6" autoPlay />
2141
2283
  <label style={{ display: 'none' }} id="feedId6" type="text" />
2142
- <div style={{ display: (this.state.videoSixName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle ${this.state.isBigVideo == 'video6' ? 'titleBig' : "titleSamlle"}`}>{this.state.videoSixName}</div>
2284
+ <div style={{ display: (this.state.videoSixName) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className={`customerTitle titleSamlle`}>
2285
+ <div className='titleName' style={{ background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}}>
2286
+ {this.state.videoSixName}
2287
+ </div>
2288
+ </div>
2143
2289
  <canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView6" width="40" height="70"></canvas>
2144
2290
 
2145
2291
  </div>
2292
+ </div>
2146
2293
  </div>
2147
2294
  <img id="icon_huatong" style={{display:'none'}} src={require("../../assets/img/icon_huatong.png").default}></img>
2148
2295
  </div>
@@ -2237,11 +2384,16 @@ Video.defaultProps = {
2237
2384
  resourcePath: 'https://counter-web.leimondata.cn:7199',
2238
2385
  prohibitPrompt: '当前无客户',
2239
2386
  voiceColor: '#0AE544',
2240
- titleBackground: 'rgba(219, 0, 17, 0.1)',
2241
- titleColor: '#DB0011',
2387
+ titleBackground: 'rgba(0,0,0,0.65)',
2388
+ titleColor: '#fff',
2242
2389
  microphoneSize: '50',
2243
2390
  fontSize: '14',
2244
2391
  fontFamily: 'auto',
2245
- defaultData: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP']
2392
+ menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
2393
+ theme: {
2394
+ title: '测试',
2395
+ host: 'wmz',
2396
+ customers: ['王三','张思']
2397
+ }
2246
2398
  }
2247
2399
  export default Video