react_hsbc_teller 2.0.97 → 2.0.98

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": "2.0.97",
3
+ "version": "2.0.98",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -66,7 +66,7 @@ import axios from 'axios';
66
66
  import CryptoJS from "crypto-js";
67
67
 
68
68
 
69
- const SDK_VERISON = '2.0.97'
69
+ const SDK_VERISON = '2.0.98'
70
70
  const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
71
71
  const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
72
72
  const { Option } = Select;
@@ -1975,10 +1975,10 @@ class Video extends Component {
1975
1975
  isWhiteboard: false
1976
1976
  })
1977
1977
  } else {
1978
- if (document.getElementById('video20').name) {
1978
+ if (document.getElementById('video20').name || this.state.publishScreenSid) {
1979
1979
  this.saveLog('unPublish share, reason: receive stop whiteboard message 1218')
1980
1980
  console.log('unPublish share, reason: receive stop whiteboard message 1218')
1981
- this.test_controller.UnPublish(document.getElementById('video20').name)
1981
+ this.test_controller.UnPublish(document.getElementById('video20').name || this.state.publishScreenSid)
1982
1982
  if(this.state.drawCanvasInterval) clearInterval(this.state.drawCanvasInterval)
1983
1983
  }
1984
1984
  this.setState({
@@ -3934,6 +3934,7 @@ class Video extends Component {
3934
3934
  }
3935
3935
  if (sid == document.getElementById('video20').name) {
3936
3936
  if (this.state.screenName == '切换共享') {
3937
+ this.state.publishScreenSid = sid
3937
3938
  this.state.isSharedScreen = true
3938
3939
  this.state.isScreenSwitching = false
3939
3940
  this.setSharedScreenState(true)
@@ -3958,7 +3959,7 @@ class Video extends Component {
3958
3959
  } else if (this.state.screenName == '切换共享') {
3959
3960
  this.saveLog('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3960
3961
  console.log('unPublish share, reason: trigger OnChangeMediaStreamFailed')
3961
- this.test_controller.UnPublish(document.getElementById('video20').name)
3962
+ this.test_controller.UnPublish(document.getElementById('video20').name || sid)
3962
3963
  this.state.isSharedScreen = false
3963
3964
  this.state.isScreenSwitching = false
3964
3965
  this.setSharedScreenState(false)
@@ -4109,14 +4110,18 @@ class Video extends Component {
4109
4110
  // 停止共享
4110
4111
  this.test_controller.OnDesktopDisplayClosed = () => {
4111
4112
  console.log('OnDesktopDisplayClosed', this.state.isSharedScreen, this.state.laveRoomSharedScreen, streamShare)
4112
-
4113
4113
  if (this.state.isScreenSwitching) {
4114
4114
  this.state.isScreenSwitching = false
4115
4115
  } else {
4116
4116
  if (!streamShare) {
4117
+ let shareSid = (document.getElementById('video20') && document.getElementById('video20').name) ? document.getElementById('video20').name : this.state.publishScreenSid
4117
4118
  this.saveLog('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
4119
+ this.saveLog('OnDesktopDisplayClosed: publishScreenSid:' + this.state.publishScreenSid + '---' + document.getElementById('video20') + '---' + document.getElementById('video20').name + '----' + 'shareSid:' + shareSid)
4118
4120
  console.log('unPublish share, reason: trigger OnDesktopDisplayClosed, manually click stop or stream onended')
4119
- document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
4121
+ console.log('OnDesktopDisplayClosed: publishScreenSid:' + this.state.publishScreenSid + '---' + document.getElementById('video20') + '---' + document.getElementById('video20').name + '----' + 'shareSid:' + shareSid)
4122
+ if(shareSid) {
4123
+ this.test_controller.UnPublish(shareSid)
4124
+ }
4120
4125
  } else {
4121
4126
  console.log('白板')
4122
4127
  }
@@ -4988,7 +4993,7 @@ class Video extends Component {
4988
4993
  if (this.state.isSharedScreen) {
4989
4994
  this.saveLog('unPublish share, reason: change screen content')
4990
4995
  console.log('unPublish share, reason: change screen content')
4991
- this.test_controller.UnPublish(document.getElementById('video20').name)
4996
+ this.test_controller.UnPublish(document.getElementById('video20').name || this.state.publishScreenSid)
4992
4997
  this.state.shareLock = true;
4993
4998
  setTimeout(() => {
4994
4999
  publish_config.media_type = 1
@@ -5027,10 +5032,10 @@ class Video extends Component {
5027
5032
  // this.test_controller.ChangeMediaStream(publish_config)
5028
5033
  // this.state.isScreenSwitching = true
5029
5034
  } else {
5030
- if (document.getElementById('video20').name) {
5035
+ if (document.getElementById('video20').name || this.state.publishScreenSid) {
5031
5036
  this.saveLog('unPublish share, reason: change screen content')
5032
5037
  console.log('unPublish share, reason: change screen content')
5033
- this.test_controller.UnPublish(document.getElementById('video20').name)
5038
+ this.test_controller.UnPublish(document.getElementById('video20').name || this.state.publishScreenSid)
5034
5039
  this.state.shareLock = true;
5035
5040
  setTimeout(() => {
5036
5041
  publish_config.media_type = 1
@@ -6286,12 +6291,12 @@ class Video extends Component {
6286
6291
 
6287
6292
  this.state.drawCanvasInterval = setInterval($this.drawFunction , 1000/ 20);
6288
6293
 
6289
- if (document.getElementById('video20').name) {
6294
+ if (document.getElementById('video20').name || this.state.publishScreenSid) {
6290
6295
  // 代表已经有了进行切流
6291
6296
  publish_config.publish_device = 5
6292
6297
  publish_config.media_type = 1
6293
6298
  publish_config.degradationType = 2
6294
- publish_config.sid = document.getElementById('video20').name
6299
+ publish_config.sid = document.getElementById('video20').name || this.state.publishScreenSid
6295
6300
  publish_config.stream = canvas.captureStream(10)
6296
6301
  publish_config.video_profile_type = 1
6297
6302
  this.test_controller.ChangeMediaStream(publish_config);
@@ -6338,18 +6343,18 @@ class Video extends Component {
6338
6343
  stream.getVideoTracks()[0].onended = async () => {
6339
6344
  //单击停止共享按钮后,触发这个事件
6340
6345
  streamShare = ''
6341
- if (document.getElementById('video20').name && !this.state.isSharedScreen) {
6346
+ if ((document.getElementById('video20').name || this.state.publishScreenSid) && !this.state.isSharedScreen) {
6342
6347
  console.log('unPublish share, reason: click stop sharing whiteboard or stream onended')
6343
6348
  that.saveLog('unPublish share, reason: click stop sharing whiteboard or stream onended')
6344
- that.test_controller.UnPublish(document.getElementById('video20').name)
6349
+ that.test_controller.UnPublish(document.getElementById('video20').name || this.state.publishScreenSid)
6345
6350
  }
6346
6351
  }
6347
6352
 
6348
6353
  // 关闭当前共享屏幕
6349
- if (document.getElementById('video20') && document.getElementById('video20').name) {
6354
+ if ((document.getElementById('video20') && document.getElementById('video20').name) || this.state.publishScreenSid) {
6350
6355
  console.log('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
6351
6356
  that.saveLog('unPublish share, reason: going to share whiteboard, shared screen needs to be stopped')
6352
- that.test_controller.UnPublish(document.getElementById('video20').name)
6357
+ that.test_controller.UnPublish(document.getElementById('video20').name || this.state.publishScreenSid)
6353
6358
  }
6354
6359
  that.state.isSharedScreen = false
6355
6360
  that.state.isScreenSwitching = false