react_hsbc_teller 1.7.3 → 1.7.6

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.7.3",
3
+ "version": "1.7.6",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
Binary file
Binary file
@@ -56,6 +56,9 @@ export default class foot extends Component {
56
56
  graffiti=()=>{
57
57
  this.props.graffiti()
58
58
  }
59
+ virtualization=()=>{
60
+ this.props.virtualization()
61
+ }
59
62
  render() {
60
63
  const {clickedOcr,clickedFacial,img,isWhiteboard,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName,beautyName} = this.props
61
64
  const content = (
@@ -81,8 +84,7 @@ export default class foot extends Component {
81
84
  </div>
82
85
  </div>
83
86
  </div>
84
- } */}
85
-
87
+ } */}
86
88
  {
87
89
  menus.map((item,index)=>{
88
90
  return <div key={index}className='footHover'>
@@ -95,6 +97,16 @@ export default class foot extends Component {
95
97
  </div>
96
98
  </div>
97
99
  </div>
100
+ }
101
+ {
102
+ item == 'BACK'&&<div className='footHover' onClick={this.virtualization.bind(this)}>
103
+ <div className="one">
104
+ <img className="imgClass" src={require("../../assets/img/beijing.png").default} alt="" />
105
+ <div className="text">
106
+ 背景虚化
107
+ </div>
108
+ </div>
109
+ </div>
98
110
  }
99
111
  {
100
112
  item == 'BOARD'&&<div className='footHover' onClick={this.switchExternal.bind(this)}>
@@ -12,6 +12,7 @@ import voiceImgOpen from '../../assets/img/icon_Mute.png'
12
12
  import voiceImgCloe from '../../assets/img/icon_MuteOne.png'
13
13
  import cameraImgOpen from '../../assets/img/icon_camera.png'
14
14
  import cameraImgCloe from '../../assets/img/icon_cameraOne.png'
15
+ import ocrImage from '../../assets/img/jietu.png'
15
16
  import autod from '../../assets/mp3/joinmeeting.mp3'
16
17
  import leftMetting from '../../assets/mp3/leftmeeting.mp3'
17
18
  import errorPng from '../../assets/img/tooltips2_fail.png'
@@ -44,6 +45,8 @@ let messageValue = ''
44
45
  let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
45
46
  let rateList = []
46
47
  let beautyDiv = {};
48
+ let isBackgroundBlur = true
49
+ let isSuccuseHs = false
47
50
  let CanvasHome = styled.div`
48
51
  position: fixed;
49
52
  z-index: ${props=>props.zIndexNum};
@@ -71,6 +74,7 @@ const OpreateDiv = styled.div`
71
74
  cursor:pointer;
72
75
  }
73
76
  `;
77
+
74
78
  function clearStreamRemain() {
75
79
  if (!(beautyDiv.beauty_canvas == null || beautyDiv.beauty_canvas == undefined)) {
76
80
  beautyDiv.beauty_canvas = null;
@@ -91,6 +95,29 @@ function startBeauty(stream) {
91
95
  newStream = beautyDiv.stream;
92
96
  return newStream
93
97
  }
98
+ async function startHs(stream) {
99
+ // var canvas = document.getElementById('publish_video_canvas');
100
+ // var video_src = document.getElementById("publish_video1");
101
+ // video_src.srcObject = stream;
102
+
103
+ await hsInit();
104
+
105
+ hsStart(stream, 'none');
106
+
107
+ }
108
+
109
+ async function stopHs() {
110
+ var stop_stream = true;//控制是否内部来进行关闭流
111
+ var stream = hsStop(stop_stream);
112
+ if (stream != null && stream != undefined) {
113
+ stream.getTracks().forEach((track) => {
114
+ track.stop();
115
+ });
116
+ stream = null;
117
+ }
118
+ isSuccuseHs = false
119
+
120
+ }
94
121
  message.config({
95
122
  getContainer: ()=>document.getElementById('allHSBC')
96
123
  })
@@ -126,6 +153,7 @@ class Video extends Component {
126
153
  linkData: '',
127
154
  roomCustomerList: [],
128
155
  facialImg: '',
156
+ isFaceImage: false,
129
157
  isModalVisibleFacial: false,
130
158
  isModalVisibleEnd: false,
131
159
  isModalVisible: false,
@@ -397,11 +425,11 @@ class Video extends Component {
397
425
  handleEdit = () => {
398
426
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
399
427
  // eslint-disable-next-line no-undef
400
- // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
428
+ initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
401
429
  // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + '15603' + '/ws/');
402
430
  if(!this.state.imStatus){
403
431
  this.state.manualClose = false
404
- initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
432
+ // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
405
433
 
406
434
  }
407
435
  const config_param = {};
@@ -494,9 +522,9 @@ class Video extends Component {
494
522
  {
495
523
  tag: 'projectionWhiteboard',
496
524
  xPosition: 0,
497
- yPosition: 270,
498
- width: 1280,
499
- height: 720
525
+ yPosition: 175,
526
+ width: 960,
527
+ height: 540
500
528
  },
501
529
  // {
502
530
  // tag: 'VIDEO_SOURCE_SCREEN_ONE',
@@ -516,43 +544,43 @@ class Video extends Component {
516
544
  tag: 'tag1',
517
545
  xPosition: 0,
518
546
  yPosition: 0,
519
- width: 310,
520
- height: 180
547
+ width: 213,
548
+ height: 175
521
549
  },
522
550
  {
523
551
  tag: 'customer1',
524
- xPosition: 320,
552
+ xPosition: 213,
525
553
  yPosition: 0,
526
- width: 310,
527
- height: 180
554
+ width: 213,
555
+ height: 175
528
556
  },
529
557
  {
530
558
  tag: 'customer2',
531
- xPosition: 640,
559
+ xPosition: 426,
532
560
  yPosition: 0,
533
- width: 310,
534
- height: 180
561
+ width: 213,
562
+ height: 175
535
563
  },
536
564
  {
537
565
  tag: 'customer3',
538
- xPosition: 960,
566
+ xPosition: 639,
539
567
  yPosition: 0,
540
- width: 310,
541
- height: 180
568
+ width: 213,
569
+ height: 175
542
570
  },
543
571
  {
544
572
  tag: 'customer4',
545
- xPosition: 1280,
573
+ xPosition: 852,
546
574
  yPosition: 0,
547
- width: 310,
548
- height: 180
575
+ width: 213,
576
+ height: 175
549
577
  },
550
578
  {
551
579
  tag: 'customer5',
552
- xPosition: 1600,
580
+ xPosition: 1065,
553
581
  yPosition: 0,
554
- width: 310,
555
- height: 180
582
+ width: 213,
583
+ height: 175
556
584
  },
557
585
  // {
558
586
  // tag: 'customer6',
@@ -606,17 +634,25 @@ class Video extends Component {
606
634
  width: item.width,
607
635
  height: item.height
608
636
  })
609
- }) : list.push({
637
+ }) :
638
+ list.push({
610
639
  tag: 'VIDEO_SOURCE_SCREEN',
611
- xPosition: 1290,
612
- yPosition: 640,
613
- width: 630,
614
- height: 350
640
+ xPosition: 960,
641
+ yPosition: 535,
642
+ width: 320,
643
+ height: 180
615
644
  })
645
+ // list.push({
646
+ // tag: 'VIDEO_SOURCE_SCREEN_19_9',
647
+ // xPosition: 960,
648
+ // yPosition: 573,
649
+ // width: 304,
650
+ // height: 144
651
+ // })
616
652
  const filePath = 'recordId_' + new Date().valueOf();
617
653
  const recordParam = {};
618
- recordParam.width = 1920;
619
- recordParam.height = 1080;
654
+ recordParam.width = 1280;
655
+ recordParam.height = 720;
620
656
  recordParam.recordTotalStream = 0;
621
657
  recordParam.startTimeout = 10;
622
658
  recordParam.splitType = 0;
@@ -2163,42 +2199,59 @@ class Video extends Component {
2163
2199
  this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
2164
2200
  console.log('发送失败',msgId,code, msg)
2165
2201
  }
2166
- // this.test_controller.StreamFilterHandler = async function (publish_tag, stream, stream_type, publish_device, media_type) {
2167
- // console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
2168
- // if (stream_type == "subscribe") {
2169
- // return stream
2170
- // }
2171
- // if (media_type == 2 || media_type == 4) {
2172
- // return stream
2173
- // }
2174
- // if(publish_tag == 'tag1') {
2175
- // let newStream = stream;
2176
- // let beauty_strength = beautyNum;
2177
- // if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
2178
- // newStream = new MediaStream([startBeauty(stream).getVideoTracks()[0]]);
2179
- // // 清理原始流
2180
- // newStream.oninactive = function () {
2181
- // clearOriginStream(stream);
2182
- // };
2183
- // newStream.getVideoTracks()[0].onended = function () {
2184
- // clearOriginStream(stream);
2185
- // };
2186
- // function clearOriginStream(stream) {
2187
- // stream.getTracks().forEach((track) => {
2188
- // track.stop();
2189
- // });
2190
- // stream = null;
2191
- // }
2192
- // };
2193
- // if (stream.getAudioTracks()[0] && newStream.addTrack) {
2194
- // newStream.addTrack(stream.getAudioTracks()[0])
2195
- // }
2196
- // return newStream
2197
- // } else {
2198
- // return stream
2199
- // }
2202
+ this.test_controller.StreamFilterHandler = async function (publish_tag, stream, stream_type, publish_device, media_type) {
2203
+ console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
2204
+ if (stream_type == "subscribe") {
2205
+ return stream
2206
+ }
2207
+ if (media_type == 2 || media_type == 4) {
2208
+ return stream
2209
+ }
2210
+ if(publish_tag == 'tag1') {
2211
+ let newStream = stream;
2212
+ let beauty_strength = beautyNum;
2213
+ if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
2214
+ newStream = new MediaStream([startBeauty(stream).getVideoTracks()[0]]);
2215
+ // 清理原始流
2216
+ newStream.oninactive = function () {
2217
+ clearOriginStream(stream);
2218
+ };
2219
+ newStream.getVideoTracks()[0].onended = function () {
2220
+ clearOriginStream(stream);
2221
+ };
2222
+ function clearOriginStream(stream) {
2223
+ stream.getTracks().forEach((track) => {
2224
+ track.stop();
2225
+ });
2226
+ stream = null;
2227
+ }
2228
+ };
2229
+ if (stream.getVideoTracks()[0]) {
2230
+ await startHs(newStream);
2231
+ newStream = hsCaptureStream();
2232
+ // 清理原始流
2233
+ newStream.oninactive = function () {
2234
+ clearOriginStream(stream);
2235
+ };
2236
+ newStream.getVideoTracks()[0].onended = function () {
2237
+ clearOriginStream(stream);
2238
+ };
2239
+ function clearOriginStream(stream) {
2240
+ stream.getTracks().forEach((track) => {
2241
+ track.stop();
2242
+ });
2243
+ stream = null;
2244
+ }
2245
+ }
2246
+ if (stream.getAudioTracks()[0] && newStream.addTrack) {
2247
+ newStream.addTrack(stream.getAudioTracks()[0])
2248
+ }
2249
+ return newStream
2250
+ } else {
2251
+ return stream
2252
+ }
2200
2253
 
2201
- // }
2254
+ }
2202
2255
  // 发布媒体流成功
2203
2256
  this.test_controller.OnPublishSucc = (sid) => {
2204
2257
  console.log('发布媒体流成功', sid)
@@ -3015,6 +3068,10 @@ class Video extends Component {
3015
3068
  };
3016
3069
  // 退出房间回调
3017
3070
  this.test_controller.OnLeaveRoom = (leaveType) => {
3071
+ if(isSuccuseHs) {
3072
+ stopHs();
3073
+ }
3074
+
3018
3075
  console.log('退出房间回调', leaveType);
3019
3076
  };
3020
3077
  // 推送“退出房间者”给与会者
@@ -3600,6 +3657,10 @@ userType:'1'
3600
3657
  this.props.resourcePath + "/iconfont.js",
3601
3658
  this.props.resourcePath + "/html2canvas.js",
3602
3659
  this.props.resourcePath + "/dom-to-image.js",
3660
+
3661
+ this.props.resourcePath + "/hs/hs_human_segmentation_wrapper.js",
3662
+ this.props.resourcePath + "/hs/hs_human_segmentation.js",
3663
+ this.props.resourcePath + "/hs/hs_human_segmentation.wasm",
3603
3664
 
3604
3665
 
3605
3666
 
@@ -3994,7 +4055,8 @@ userType:'1'
3994
4055
  idCardName: '',
3995
4056
  titleModal: '人脸识别',
3996
4057
  // clickedFacial: true,
3997
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4058
+ facialImg: ocrImage,
4059
+ isFaceImage: false
3998
4060
  })
3999
4061
  }
4000
4062
 
@@ -4191,26 +4253,27 @@ userType:'1'
4191
4253
  this.setState({
4192
4254
  clickedFacial: false,
4193
4255
  clickedOcr: false,
4256
+ isFaceImage: false,
4257
+ facialImg: ocrImage,
4258
+ },()=>{
4259
+ this.setState({
4194
4260
  isModalVisibleFacial: true,
4195
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
4196
4261
  })
4197
- setTimeout(() => {
4198
- this.setState({
4199
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, sid, 'png')
4200
4262
  })
4201
- },1000)
4202
4263
  }
4203
4264
  }
4204
4265
  sgsinImage=()=>{
4205
4266
  this.setState({
4206
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4267
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4268
+ isFaceImage: true
4207
4269
  })
4208
4270
  }
4209
4271
  handleChangeOcr =(val)=> {
4210
4272
  console.log(val)
4211
4273
  this.setState({
4212
4274
  defaultValue: 1,
4213
- facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png')
4275
+ facialImg: this.test_controller.TakePicture(1, undefined, undefined, this.state.customOcrSid, 'png'),
4276
+ isFaceImage: true
4214
4277
  })
4215
4278
  }
4216
4279
  componentWillReceiveProps(props) {
@@ -4861,6 +4924,20 @@ userType:'1'
4861
4924
  });
4862
4925
  },100)
4863
4926
 
4927
+ }
4928
+ virtualizationClick=async()=>{
4929
+ if(!isSuccuseHs) {
4930
+
4931
+ hsSetMode('blur')
4932
+ isSuccuseHs = true
4933
+ } else {
4934
+ hsSetMode('none')
4935
+ isSuccuseHs = false
4936
+ }
4937
+ }
4938
+ virtualization=()=>{
4939
+ this.virtualizationClick()
4940
+
4864
4941
  }
4865
4942
  handleChangeIdCardName = (event) => {
4866
4943
  this.setState({idCardName: event.target.value});
@@ -5520,6 +5597,7 @@ userType:'1'
5520
5597
  inspection={this.inspection}
5521
5598
  beautyClick={this.beautyClick}
5522
5599
  graffiti={this.graffiti}
5600
+ virtualization={this.virtualization}
5523
5601
  ></Foot>
5524
5602
  <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
5525
5603
  onCancel={this.handleCancel}>
@@ -5541,8 +5619,14 @@ userType:'1'
5541
5619
  <Modal title={this.state.titleModal} closable={false} centered={true} visible={this.state.isModalVisibleFacial} footer={[
5542
5620
  !this.state.idCardName && <div key='facial'>
5543
5621
  <Button className="modelButtonCancel" onClick={this.handleCancelFacial}>取消</Button>
5544
- <Button className="modelButtonCancel" onClick={this.sgsinImage}>重新截图</Button>
5545
- <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5622
+ <Button className="modelButtonCancel" onClick={this.sgsinImage}>截图</Button>
5623
+ {
5624
+ this.state.isFaceImage && <Button className="modelButtonOk" type="primary" danger onClick={this.handleOkFacial}>确定</Button>
5625
+ }
5626
+ {
5627
+ !this.state.isFaceImage && <Button className="modelButtonNo" type="primary" danger>确定</Button>
5628
+ }
5629
+
5546
5630
  </div>,
5547
5631
  this.state.idCardName && <div key='facial'>
5548
5632
  <Button className="modelButtonFaceOk" danger onClick={(e)=>this.confirmCallback('face')}>完成并发起人脸识别</Button>
@@ -5686,7 +5770,7 @@ sessionId: "",
5686
5770
  microphoneSize: 25,
5687
5771
  fontSize: '14',
5688
5772
  fontFamily: 'auto',
5689
- menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI'],
5773
+ menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI','BACK'],
5690
5774
  customLeaveRoom: '客户离开房间',
5691
5775
  meetingInfo: {
5692
5776
  title: '--',
@@ -378,6 +378,15 @@
378
378
  background: #DB0011!important;
379
379
  border-spacing: 20px!important;
380
380
  }
381
+ .modelButtonNo{
382
+ width: 100px!important;
383
+ height: 40px!important;
384
+ font-size: 16px!important;
385
+ color: #5C5C5C!important;
386
+ border: 1px #5C5C5C solid!important;
387
+ background: #d9d9d9!important;
388
+ border-spacing: 20px!important;
389
+ }
381
390
  .modelButtonFaceOk{
382
391
  width: 170px!important;
383
392
  height: 40px!important;