react_hsbc_teller 1.1.1 → 1.1.4

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.1",
3
+ "version": "1.1.4",
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'>
@@ -30,6 +30,7 @@ const LEAVE_TYPE = {
30
30
  let pictureInPictureVideo
31
31
  let mix_stream
32
32
  let worker
33
+ let streamShare
33
34
  message.config({
34
35
  getContainer: ()=>document.getElementById('allHSBC')
35
36
  })
@@ -157,11 +158,7 @@ class Video extends Component {
157
158
  });
158
159
  console.log(result);
159
160
  this.state.imRoomId = result.imRoomId,
160
- this.state.sessionId = result.sessionId,
161
- this.setState({
162
-
163
- loading: false,
164
- });
161
+ this.state.sessionId = result.sessionId;
165
162
  let publish_config = {}
166
163
  publish_config.media_type = 1
167
164
  publish_config.publish_device = 1
@@ -585,6 +582,9 @@ class Video extends Component {
585
582
  }
586
583
  };
587
584
  endSessionValue = () => {
585
+ if(streamShare) {
586
+ streamShare.getTracks().forEach(track => track.stop());
587
+ }
588
588
  this.finishSession()
589
589
 
590
590
  };
@@ -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
  };
@@ -1582,6 +1588,10 @@ class Video extends Component {
1582
1588
  });
1583
1589
  }
