react_hsbc_teller 1.1.0 → 1.1.3

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": "1.1.0",
3
+ "version": "1.1.3",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -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'>
@@ -773,7 +773,7 @@ class Video extends Component {
773
773
  cobj.fill();
774
774
  cobj.stroke();
775
775
  cobj.beginPath();
776
- cobj.font = "28px serif";
776
+ cobj.font = "normal lighter 25px sans-serif";
777
777
  cobj.textAlign = 'left';
778
778
  cobj.lineWidth = 1;
779
779
  // 文字
@@ -1155,10 +1155,16 @@ class Video extends Component {
1155
1155
  } else if (Mival.type == 2) {
1156
1156
  this.tabTitlesClick('RMWhiteboard', 'delect')
1157
1157
  if (this.state.isSharedScreen) {
1158
- this.state.isWhiteboard = false
1158
+ this.setState({
1159
+ isWhiteboard: false
1160
+ })
1159
1161
  } else {
1160
- this.test_controller.UnPublish(document.getElementById('video20').name)
1161
- this.state.isWhiteboard = false
1162
+ if(document.getElementById('video20').name) {
1163
+ this.test_controller.UnPublish(document.getElementById('video20').name)
1164
+ }
1165
+ this.setState({
1166
+ isWhiteboard: false
1167
+ })
1162
1168
  }
1163
1169
  }
1164
1170
 
@@ -1527,7 +1533,7 @@ class Video extends Component {
1527
1533
  // 音视频关闭通知
1528
1534
  this.test_controller.OnMediaClose = (code, sid) => {
1529
1535
  console.log(code, sid)
1530
- if((code == 5004 || code == 5007) && document.getElementById('publish_video1').name == sid) {
1536
+ if(code == 5004 || code == 5007) {
1531
1537
  this.roomCallBack(2, '媒体链路连接异常/超时',8)
1532
1538
  }
1533
1539
  };
@@ -2833,19 +2839,19 @@ class Video extends Component {
2833
2839
  if (this.isFileSuccuse()) {
2834
2840
  const publish_config = {};
2835
2841
  if (this.state.isSharedScreen) {
2836
- if (this.state.isWhiteboard) {
2837
- publish_config.publish_device = 4
2838
- publish_config.media_type = 1
2839
- publish_config.sid = document.getElementById('video20').name
2840
- publish_config.part_of_screen_id = 'touBoxItem'
2841
- publish_config.video_profile_type = 5
2842
- this.test_controller.ChangeMediaStream(publish_config);
2843
- this.setState({
2844
- isPDF: true,
2845
- })
2846
- } 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 {
2847
2853
  this.test_controller.UnPublish(document.getElementById('video20').name)
2848
- }
2854
+ // }
2849
2855
  this.state.isSharedScreen = false
2850
2856
  this.state.isScreenSwitching = false
2851
2857
  this.setState({
@@ -3266,30 +3272,122 @@ class Video extends Component {
3266
3272
  this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
3267
3273
  )
3268
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 canvas = document.createElement('canvas');
3291
+ const videoMedia = document.getElementById('manedvideo');
3292
+ const cobj = canvas.getContext('2d'); // 获取绘图环境
3293
+ const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3294
+ const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
3295
+ const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3296
+ const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
3297
+ const width = right - left + 10
3298
+ const height = bottom - top - 33
3299
+ canvas.width = width;
3300
+ canvas.height = height;
3301
+ videoMedia.addEventListener('play', (event) =>{
3302
+ var $this = this; //cache
3303
+ console.log('addEventListener',!$this.paused,!$this.ended)
3304
+ loop()
3305
+ function loop() {
3306
+ if (!$this.paused && !$this.ended) {
3307
+ cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
3308
+ setTimeout(loop, 1000 / 10); // drawing at 30fps
3309
+ }
3310
+ }
3311
+
3312
+ if (document.getElementById('video20').name) {
3313
+ // 代表已经有了进行切流
3314
+ publish_config.publish_device = 5
3315
+ publish_config.media_type = 1
3316
+ publish_config.degradationType=2
3317
+ publish_config.sid = document.getElementById('video20').name
3318
+ publish_config.stream = canvas.captureStream(10)
3319
+ publish_config.video_profile_type = 9
3320
+ this.test_controller.ChangeMediaStream(publish_config);
3321
+ } else {
3322
+
3323
+ publish_config.media_type = 1
3324
+ publish_config.publish_device = 5
3325
+ publish_config.need_volume_analyser = true
3326
+ publish_config.video_profile_type = 9
3327
+ publish_config.degradationType=2
3328
+ publish_config.stream = canvas.captureStream(10)
3329
+ publish_config.publish_video_id = 'video20'
3330
+ publish_config.publish_streamId_id = 'subscribe_streamId10'
3331
+ publish_config.publish_tag = 'projectionWhiteboard'
3332
+ this.test_controller.Publish(publish_config)
3333
+ }
3334
+ }, 0);
3335
+ navigator.mediaDevices.getDisplayMedia({
3336
+ video: true,
3337
+ preferCurrentTab:true,
3338
+ })
3339
+ .then((stream) => {
3340
+ videoMedia.srcObject = stream;
3341
+ stream.getVideoTracks()[0].onended = async ()=>{
3342
+ //单击停止共享按钮后,触发这个事件
3343
+ if(document.getElementById('video20').name && !this.state.isSharedScreen) {
3344
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3345
+ }
3346
+ }
3347
+ }, error => {
3348
+ console.log("Unable to acquire screen capture", error);
3349
+ });
3350
+ }
3269
3351
  switchExternal = () => {
3352
+ const that = this
3270
3353
  if (!this.state.isWhiteboard) {
3271
3354
  const publish_config = {};
3272
- this.state.isWhiteboard = true
3355
+ this.setState({
3356
+ isWhiteboard: true
3357
+ })
3273
3358
  this.tabTitlesClick({
3274
3359
  value: 'RMWhiteboard',
3275
3360
  name: 'RM白板'
3276
3361
  }, 'add')
3277
- const width = this.state.whiteboardWidth;
3278
- const height = this.state.whiteboardHeight;
3362
+ if(this.state.isSharedScreen) {
3363
+ this.state.isSharedScreen = false
3364
+ this.setState({
3365
+
3366
+ screenName: '共享模式'
3367
+ });
3368
+ this.tabTitlesClick('RMScreen', 'delect')
3369
+ if (this.state.isPictureInPicture) {
3370
+ document.exitPictureInPicture()
3371
+ }
3372
+ }
3279
3373
  const canvas = document.createElement('canvas');
3280
3374
  const videoMedia = document.getElementById('manedvideo');
3281
3375
  const cobj = canvas.getContext('2d'); // 获取绘图环境
3282
- const w = window.screen.width;
3283
- const h = window.screen.height;
3376
+ const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3377
+ const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
3378
+ const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3379
+ const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
3380
+ const width = right - left + 10
3381
+ const height = bottom - top - 33
3284
3382
  canvas.width = width;
3285
3383
  canvas.height = height;
3286
3384
  videoMedia.addEventListener('play', (event) =>{
3287
3385
  var $this = this; //cache
3288
- console.log('333111',!$this.paused,!$this.ended)
3386
+ console.log('addEventListener',!$this.paused,!$this.ended)
3289
3387
  loop()
3290
3388
  function loop() {
3291
3389
  if (!$this.paused && !$this.ended) {
3292
- cobj.drawImage(videoMedia, 0, 0, width, height, 0, 0,width, height,);
3390
+ cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
3293
3391
  setTimeout(loop, 1000 / 10); // drawing at 30fps
3294
3392
  }
3295
3393
  }
@@ -3298,16 +3396,18 @@ class Video extends Component {
3298
3396
  // 代表已经有了进行切流
3299
3397
  publish_config.publish_device = 5
3300
3398
  publish_config.media_type = 1
3399
+ publish_config.degradationType=2
3301
3400
  publish_config.sid = document.getElementById('video20').name
3302
3401
  publish_config.stream = canvas.captureStream(10)
3303
- publish_config.video_profile_type = 5
3402
+ publish_config.video_profile_type = 9
3304
3403
  this.test_controller.ChangeMediaStream(publish_config);
3305
3404
  } else {
3306
3405
 
3307
3406
  publish_config.media_type = 1
3308
3407
  publish_config.publish_device = 5
3309
3408
  publish_config.need_volume_analyser = true
3310
- publish_config.video_profile_type = 5
3409
+ publish_config.video_profile_type = 9
3410
+ publish_config.degradationType=2
3311
3411
  publish_config.stream = canvas.captureStream(10)
3312
3412
  publish_config.publish_video_id = 'video20'
3313
3413
  publish_config.publish_streamId_id = 'subscribe_streamId10'
@@ -3316,33 +3416,20 @@ class Video extends Component {
3316
3416
  }
3317
3417
  }, 0);
3318
3418
  navigator.mediaDevices.getDisplayMedia({
3319
- video: true
3419
+ video: true,
3420
+ preferCurrentTab:true,
3320
3421
  })
3321
3422
  .then((stream) => {
3322
3423
  videoMedia.srcObject = stream;
3424
+ stream.getVideoTracks()[0].onended = async ()=>{
3425
+ //单击停止共享按钮后,触发这个事件
3426
+ if(document.getElementById('video20').name&&!this.state.isSharedScreen) {
3427
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3428
+ }
3429
+ }
3323
3430
  }, error => {
3324
3431
  console.log("Unable to acquire screen capture", error);
3325
3432
  });
3326
- // if (document.getElementById('video20').name) {
3327
- // // 代表已经有了进行切流
3328
- // publish_config.publish_device = 4
3329
- // publish_config.media_type = 1
3330
- // publish_config.sid = document.getElementById('video20').name
3331
- // publish_config.part_of_screen_id = 'touBoxItem'
3332
- // publish_config.video_profile_type = 5
3333
- // this.test_controller.ChangeMediaStream(publish_config);
3334
- // } else {
3335
-
3336
- // publish_config.media_type = 1
3337
- // publish_config.publish_device = 4
3338
- // publish_config.need_volume_analyser = true
3339
- // publish_config.video_profile_type = 5
3340
- // publish_config.part_of_screen_id = 'touBoxItem';
3341
- // publish_config.publish_video_id = 'video20'
3342
- // publish_config.publish_streamId_id = 'subscribe_streamId10'
3343
- // publish_config.publish_tag = 'projectionWhiteboard'
3344
- // this.test_controller.Publish(publish_config)
3345
- // }
3346
3433
  } else {
3347
3434
  this.messageClick('当前已经切换RM白板','success')
3348
3435
 
@@ -3405,8 +3492,8 @@ class Video extends Component {
3405
3492
  var box=document.getElementById("whiteboardDIV");
3406
3493
  if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
3407
3494
  this.state.whiteboardWidth = box.offsetWidth,
3408
- this.state.whiteboardHeight = box.offsetHeight,
3409
- console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth)
3495
+ this.state.whiteboardHeight = box.offsetHeight - 33,
3496
+ console.log('whiteboardDIV', this.state.whiteboardHeight,box.clientHeight,this.state.whiteboardWidth)
3410
3497
  }
3411
3498
  }
3412
3499
  render() {
@@ -3538,7 +3625,7 @@ class Video extends Component {
3538
3625
  id="video20"
3539
3626
  autoPlay
3540
3627
  muted={true}
3541
- className="video"
3628
+ className="videoTab"
3542
3629
  />
3543
3630
  <audio id="audio20" autoPlay />
3544
3631
  <label style={{ display: 'none' }} id="feedId20" type="text" />
@@ -3557,7 +3644,7 @@ class Video extends Component {
3557
3644
  id="video21"
3558
3645
  autoPlay
3559
3646
  muted={true}
3560
- className="video"
3647
+ className="videoTab"
3561
3648
  />
3562
3649
  <audio id="audio21" autoPlay />
3563
3650
  <label style={{ display: 'none' }} id="feedId21" type="text" />
@@ -3975,6 +4062,7 @@ class Video extends Component {
3975
4062
  customerList={this.state.customerList}
3976
4063
  clickedOcr={this.state.clickedOcr}
3977
4064
  clickedFacial={this.state.clickedFacial}
4065
+ isWhiteboard={this.state.isWhiteboard}
3978
4066
  {...this.props}
3979
4067
  suspend={this.suspend}
3980
4068
  facialHandleVisibleChange={this.facialHandleVisibleChange}
@@ -3989,7 +4077,7 @@ class Video extends Component {
3989
4077
  invitationClick={this.invitationClick}
3990
4078
  customerFaceClick={this.customerFaceClick}
3991
4079
  ocrClick={this.ocrClick}
3992
- switchExternal={this.switchExternal}
4080
+ switchExternal={this.switchExternalAge}
3993
4081
  inspection={this.inspection}
3994
4082
  screenSwitching={this.screenSwitching}
3995
4083
  ></Foot>
@@ -4048,7 +4136,7 @@ class Video extends Component {
4048
4136
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;姓名:</span><span>{this.state.employeeName}</span>
4049
4137
  </div>
4050
4138
 
4051
- <div className='invitationDiv'>
4139
+ <div className='invitationDiv' style={{ height: '27px'}}>
4052
4140
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
4053
4141
  <Button style={{ display: this.state.employeeName? '' : 'none'}} className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制会议链接</Button>
4054
4142
  </div>
@@ -4095,7 +4183,9 @@ class Video extends Component {
4095
4183
  {
4096
4184
  this.state.speakerList.length > 0 &&
4097
4185
  <span>
4098
- <div>扬声器:</div>
4186
+ <div>扬声器:
4187
+ <span className='speakerTitle'>(请更改系统设置)</span>
4188
+ </div>
4099
4189
  {speaker}
4100
4190
  </span>
4101
4191
  }
@@ -62,6 +62,12 @@
62
62
  object-fit: cover;
63
63
  border-radius: 6px;
64
64
  }
65
+ .videoTab{
66
+ width: 100%;
67
+ height: 100%;
68
+ object-fit: contain;
69
+ border-radius: 6px;
70
+ }
65
71
  .video{
66
72
  width: 100%;
67
73
  height: 100%;
@@ -138,7 +144,6 @@
138
144
  .invitationDiv{
139
145
  margin-left: 40px;
140
146
  margin-bottom: 15px;
141
- height: 27px;
142
147
  input::-webkit-inner-spin-button {
143
148
  -webkit-appearance: none;
144
149
  appearance: none;
@@ -472,4 +477,7 @@
472
477
  margin: 20px 40px;
473
478
  font-size: 14px;
474
479
  word-break: break-all;
480
+ }
481
+ .speakerTitle{
482
+ color: red;
475
483
  }