react_hsbc_teller 1.7.5 → 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.5",
3
+ "version": "1.7.6",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
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)}>
@@ -45,7 +45,7 @@ let messageValue = ''
45
45
  let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
46
46
  let rateList = []
47
47
  let beautyDiv = {};
48
- let isBackgroundBlur = false
48
+ let isBackgroundBlur = true
49
49
  let isSuccuseHs = false
50
50
  let CanvasHome = styled.div`
51
51
  position: fixed;
@@ -97,24 +97,25 @@ function startBeauty(stream) {
97
97
  }
98
98
  async function startHs(stream) {
99
99
  // var canvas = document.getElementById('publish_video_canvas');
100
- var video_src = document.getElementById("publish_video1");
101
- var mode = 'blur';
102
- video_src.srcObject = stream;
100
+ // var video_src = document.getElementById("publish_video1");
101
+ // video_src.srcObject = stream;
103
102
 
104
103
  await hsInit();
105
- isSuccuseHs = true;
106
- hsStart(stream, mode);
104
+
105
+ hsStart(stream, 'none');
107
106
 
108
107
  }
109
108
 
110
109
  async function stopHs() {
111
- var video_src = document.getElementById("publish_video1");
112
- if(video_src) {
113
- console.log('video_src',video_src)
114
- video_src.srcObject = null;
115
- isSuccuseHs = false
116
- hsStop();
117
- }
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
118
119
 
119
120
  }
120
121
  message.config({
@@ -2198,42 +2199,59 @@ class Video extends Component {
2198
2199
  this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
2199
2200
  console.log('发送失败',msgId,code, msg)
2200
2201
  }
2201
- // this.test_controller.StreamFilterHandler = async function (publish_tag, stream, stream_type, publish_device, media_type) {
2202
- // console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
2203
- // if (stream_type == "subscribe") {
2204
- // return stream
2205
- // }
2206
- // if (media_type == 2 || media_type == 4) {
2207
- // return stream
2208
- // }
2209
- // if(publish_tag == 'tag1') {
2210
- // let newStream = stream;
2211
- // let beauty_strength = beautyNum;
2212
- // if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
2213
- // newStream = new MediaStream([startBeauty(stream).getVideoTracks()[0]]);
2214
- // // 清理原始流
2215
- // newStream.oninactive = function () {
2216
- // clearOriginStream(stream);
2217
- // };
2218
- // newStream.getVideoTracks()[0].onended = function () {
2219
- // clearOriginStream(stream);
2220
- // };
2221
- // function clearOriginStream(stream) {
2222
- // stream.getTracks().forEach((track) => {
2223
- // track.stop();
2224
- // });
2225
- // stream = null;
2226
- // }
2227
- // };
2228
- // if (stream.getAudioTracks()[0] && newStream.addTrack) {
2229
- // newStream.addTrack(stream.getAudioTracks()[0])
2230
- // }
2231
- // return newStream
2232
- // } else {
2233
- // return stream
2234
- // }
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
+ }
2235
2253
 
2236
- // }
2254
+ }
2237
2255
  // 发布媒体流成功
2238
2256
  this.test_controller.OnPublishSucc = (sid) => {
2239
2257
  console.log('发布媒体流成功', sid)
@@ -3640,9 +3658,9 @@ userType:'1'
3640
3658
  this.props.resourcePath + "/html2canvas.js",
3641
3659
  this.props.resourcePath + "/dom-to-image.js",
3642
3660
 
3643
- // this.props.resourcePath + "/hs/hs_human_segmentation_wrapper.js",
3644
- // this.props.resourcePath + "/hs/hs_human_segmentation.js",
3645
- // this.props.resourcePath + "/hs/hs_human_segmentation.wasm",
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",
3646
3664
 
3647
3665
 
3648
3666
 
@@ -4239,9 +4257,9 @@ userType:'1'
4239
4257
  facialImg: ocrImage,
4240
4258
  },()=>{
4241
4259
  this.setState({
4242
- isModalVisibleFacial: true,
4243
- })
4260
+ isModalVisibleFacial: true,
4244
4261
  })
4262
+ })
4245
4263
  }
4246
4264
  }
4247
4265
  sgsinImage=()=>{
@@ -4906,6 +4924,20 @@ userType:'1'
4906
4924
  });
4907
4925
  },100)
4908
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
+
4909
4941
  }
4910
4942
  handleChangeIdCardName = (event) => {
4911
4943
  this.setState({idCardName: event.target.value});
@@ -5565,6 +5597,7 @@ userType:'1'
5565
5597
  inspection={this.inspection}
5566
5598
  beautyClick={this.beautyClick}
5567
5599
  graffiti={this.graffiti}
5600
+ virtualization={this.virtualization}
5568
5601
  ></Foot>
5569
5602
  <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
5570
5603
  onCancel={this.handleCancel}>
@@ -5737,7 +5770,7 @@ sessionId: "",
5737
5770
  microphoneSize: 25,
5738
5771
  fontSize: '14',
5739
5772
  fontFamily: 'auto',
5740
- menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI'],
5773
+ menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP', 'BEAUTY','GRAFFITI','BACK'],
5741
5774
  customLeaveRoom: '客户离开房间',
5742
5775
  meetingInfo: {
5743
5776
  title: '--',