1584
1590
  if(sid == document.getElementById('publish_video1').name) {
1591
+ this.setState({
1592
+
1593
+ loading: false,
1594
+ });
1585
1595
  this.enterRoom()
1586
1596
  this.timer = setInterval(
1587
1597
  () => {
@@ -2832,20 +2842,23 @@ class Video extends Component {
2832
2842
  console.log('投屏')
2833
2843
  if (this.isFileSuccuse()) {
2834
2844
  const publish_config = {};
2845
+ if(streamShare) {
2846
+ streamShare.getTracks().forEach(track => track.stop());
2847
+ }
2835
2848
  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 {
2849
+ // if (this.state.isWhiteboard) {
2850
+ // publish_config.publish_device = 4
2851
+ // publish_config.media_type = 1
2852
+ // publish_config.sid = document.getElementById('video20').name
2853
+ // publish_config.part_of_screen_id = 'touBoxItem'
2854
+ // publish_config.video_profile_type = 5
2855
+ // this.test_controller.ChangeMediaStream(publish_config);
2856
+ // this.setState({
2857
+ // isPDF: true,
2858
+ // })
2859
+ // } else {
2847
2860
  this.test_controller.UnPublish(document.getElementById('video20').name)
2848
- }
2861
+ // }
2849
2862
  this.state.isSharedScreen = false
2850
2863
  this.state.isScreenSwitching = false
2851
2864
  this.setState({
@@ -3266,30 +3279,123 @@ class Video extends Component {
3266
3279
  this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
3267
3280
  )
3268
3281
  }
3282
+ switchExternalAge = ()=>{
3283
+ const that = this
3284
+ if(this.state.isSharedScreen) {
3285
+ this.state.isSharedScreen = false
3286
+ this.setState({
3287
+
3288
+ screenName: '共享模式'
3289
+ });
3290
+ this.tabTitlesClick('RMScreen', 'delect')
3291
+ if (this.state.isPictureInPicture) {
3292
+ document.exitPictureInPicture()
3293
+ }
3294
+ }
3295
+
3296
+ const publish_config = {};
3297
+ const canvas = document.createElement('canvas');
3298
+ const videoMedia = document.getElementById('manedvideo');
3299
+ const cobj = canvas.getContext('2d'); // 获取绘图环境
3300
+ const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3301
+ const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
3302
+ const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3303
+ const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
3304
+ const width = right - left + 10
3305
+ const height = bottom - top - 33
3306
+ canvas.width = width;
3307
+ canvas.height = height;
3308
+ videoMedia.addEventListener('play', (event) =>{
3309
+ var $this = this; //cache
3310
+ console.log('addEventListener',!$this.paused,!$this.ended)
3311
+ loop()
3312
+ function loop() {
3313
+ if (!$this.paused && !$this.ended) {
3314
+ cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
3315
+ setTimeout(loop, 1000 / 10); // drawing at 30fps
3316
+ }
3317
+ }
3318
+
3319
+ if (document.getElementById('video20').name) {
3320
+ // 代表已经有了进行切流
3321
+ publish_config.publish_device = 5
3322
+ publish_config.media_type = 1
3323
+ publish_config.degradationType=2
3324
+ publish_config.sid = document.getElementById('video20').name
3325
+ publish_config.stream = canvas.captureStream(10)
3326
+ publish_config.video_profile_type = 9
3327
+ this.test_controller.ChangeMediaStream(publish_config);
3328
+ } else {
3329
+
3330
+ publish_config.media_type = 1
3331
+ publish_config.publish_device = 5
3332
+ publish_config.need_volume_analyser = true
3333
+ publish_config.video_profile_type = 9
3334
+ publish_config.degradationType=2
3335
+ publish_config.stream = canvas.captureStream(10)
3336
+ publish_config.publish_video_id = 'video20'
3337
+ publish_config.publish_streamId_id = 'subscribe_streamId10'
3338
+ publish_config.publish_tag = 'projectionWhiteboard'
3339
+ this.test_controller.Publish(publish_config)
3340
+ }
3341
+ }, 0);
3342
+ navigator.mediaDevices.getDisplayMedia({
3343
+ video: true,
3344
+ preferCurrentTab:true,
3345
+ })
3346
+ .then((stream) => {
3347
+ videoMedia.srcObject = stream;
3348
+ streamShare = stream
3349
+ stream.getVideoTracks()[0].onended = async ()=>{
3350
+ //单击停止共享按钮后,触发这个事件
3351
+ if(document.getElementById('video20').name && !this.state.isSharedScreen) {
3352
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3353
+ }
3354
+ }
3355
+ }, error => {
3356
+ console.log("Unable to acquire screen capture", error);
3357
+ });
3358
+ }
3269
3359
  switchExternal = () => {
3360
+ const that = this
3270
3361
  if (!this.state.isWhiteboard) {
3271
3362
  const publish_config = {};
3272
- this.state.isWhiteboard = true
3363
+ this.setState({
3364
+ isWhiteboard: true
3365
+ })
3273
3366
  this.tabTitlesClick({
3274
3367
  value: 'RMWhiteboard',
3275
3368
  name: 'RM白板'
3276
3369
  }, 'add')
3277
- const width = this.state.whiteboardWidth;
3278
- const height = this.state.whiteboardHeight;
3370
+ if(this.state.isSharedScreen) {
3371
+ this.state.isSharedScreen = false
3372
+ this.setState({
3373
+
3374
+ screenName: '共享模式'
3375
+ });
3376
+ this.tabTitlesClick('RMScreen', 'delect')
3377
+ if (this.state.isPictureInPicture) {
3378
+ document.exitPictureInPicture()
3379
+ }
3380
+ }
3279
3381
  const canvas = document.createElement('canvas');
3280
3382
  const videoMedia = document.getElementById('manedvideo');
3281
3383
  const cobj = canvas.getContext('2d'); // 获取绘图环境
3282
- const w = window.screen.width;
3283
- const h = window.screen.height;
3384
+ const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3385
+ const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
3386
+ const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3387
+ const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
3388
+ const width = right - left + 10
3389
+ const height = bottom - top - 33
3284
3390
  canvas.width = width;
3285
3391
  canvas.height = height;
3286
3392
  videoMedia.addEventListener('play', (event) =>{
3287
3393
  var $this = this; //cache
3288
- console.log('333111',!$this.paused,!$this.ended)
3394
+ console.log('addEventListener',!$this.paused,!$this.ended)
3289
3395
  loop()
3290
3396
  function loop() {
3291
3397
  if (!$this.paused && !$this.ended) {
3292
- cobj.drawImage(videoMedia, 0, 0, width, height, 0, 0,width, height,);
3398
+ cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
3293
3399
  setTimeout(loop, 1000 / 10); // drawing at 30fps
3294
3400
  }
3295
3401
  }
@@ -3298,16 +3404,18 @@ class Video extends Component {
3298
3404
  // 代表已经有了进行切流
3299
3405
  publish_config.publish_device = 5
3300
3406
  publish_config.media_type = 1
3407
+ publish_config.degradationType=2
3301
3408
  publish_config.sid = document.getElementById('video20').name
3302
3409
  publish_config.stream = canvas.captureStream(10)
3303
- publish_config.video_profile_type = 5
3410
+ publish_config.video_profile_type = 9
3304
3411
  this.test_controller.ChangeMediaStream(publish_config);
3305
3412
  } else {
3306
3413
 
3307
3414
  publish_config.media_type = 1
3308
3415
  publish_config.publish_device = 5
3309
3416
  publish_config.need_volume_analyser = true
3310
- publish_config.video_profile_type = 5
3417
+ publish_config.video_profile_type = 9
3418
+ publish_config.degradationType=2
3311
3419
  publish_config.stream = canvas.captureStream(10)
3312
3420
  publish_config.publish_video_id = 'video20'
3313
3421
  publish_config.publish_streamId_id = 'subscribe_streamId10'
@@ -3316,33 +3424,21 @@ class Video extends Component {
3316
3424
  }
3317
3425
  }, 0);
3318
3426
  navigator.mediaDevices.getDisplayMedia({
3319
- video: true
3427
+ video: true,
3428
+ preferCurrentTab:true,
3320
3429
  })
3321
3430
  .then((stream) => {
3322
3431
  videoMedia.srcObject = stream;
3432
+ streamShare = stream
3433
+ stream.getVideoTracks()[0].onended = async ()=>{
3434
+ //单击停止共享按钮后,触发这个事件
3435
+ if(document.getElementById('video20').name&&!this.state.isSharedScreen) {
3436
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3437
+ }
3438
+ }
3323
3439
  }, error => {
3324
3440
  console.log("Unable to acquire screen capture", error);
3325
3441
  });
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
3442
  } else {
3347
3443
  this.messageClick('当前已经切换RM白板','success')
3348
3444
 
@@ -3405,8 +3501,8 @@ class Video extends Component {
3405
3501
  var box=document.getElementById("whiteboardDIV");
3406
3502
  if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
3407
3503
  this.state.whiteboardWidth = box.offsetWidth,
3408
- this.state.whiteboardHeight = box.offsetHeight,
3409
- console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth)
3504
+ this.state.whiteboardHeight = box.offsetHeight * 0.92,
3505
+ console.log('whiteboardDIV', this.state.whiteboardHeight,box.clientHeight,this.state.whiteboardWidth)
3410
3506
  }
3411
3507
  }
3412
3508
  render() {
@@ -3975,6 +4071,7 @@ class Video extends Component {
3975
4071
  customerList={this.state.customerList}
3976
4072
  clickedOcr={this.state.clickedOcr}
3977
4073
  clickedFacial={this.state.clickedFacial}
4074
+ isWhiteboard={this.state.isWhiteboard}
3978
4075
  {...this.props}
3979
4076
  suspend={this.suspend}
3980
4077
  facialHandleVisibleChange={this.facialHandleVisibleChange}
@@ -3989,7 +4086,7 @@ class Video extends Component {
3989
4086
  invitationClick={this.invitationClick}
3990
4087
  customerFaceClick={this.customerFaceClick}
3991
4088
  ocrClick={this.ocrClick}
3992
- switchExternal={this.switchExternal}
4089
+ switchExternal={this.switchExternalAge}
3993
4090
  inspection={this.inspection}
3994
4091
  screenSwitching={this.screenSwitching}
3995
4092
  ></Foot>
@@ -4048,7 +4145,7 @@ class Video extends Component {
4048
4145
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;姓名:</span><span>{this.state.employeeName}</span>
4049
4146
  </div>
4050
4147
 
4051
- <div className='invitationDiv'>
4148
+ <div className='invitationDiv' style={{ height: '27px'}}>
4052
4149
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
4053
4150
  <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
4151
  </div>
@@ -4081,7 +4178,7 @@ class Video extends Component {
4081
4178
  ></CanvasDraw>
4082
4179
  </div>
4083
4180
  </Modal>
4084
- <Modal title="设置视频设备" closable={false} centered={true} visible={this.state.isModalVisibleInspection} footer={[
4181
+ <Modal title="设置视频设备" width={650} closable={false} centered={true} visible={this.state.isModalVisibleInspection} footer={[
4085
4182
  <div key='inspection'>
4086
4183
  <Button className="modelButtonCancel" onClick={this.handleCancelInspection}>取消</Button>
4087
4184
  <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkInspection}>确定</Button>
@@ -4095,7 +4192,9 @@ class Video extends Component {
4095
4192
  {
4096
4193
  this.state.speakerList.length > 0 &&
4097
4194
  <span>
4098
- <div>扬声器:</div>
4195
+ <div>扬声器:
4196
+ <span className='speakerTitle'>(此为默认选项。若需切换,请在平板电脑右下角任务栏中的Speaker设置中调整)</span>
4197
+ </div>
4099
4198
  {speaker}
4100
4199
  </span>
4101
4200
  }
@@ -144,7 +144,6 @@
144
144
  .invitationDiv{
145
145
  margin-left: 40px;
146
146
  margin-bottom: 15px;
147
- height: 27px;
148
147
  input::-webkit-inner-spin-button {
149
148
  -webkit-appearance: none;
150
149
  appearance: none;
@@ -478,4 +477,7 @@
478
477
  margin: 20px 40px;
479
478
  font-size: 14px;
480
479
  word-break: break-all;
480
+ }
481
+ .speakerTitle{
482
+ color: red;
481
483
  }