react_hsbc_teller 0.2.6 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -5,6 +5,7 @@ display: inline-flex;
5
5
  width: 100%;
6
6
  position: absolute;
7
7
  bottom: 0;
8
+ left: 0;
8
9
  }
9
10
  .total{
10
11
  display: inline-flex;
@@ -77,8 +77,8 @@ class Video extends Component {
77
77
  createRoom = async () => {
78
78
  try {
79
79
  let result = await API.createRoom({
80
- tellerAccount: this.props.tellerAccount,
81
- businessNumber: this.props.businessNumber,
80
+ staffId: this.props.tellerAccount,
81
+ activityId: this.props.businessNumber,
82
82
  callbackUrl: this.props.callbackUrl,
83
83
  roomId: this.state.channelId,
84
84
  mtoken: this.state.rtoken
@@ -92,13 +92,20 @@ class Video extends Component {
92
92
  joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
93
93
  this.props.createRoomCallback({
94
94
  type: 1,
95
- errorManage: ''
95
+ errorManage: '',
96
+ data: {
97
+ mtoken: this.state.rtoken,
98
+ imRoomId: result.imRoomId,
99
+ sessionId: result.sessionId,
100
+ roomId: this.state.channelId
101
+ }
96
102
  })
97
103
  } catch (err) {
98
104
  console.error(err);
99
105
  this.props.createRoomCallback({
100
106
  type: 2,
101
- errorManage: '保存房间信息失败'
107
+ errorManage: '保存房间信息失败',
108
+ data: {}
102
109
  })
103
110
  }
104
111
  };
@@ -447,7 +454,33 @@ class Video extends Component {
447
454
  // })
448
455
  // });
449
456
  if (this.isFileSuccuse()) {
450
- const width = 640;
457
+ const list = []
458
+ if(document.getElementById('video1').name) {
459
+ list.push('video1')
460
+ }
461
+ if(document.getElementById('publish_video1').name) {
462
+ list.push('publish_video1')
463
+ }
464
+ if(document.getElementById('video2').name) {
465
+ list.push('video2')
466
+ }
467
+ if(document.getElementById('video3').name) {
468
+ list.push('video3')
469
+ }
470
+ if(document.getElementById('video4').name) {
471
+ list.push('video4')
472
+ }
473
+ if(document.getElementById('video5').name) {
474
+ list.push('video5')
475
+ }
476
+ if(document.getElementById('video6').name) {
477
+ list.push('video6')
478
+ }
479
+ if(document.getElementById('video10').name) {
480
+ list.push('video10')
481
+ }
482
+ console.log(list)
483
+ const width = 320 * list.length;
451
484
  const height = 480;
452
485
  const canvas = document.createElement('canvas');
453
486
  const cobj = canvas.getContext('2d'); // 获取绘图环境
@@ -455,7 +488,9 @@ class Video extends Component {
455
488
  canvas.height = height;
456
489
  let interval = setInterval(() => {
457
490
  cobj.clearRect(0, 0, width, height);
458
- let videoId = 'publish_video1';
491
+ for(let i=0;i<list.length;i++){
492
+
493
+ let videoId = list[i];
459
494
  let videoDiv = document.getElementById(videoId);
460
495
  let videoWidth = videoDiv.videoWidth;
461
496
  let videoHeight = videoDiv.videoHeight;
@@ -466,20 +501,34 @@ class Video extends Component {
466
501
  } else {
467
502
  newVideoHeight = videoHeight * 320 / videoWidth;
468
503
  }
469
- cobj.drawImage(videoDiv, 0, 480 - newVideoHeight, newVideoWidth, newVideoHeight);
470
-
471
- let subscribeVideo = 'video1';
472
- let subscribeVideoDiv = document.getElementById(subscribeVideo);
473
- let subscribeVideoDivWidth = subscribeVideoDiv.videoWidth;
474
- let subscribeVideoDivHeight = subscribeVideoDiv.videoHeight;
475
- let newVideoWidth1 = 320;
476
- let newVideoHeight1 = 480;
477
- if (subscribeVideoDivHeight * 320 / subscribeVideoDivWidth > 480) {
478
- newVideoWidth1 = subscribeVideoDivWidth * 480 / subscribeVideoDivHeight;
479
- } else {
480
- newVideoHeight1 = subscribeVideoDivHeight * 320 / subscribeVideoDivWidth;
504
+ cobj.drawImage(videoDiv, 320 * i, 480 - newVideoHeight, 320, newVideoHeight);
481
505
  }
482
- cobj.drawImage(subscribeVideoDiv, 320, 480 - newVideoHeight1, newVideoWidth1, newVideoHeight);
506
+ // cobj.clearRect(0, 0, width, height);
507
+ // let videoId = 'publish_video1';
508
+ // let videoDiv = document.getElementById(videoId);
509
+ // let videoWidth = videoDiv.videoWidth;
510
+ // let videoHeight = videoDiv.videoHeight;
511
+ // let newVideoWidth = 320;
512
+ // let newVideoHeight = 480;
513
+ // if (videoHeight * 320 / videoWidth > 480) {
514
+ // newVideoWidth = videoWidth * 480 / videoHeight;
515
+ // } else {
516
+ // newVideoHeight = videoHeight * 320 / videoWidth;
517
+ // }
518
+ // cobj.drawImage(videoDiv, 0, 480 - newVideoHeight, newVideoWidth, newVideoHeight);
519
+
520
+ // let subscribeVideo = 'video1';
521
+ // let subscribeVideoDiv = document.getElementById(subscribeVideo);
522
+ // let subscribeVideoDivWidth = subscribeVideoDiv.videoWidth;
523
+ // let subscribeVideoDivHeight = subscribeVideoDiv.videoHeight;
524
+ // let newVideoWidth1 = 320;
525
+ // let newVideoHeight1 = 480;
526
+ // if (subscribeVideoDivHeight * 320 / subscribeVideoDivWidth > 480) {
527
+ // newVideoWidth1 = subscribeVideoDivWidth * 480 / subscribeVideoDivHeight;
528
+ // } else {
529
+ // newVideoHeight1 = subscribeVideoDivHeight * 320 / subscribeVideoDivWidth;
530
+ // }
531
+ // cobj.drawImage(subscribeVideoDiv, 320, 480 - newVideoHeight1, newVideoWidth1, newVideoHeight1);
483
532
 
484
533
  }, 100);
485
534
  const captureStream = canvas.captureStream();
@@ -507,12 +556,14 @@ class Video extends Component {
507
556
  if (this.state.sessionId) {
508
557
  this.props.joinRoomCallback({
509
558
  type: type,
510
- errorManage: manege
559
+ errorManage: manege,
560
+ data: {}
511
561
  })
512
562
  }else {
513
563
  this.props.createRoomCallback({
514
564
  type: type,
515
- errorManage: manege
565
+ errorManage: manege,
566
+ data: {}
516
567
  })
517
568
  }
518
569
  }
@@ -1694,7 +1745,7 @@ class Video extends Component {
1694
1745
  <div style={{ display: (this.state.isPDF) ? '' : 'none', }} id="touBoxItem">
1695
1746
  {pdfChildren}
1696
1747
  </div>
1697
- <div style={this.state.isPDF ? { display: 'none' } : {}}>
1748
+ <div className="videoDiv" style={this.state.isPDF ? { display: 'none' } : {}}>
1698
1749
  <video
1699
1750
  id="video10"
1700
1751
  autoPlay
@@ -1916,7 +1967,7 @@ class Video extends Component {
1916
1967
  ></CanvasDraw>
1917
1968
  </div>
1918
1969
  </Modal>
1919
- <video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="0" height="0"
1970
+ <video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="400" height="400"
1920
1971
  webkit-playsinline="true" playsInline={true} x5-playsinline="x5-playsinline"
1921
1972
  x-webkit-airplay="true"></video>
1922
1973
  </Spin>
@@ -5,6 +5,7 @@
5
5
  .mixedvideo{
6
6
  display: none;
7
7
  position:absolute;
8
+ object-fit: cover
8
9
  }
9
10
  .imgClass{
10
11
  width: 100%;