react_hsbc_teller 1.5.7 → 1.6.0

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.5.7",
3
+ "version": "1.6.0",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -161,6 +161,9 @@ createRoomCallback=(data)=>{
161
161
  joinRoomCallback=(data)=>{
162
162
  console.log('joinRoomCallback', data)
163
163
  }
164
+ userExit =(val)=>{
165
+     console.log(val)
166
+ }
164
167
  render() {
165
168
  return (
166
169
  <div className="test">
@@ -192,6 +195,7 @@ joinRoomCallback=(data)=>{
192
195
  createRoomCallback={this.createRoomCallback}
193
196
  joinRoomCallback={this.joinRoomCallback}
194
197
  imgCallback={this.imgCallback}
198
+ userExit={this.userExit}
195
199
  >
196
200
 
197
201
  <Pdf></Pdf>
@@ -2635,9 +2635,9 @@ class Video extends Component {
2635
2635
  screenName: '共享模式'
2636
2636
  });
2637
2637
  this.tabTitlesClick('RMScreen', 'delect')
2638
- if (this.state.isPictureInPicture) {
2639
- document.exitPictureInPicture()
2640
- }
2638
+ // if (this.state.isPictureInPicture) {
2639
+ // document.exitPictureInPicture()
2640
+ // }
2641
2641
 
2642
2642
  }
2643
2643
  };
@@ -2789,12 +2789,20 @@ class Video extends Component {
2789
2789
  console.log('退出房间者', participant, exitType)
2790
2790
  this.appGetUsernameClick(participant).then((res)=>{
2791
2791
  console.log('退出房间者',res)
2792
- let data = res? res : '客户'
2793
- console.log(data)
2794
- this.messageClick(( data + '已退出会议'),'error')
2795
- // let audio = document.createElement('audio') //生成一个audio元素
2796
- // audio.src = 'http://mp3.9ku.com/hot/2005/05-19/65937.mp3' //音乐的路径
2797
- // audio.play()
2792
+ let data = res? res.username ? res.username : '客户' : '客户'
2793
+ console.log(data)
2794
+ this.messageClick(( data + '已退出会议'),'error')
2795
+ if(res.userType == 1) {
2796
+ // 2--坐席  1--客户
2797
+ this.props.userExit({
2798
+ userId: participant,
2799
+ userType:'1'
2800
+ })
2801
+ }
2802
+ // console.log('退出房间者',res)
2803
+ // let data = res? res : '客户'
2804
+ // console.log(data)
2805
+ // this.messageClick(( data + '已退出会议'),'error')
2798
2806
  })
2799
2807
 
2800
2808
  };
@@ -2994,9 +3002,9 @@ class Video extends Component {
2994
3002
  });
2995
3003
  console.log(pictureInPictureVideo)
2996
3004
  this.tabTitlesClick('RMScreen', 'delect')
2997
- if (this.state.isPictureInPicture) {
2998
- document.exitPictureInPicture()
2999
- }
3005
+ // if (this.state.isPictureInPicture) {
3006
+ // document.exitPictureInPicture()
3007
+ // }
3000
3008
  }
3001
3009
  };
3002
3010
  // 服务端录制初始化成功
@@ -3134,9 +3142,9 @@ class Video extends Component {
3134
3142
  });
3135
3143
  console.log(pictureInPictureVideo)
3136
3144
  this.tabTitlesClick('RMScreen', 'delect')
3137
- if (this.state.isPictureInPicture) {
3138
- document.exitPictureInPicture()
3139
- }
3145
+ // if (this.state.isPictureInPicture) {
3146
+ // document.exitPictureInPicture()
3147
+ // }
3140
3148
  // if (!this.state.laveRoomSharedScreen && this.state.isSharedScreen) {
3141
3149
  // this.sharedScreen()
3142
3150
  // }
@@ -3210,6 +3218,9 @@ class Video extends Component {
3210
3218
  clearInterval(value)
3211
3219
  })
3212
3220
  this.timer && clearInterval(this.timer);
