react_hsbc_teller 1.7.6 → 1.7.7

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.6",
3
+ "version": "1.7.7",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -15,16 +15,16 @@ roomId: "656467744508298",
15
15
  // sessionId: '',
16
16
  isVideo: false,
17
17
  tellerAccount: '00000000',
18
- callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
19
- // callbackUrl: 'https://aag.wealth-platform.uat.ali.cloud.cn.hsbc/nosaml/api/appointment/wealth/api/v1/appointment/ali/createMeetingRoom',
18
+ // callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
19
+ callbackUrl: 'https://aag.wealth-platform.uat.ali.cloud.cn.hsbc/nosaml/api/appointment/wealth/api/v1/appointment/ali/createMeetingRoom',
20
20
  businessNumber: '',
21
21
  lang: 'zh',
22
- roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
23
- baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
24
- resourcePath: 'https://counter-web.leimondata.cn:7199',
25
- // roomServerUrl: 'wss://app.uat.dsp.hsbcfts.com.cn/mpaas/mrtc/ws',
26
- // baseURL:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/zuul/api/leimon-counter-api',
27
- // resourcePath:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/js/',
22
+ // roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
23
+ // baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
24
+ // resourcePath: 'https://counter-web.leimondata.cn:7199',
25
+ roomServerUrl: 'wss://app.uat.dsp.hsbcfts.com.cn/mpaas/mrtc/ws',
26
+ baseURL:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/zuul/api/leimon-counter-api',
27
+ resourcePath:'https://zuul.uat.dsp.hsbcfts.com.cn/wealth/js/',
28
28
  prohibitPrompt: '无客户',
29
29
  titleBackground: '#40a9ff',
30
30
  titleColor: '#faad14',
@@ -47,6 +47,7 @@ let rateList = []
47
47
  let beautyDiv = {};
48
48
  let isBackgroundBlur = true
49
49
  let isSuccuseHs = false
50
+ let isGraffiti = false
50
51
  let CanvasHome = styled.div`
51
52
  position: fixed;
52
53
  z-index: ${props=>props.zIndexNum};
@@ -94,6 +95,13 @@ function startBeauty(stream) {
94
95
  beautyDiv = meetingBeautifyStream(newStream, beautyNum);
95
96
  newStream = beautyDiv.stream;
96
97
  return newStream
98
+ }
99
+ async function startMix(stream,onState) {
100
+ var drawCanvas = document.getElementById('canvas');
101
+ await mixInit(drawCanvas);
102
+ mixStart(stream,onState);
103
+
104
+
97
105
  }
98
106
  async function startHs(stream) {
99
107
  // var canvas = document.getElementById('publish_video_canvas');
@@ -117,6 +125,18 @@ async function stopHs() {
117
125
  }
118
126
  isSuccuseHs = false
119
127
 
128
+ }
129
+ async function mixStopClick() {
130
+ var stop_stream = true;//控制是否内部来进行关闭流
131
+ var stream = mixStop(stop_stream);
132
+ if (stream != null && stream != undefined) {
133
+ stream.getTracks().forEach((track) => {
134
+ track.stop();
135
+ });
136
+ stream = null;
137
+ }
138
+ isGraffiti = false
139
+
120
140
  }
121
141
  message.config({
122
142
  getContainer: ()=>document.getElementById('allHSBC')
@@ -135,8 +155,10 @@ class Video extends Component {
135
155
  isScreenSwitching: false,
136
156
  whiteboardWidth: '',
137
157
  whiteboardHeight: '',
158
+ widthVideo: '',
138
159
  whiteboardTop: '',
139
160
  whiteboardLeft: '',
161
+ leftVideo: '',
140
162
  laveRoomSharedScreen: false,
141
163
  isJoinRoom: false,
142
164
  sessionType: false,
@@ -425,11 +447,11 @@ class Video extends Component {
425
447
  handleEdit = () => {
426
448
  console.log(JSON.parse(window.sessionStorage.getItem('sigData')));
427
449
  // eslint-disable-next-line no-undef
428
- initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
450
+ // initWebSocket('wss://im.uat.dsp.hsbcfts.com.cn:443/wealth/im/ws/')
429
451
  // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + '15603' + '/ws/');
430
452
  if(!this.state.imStatus){
431
453
  this.state.manualClose = false
432
- // initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
454
+ initWebSocket('wss://' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname + ':' + JSON.parse(window.sessionStorage.getItem('sigData')).webPort + '/ws/');
433
455
 
434
456
  }
435
457
  const config_param = {};
@@ -2199,7 +2221,7 @@ class Video extends Component {
2199
2221
  this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
2200
2222
  console.log('发送失败',msgId,code, msg)
2201
2223
  }
2202
- this.test_controller.StreamFilterHandler = async function (publish_tag, stream, stream_type, publish_device, media_type) {
2224
+ this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) =>{
2203
2225
  console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
2204
2226
  if (stream_type == "subscribe") {
2205
2227
  return stream
@@ -2207,7 +2229,11 @@ class Video extends Component {
2207
2229
  if (media_type == 2 || media_type == 4) {
2208
2230
  return stream
2209
2231
  }
2232
+ // if (publish_device != 2) {
2233
+ // return stream
2234
+ // }
2210
2235
  if(publish_tag == 'tag1') {
2236
+ console.log('tag1',stream)
2211
2237
  let newStream = stream;
2212
2238
  let beauty_strength = beautyNum;
2213
2239
  if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
@@ -2247,6 +2273,43 @@ class Video extends Component {
2247
2273
  newStream.addTrack(stream.getAudioTracks()[0])
2248
2274
  }
2249
2275
  return newStream
2276
+ }
2277
+
2278
+ if(publish_tag == 'projectionWhiteboard' && publish_device == 2) {
2279
+ // this.graffiti()
2280
+ console.log('projectionWhiteboard',stream)
2281
+ let newStream1 = stream;
2282
+ if (stream.getVideoTracks()[0]) {
2283
+ if(this.state.operateShow) {
2284
+ await startMix(newStream1,'mix');
2285
+
2286
+ isGraffiti = true
2287
+ this.setState({
2288
+ zIndexNum: 999
2289
+ })
2290
+ const canvas = document.getElementById('canvas');
2291
+ canvas.width = this.state.widthVideo
2292
+ } else {
2293
+ await startMix(newStream1,'none');
2294
+ }
2295
+
2296
+ newStream1 = mixCaptureStream();
2297
+ console.log('projectionWhiteboard1',newStream1)
2298
+ // 清理原始流
2299
+ newStream1.oninactive = function () {
2300
+ clearOriginStream(stream);
2301
+ };
2302
+ newStream1.getVideoTracks()[0].onended = function () {
2303
+ clearOriginStream(stream);
2304
+ };
2305
+ function clearOriginStream(stream) {
2306
+ stream.getTracks().forEach((track) => {
2307
+ track.stop();
2308
+ });
2309
+ stream = null;
2310
+ }
2311
+ }
2312
+ return newStream1
2250
2313
  } else {
2251
2314
  return stream
2252
2315
  }
@@ -2276,7 +2339,8 @@ class Video extends Component {
2276
2339
  if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
2277
2340
  this.setState({
2278
2341
  whiteboardTop: box.getBoundingClientRect().top * 1.08 - 40,
2279
- whiteboardLeft: box.getBoundingClientRect().left
2342
+ whiteboardLeft: box.getBoundingClientRect().left,
2343
+ leftVideo: (box.offsetWidth - this.state.widthVideo)/2 + box.getBoundingClientRect().left
2280
2344
  })
2281
2345
  console.log('whiteboardDIV',this.state.whiteboardTop,this.state.whiteboardLeft)
2282
2346
  }
@@ -3071,6 +3135,9 @@ class Video extends Component {
3071
3135
  if(isSuccuseHs) {
3072
3136
  stopHs();
3073
3137
  }
3138
+ if(isGraffiti) {
3139
+ mixStopClick()
3140
+ }
3074
3141
 
3075
3142
  console.log('退出房间回调', leaveType);
3076
3143
  };
@@ -3662,7 +3729,8 @@ userType:'1'
3662
3729
  this.props.resourcePath + "/hs/hs_human_segmentation.js",
3663
3730
  this.props.resourcePath + "/hs/hs_human_segmentation.wasm",
3664
3731
 
3665
-
3732
+ this.props.resourcePath + "/mix/mix_frame.js",
3733
+ this.props.resourcePath + "/mix/pageBoard.js"
3666
3734
 
3667
3735
  ]
3668
3736
  const that = this
@@ -4539,6 +4607,14 @@ userType:'1'
4539
4607
 
4540
4608
  videoMedia.addEventListener('play', (event) =>{
4541
4609
  var $this = this; //cache
4610
+ if($this.state.operateShow) {
4611
+ isGraffiti = false
4612
+ this.setState({
4613
+ zIndexNum: 999
4614
+ })
4615
+ const canvas = document.getElementById('canvas');
4616
+ canvas.width = this.state.whiteboardWidth
4617
+ }
4542
4618
  console.log('addEventListener',!$this.paused,!$this.ended,x, y, width, height)
4543
4619
  loop()
4544
4620
  function loop() {
@@ -4599,6 +4675,7 @@ userType:'1'
4599
4675
  })
4600
4676
 
4601
4677
  streamShare = stream
4678
+
4602
4679
  stream.getVideoTracks()[0].onended = async ()=>{
4603
4680
  //单击停止共享按钮后,触发这个事件
4604
4681
  streamShare = ''
@@ -4682,13 +4759,30 @@ userType:'1'
4682
4759
  img.src = base64;
4683
4760
  document.body.appendChild(img);
4684
4761
 
4762
+ }
4763
+ graffitiClick=async()=>{
4764
+ if(!isGraffiti) {
4765
+ if (this.state.tabTitles.find(el=>el.value == 'RMScreen')) {
4766
+ // await startMix(document.getElementById('video20').srcObject);
4767
+ // document.getElementById('video20').srcObject = mixCaptureStream();
4768
+
4769
+ mixSetMode('mix')
4770
+ isGraffiti = true
4771
+ console.log('isGraffiti',isGraffiti)
4772
+ const canvas = document.getElementById('canvas');
4773
+ canvas.width = this.state.widthVideo
4774
+ }
4775
+ }
4776
+
4685
4777
  }
4686
4778
  graffiti=()=>{
4779
+
4687
4780
  if(!this.state.operateShow) {
4688
4781
  this.setState({
4689
4782
  zIndexNum: 999
4690
4783
  })
4691
4784
  this.change(true)
4785
+
4692
4786
  }
4693
4787
 
4694
4788
  }
@@ -4697,6 +4791,13 @@ userType:'1'
4697
4791
  zIndexNum: -1
4698
4792
  })
4699
4793
  this.change(false)
4794
+ if(isGraffiti) {
4795
+ isGraffiti = false
4796
+ mixSetMode('none')
4797
+ console.log('isGraffiti',isGraffiti)
4798
+ // var stream = mixStop(false);
4799
+ // document.getElementById('video20').srcObject = stream
4800
+ }
4700
4801
  }
4701
4802
  change(val) {
4702
4803
  this.setState({ operateShow: val })
@@ -4708,6 +4809,7 @@ userType:'1'
4708
4809
  setTimeout(() => {
4709
4810
  this.openCanvas(canvas)
4710
4811
  }, 0);
4812
+ this.graffitiClick()
4711
4813
  } else {
4712
4814
  // this.downCanvas()
4713
4815
  this.closeCanvas();
@@ -4787,8 +4889,10 @@ userType:'1'
4787
4889
  if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
4788
4890
  this.state.whiteboardWidth = box.offsetWidth,
4789
4891
  this.state.whiteboardHeight = box.offsetHeight * 0.92,
4892
+ this.state.widthVideo = this.state.whiteboardHeight * 1280 / 720
4790
4893
  this.state.whiteboardTop = box.getBoundingClientRect().top * 1.08 - 40
4791
4894
  this.state.whiteboardLeft = box.getBoundingClientRect().left
4895
+ this.state.leftVideo = (box.offsetWidth - this.state.widthVideo)/2 + box.getBoundingClientRect().left
4792
4896
  console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth,this.state.whiteboardTop,this.state.whiteboardLeft)
4793
4897
  }
4794
4898
  }
@@ -5092,7 +5196,7 @@ userType:'1'
5092
5196
  {tabTitleList}
5093
5197
  {/* <img style={sectionStyle} src={require("../../assets/img/placeholder_bg.png").default} alt="" /> */}
5094
5198
  <div id="whiteboardDIV" style={{height: 'calc(100% - 33px)'}}>
5095
- <CanvasHome zIndexNum={this.state.zIndexNum} style={{width: this.state.whiteboardWidth + 'Px',height: this.state.whiteboardHeight + 'Px',top: this.state.whiteboardTop + 'Px',left:this.state.whiteboardLeft + 'Px'}}>
5199
+ <CanvasHome zIndexNum={this.state.zIndexNum} style={{width: isGraffiti ? this.state.widthVideo + 'px' : this.state.whiteboardWidth + 'Px',height: this.state.whiteboardHeight + 'Px',top: this.state.whiteboardTop + 'Px',left: isGraffiti ? this.state.leftVideo + 'px' :this.state.whiteboardLeft + 'Px'}}>
5096
5200
  {this.state.operateShow &&
5097
5201
  <OpreateDiv id="operate">
5098
5202
  <span style={{color: this.state.selectSpan == 'pen' ? '#1890ff' : '#333'}} onClick={() => this.setTool('pen')}>铅笔</span>
@@ -5106,11 +5210,12 @@ userType:'1'
5106
5210
  <canvas id="canvas" className="canvas"></canvas>
5107
5211
  </CanvasHome>
5108
5212
  <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMScreen' || this.state.isSelect == 'staffScreen') ? '' : 'none', }}>
5109
- <div className="videoDiv">
5213
+ <div className="videoDiv" style={{'text-align': 'center'}}>
5110
5214
  <video
5111
5215
  id="video20"
5112
5216
  autoPlay
5113
5217
  muted={true}
5218
+ style={{ height: this.state.whiteboardHeight + 'px',width: this.state.widthVideo + 'px'}}
5114
5219
  className="videoTab"
5115
5220
  disablePictureInPicture
5116
5221
  />