3221
+ if (this.state.isPictureInPicture) {
3222
+ document.exitPictureInPicture()
3223
+ }
3213
3224
  if(this.state.isSharedScreen) {
3214
3225
  this.setState({
3215
3226
  screenName: '共享模式',
@@ -3217,9 +3228,7 @@ class Video extends Component {
3217
3228
  this.state.isSharedScreen = false
3218
3229
  this.state.laveRoomSharedScreen = true
3219
3230
  // this.test_controller.UnPublish(document.getElementById('video20').name)
3220
- if (this.state.isPictureInPicture) {
3221
- document.exitPictureInPicture()
3222
- }
3231
+
3223
3232
 
3224
3233
  this.props.onLeaveRoom({
3225
3234
  code: LEAVE_TYPE.TELLER_EXIT,
@@ -3512,6 +3521,7 @@ class Video extends Component {
3512
3521
  // publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
3513
3522
  publish_config.enableDesktopAudio=true
3514
3523
  publish_config.degradationType=2
3524
+ publish_config.desktopStreamToCanvas=true
3515
3525
  publish_config.sid = document.getElementById('video20').name
3516
3526
  this.test_controller.ChangeMediaStream(publish_config)
3517
3527
  this.state.isScreenSwitching = true
@@ -3523,6 +3533,7 @@ class Video extends Component {
3523
3533
  // publish_config.video_profile_type=100
3524
3534
  // publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
3525
3535
  publish_config.enableDesktopAudio=true
3536
+ publish_config.desktopStreamToCanvas=true
3526
3537
  publish_config.degradationType=2
3527
3538
  publish_config.sid = document.getElementById('video20').name;
3528
3539
  this.test_controller.ChangeMediaStream(publish_config);
@@ -3531,6 +3542,7 @@ class Video extends Component {
3531
3542
  publish_config.publish_device = 2
3532
3543
  publish_config.need_volume_analyser = true
3533
3544
  publish_config.video_profile_type = 1
3545
+ publish_config.desktopStreamToCanvas=true
3534
3546
  // publish_config.video_profile_type=100
3535
3547
  // publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
3536
3548
  publish_config.enableDesktopAudio=true
@@ -3852,7 +3864,8 @@ class Video extends Component {
3852
3864
  console.log(result)
3853
3865
 
3854
3866
  if (result.code == 200) {
3855
- data = result.data.username ? result.data.username : ''
3867
+ data = result.data ? result.data : ''
3868
+ // data = result.data.username ? result.data.username : ''
3856
3869
  }
3857
3870
  return data
3858
3871
  }catch (err) {
@@ -4080,18 +4093,18 @@ class Video extends Component {
4080
4093
  let height = 0
4081
4094
  let x = 0
4082
4095
  let y = 0
4083
- // width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4084
- // height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
4085
- // x = (left * window.screen.width / document.body.clientWidth)
4086
- // y = (top* window.screen.width / document.body.clientWidth) + 8
4096
+ width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4097
+ height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
4098
+ x = (left * window.screen.width / document.body.clientWidth)
4099
+ y = (top* window.screen.width / document.body.clientWidth) + 8
4087
4100
  // width = ((right - left)* 1280 / document.body.clientWidth) - 5
4088
4101
  // height = ((bottom - top)* 1280 / document.body.clientWidth) - 30
4089
4102
  // x = (left* 1280 / document.body.clientWidth)
4090
4103
  // y = (top* 1280 / document.body.clientWidth) + 8
4091
- width = ((right - left)) - 5
4092
- height = ((bottom - top)) - 30
4093
- x = (left)
4094
- y = (top) + 8
4104
+ // width = ((right - left)) - 5
4105
+ // height = ((bottom - top)) - 30
4106
+ // x = (left)
4107
+ // y = (top) + 8
4095
4108
  canvas.width = 960;
4096
4109
  canvas.height = 540;
4097
4110
 
@@ -4103,6 +4116,7 @@ class Video extends Component {
4103
4116
  function loop() {
4104
4117
  if (!$this.paused && !$this.ended) {
4105
4118
  // if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
4119
+ console.log('addEventListener',x, y, width, height)
4106
4120
  cobj.drawImage(videoMedia, x, y, width, height, 0, 0,960, 540);
4107
4121
  // } else {
4108
4122
  // cobj.fillStyle = 'rgb(0 0 0)'
@@ -4139,10 +4153,10 @@ class Video extends Component {
4139
4153
  navigator.mediaDevices.getDisplayMedia({
4140
4154
  video: true,
4141
4155
  preferCurrentTab:true,
4142
- video: {
4143
- width: document.body.clientWidth,
4144
- height: document.body.clientHeight
4145
- }
4156
+ // video: {
4157
+ // width: document.body.clientWidth,
4158
+ // height: document.body.clientHeight
4159
+ // }
4146
4160
  })
4147
4161
  .then((stream) => {
4148
4162
  if(streamShare) {
@@ -4150,12 +4164,12 @@ class Video extends Component {
4150
4164
  streamShare = ''
4151
4165
  }
4152
4166
  videoMedia.srcObject = stream;
4153
- // stream.getVideoTracks()[0].applyConstraints({
4154
- // width: 1280,
4155
- // height: 720
4156
- // // width: window.screen.width,
4157
- // // height: window.screen.height
4158
- // })
4167
+ stream.getVideoTracks()[0].applyConstraints({
4168
+ // width: 1280,
4169
+ // height: 720
4170
+ width: window.screen.width,
4171
+ height: window.screen.height
4172
+ })
4159
4173
 
4160
4174
  streamShare = stream
4161
4175
  stream.getVideoTracks()[0].onended = async ()=>{
@@ -4187,9 +4201,9 @@ class Video extends Component {
4187
4201
  screenName: '共享模式'
4188
4202
  });
4189
4203
  this.tabTitlesClick('RMScreen', 'delect')
4190
- if (this.state.isPictureInPicture) {
4191
- document.exitPictureInPicture()
4192
- }
4204
+ // if (this.state.isPictureInPicture) {
4205
+ // document.exitPictureInPicture()
4206
+ // }
4193
4207
  }
4194
4208
  }
4195
4209