react_hsbc_teller 1.9.28 → 1.9.30

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.9.28",
3
+ "version": "1.9.30",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -154,6 +154,26 @@ class API extends Server{
154
154
  throw err;
155
155
  }
156
156
  }
157
+ async uploadLogCallback(params = {}){
158
+ // return this.axios('get', '/lang/select/2', params);
159
+ try{
160
+ let result = await this.axios('post', '/sessionLog/saveOrUpdate', params);
161
+ // console.log(result)
162
+ if(result && (result.data instanceof Object) && result.code === 200){
163
+ return result||[];
164
+ }else{
165
+ let err = {
166
+ tip: '服务异常',
167
+ response: result,
168
+ data: params,
169
+ // url: 'https://api.cangdu.org/shopro/data/products',
170
+ }
171
+ throw err;
172
+ }
173
+ }catch(err){
174
+ throw err;
175
+ }
176
+ }
157
177
  async retrieveCustomerInfoByActivityId(params = {}){
158
178
  // return this.axios('get', '/lang/select/2', params);
159
179
  try{
@@ -296,7 +296,7 @@ class Video extends Component {
296
296
  saveLog = (val) => {
297
297
  axios({
298
298
  method: 'get',
299
- baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.28&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
299
+ baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.30&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
300
300
 
301
301
  }).then(res => {
302
302
 
@@ -2296,6 +2296,10 @@ class Video extends Component {
2296
2296
  // let audio = new Audio(src)
2297
2297
  // audio.play()
2298
2298
  // }
2299
+ if (participant.includes('UnHint')){
2300
+ console.log('过滤掉的uid', participant)
2301
+ return
2302
+ }
2299
2303
 
2300
2304
 
2301
2305
  this.appGetUsernameClick(participant).then((res) => {
@@ -2493,6 +2497,23 @@ class Video extends Component {
2493
2497
  ) => {
2494
2498
  console.log('下载失败', clientRecordId, code, msg)
2495
2499
  };
2500
+ // 日志上传成功
2501
+ this.test_controller.OnUploadLogSucc = (filePath) => {
2502
+ // const filePath = 'https://mpaas.oss-cn-hk-hsbc-d01-a.ali-ops.cloud.cn.hsbc/log/0E6C7637D9A53DF38D4CFC614EC8915C_41B8EEB302057/wmzTeller_681269134338102_1681269140267_1.log?Expires=1681269740&OSSAccessKeyId=Cq0vGDNN7WQeyn8n&Signature=avYEdwRSdblKIY7LhB6FzwpPAD8%3D'
2503
+
2504
+ console.info('OnUploadLogSucc', filePath)
2505
+ this.saveLog('mrtc OnUploadLogSucc, filePath=' + filePath)
2506
+
2507
+ // const exp1 = /.+\.log/g
2508
+ // const url = filePath.match(exp1)[0]
2509
+ // console.log(url)
2510
+ this.uploadLogCallback(filePath)
2511
+ };
2512
+ this.test_controller.OnUploadLogFail = (code, err_msg) => {
2513
+ // test_controller.trace(`upload log failed, err_code=${code}, err_msg=${JSON.stringify(err_msg)}`);
2514
+ console.info('OnUploadLogFail', code, err_msg)
2515
+ this.saveLog('mrtc OnUploadLogFail, code=' + code, ',msg=' + err_msg)
2516
+ };
2496
2517
  // 切流成功通知
2497
2518
  this.test_controller.OnChangeMediaStreamSuccess = (sid) => {
2498
2519
  console.log('切流成功通知', sid);
@@ -2653,7 +2674,7 @@ class Video extends Component {
2653
2674
  }
2654
2675
  // 停止共享
2655
2676
  this.test_controller.OnDesktopDisplayClosed = () => {
2656
- console.log('OnDesktopDisplayClosed', this.state.isSharedScreen, this.state.laveRoomSharedScreen)
2677
+ console.log('OnDesktopDisplayClosed', this.state.isSharedScreen, this.state.laveRoomSharedScreen, streamShare)
2657
2678
 
2658
2679
  if (this.state.isScreenSwitching) {
2659
2680
  this.state.isScreenSwitching = false
@@ -2699,6 +2720,21 @@ class Video extends Component {
2699
2720
  }
2700
2721
  }
2701
2722
  }
2723
+ uploadLogCallback = async (url) => {
2724
+ try {
2725
+ let result = await API.uploadLogCallback({
2726
+ activityId: this.props.businessNumber,
2727
+ sessionId: this.state.sessionId,
2728
+ roomId: this.state.channelId + '',
2729
+ tellerAccount: this.props.tellerAccount,
2730
+ fileUrl: url
2731
+ });
2732
+ } catch (err) {
2733
+ // console.error(err);
2734
+ if (err.status == 502 || err.status == 404) {
2735
+ }
2736
+ }
2737
+ }
2702
2738
  // 保存mettingInfo
2703
2739
  updateMeetingInfo = async () => {
2704
2740
  let customers
@@ -2935,13 +2971,13 @@ class Video extends Component {
2935
2971
  if (document.all) { //如果是IE
2936
2972
  script.onreadystatechange = () => {
2937
2973
  if (script.readyState == 'loaded' || script.readyState == 'complete') {
2938
- that.test_controller = new McuController();
2974
+ that.test_controller = new MeetingController();
2939
2975
  that.mountClick()
2940
2976
  }
2941
2977
  }
2942
2978
  } else {
2943
2979
  script.onload = () => {
2944
- that.test_controller = new McuController();
2980
+ that.test_controller = new MeetingController();
2945
2981
  that.mountClick()
2946
2982
  }
2947
2983
  }
@@ -2964,7 +3000,7 @@ class Video extends Component {
2964
3000
  }
2965
3001
  }
2966
3002
  componentWillMount() {
2967
- console.log('hsbc_teller_sdk', '1.9.28')
3003
+ console.log('hsbc_teller_sdk', '1.9.30')
2968
3004
  let arr = []
2969
3005
  for(let i=1;i<=12;i++){
2970
3006
  arr.push({
@@ -2978,6 +3014,18 @@ class Video extends Component {
2978
3014
  }
2979
3015
  this.setState({
2980
3016
  videoList: arr
3017
+ }, () => {
3018
+ // 设置播放回调
3019
+ for(let i=1;i<=12;i++){
3020
+ let dom = document.getElementById('video'+ i)
3021
+ dom.addEventListener("loadedmetadata", (event) => {
3022
+ console.log('video'+ i +' loadedmetadata:' + dom.srcObject.id)
3023
+ this.saveLog('video'+ i +' loadedmetadata, id=' + dom.srcObject.id)
3024
+ // let arrItem = this.state.videoList.find(el => el.idIndex == i) || {}
3025
+ // console.log(arrItem.videoName)
3026
+
3027
+ });
3028
+ }
2981
3029
  })
2982
3030
  if (this.props.sessionId) {
2983
3031
  this.getRoomStatus({
@@ -4251,8 +4299,10 @@ class Video extends Component {
4251
4299
  canvas.width = 960;
4252
4300
  canvas.height = 540;
4253
4301
 
4254
-
4255
- videoMedia.addEventListener('play', (event) => {
4302
+ if (this.state.whiteboardPlayEvent) {
4303
+ videoMedia.removeEventListener('play', this.state.whiteboardPlayEvent)
4304
+ }
4305
+ this.state.whiteboardPlayEvent = (event) => {
4256
4306
  var $this = this; //cache
4257
4307
  if ($this.state.operateShow) {
4258
4308
  isGraffiti = false
@@ -4300,7 +4350,8 @@ class Video extends Component {
4300
4350
  publish_config.publish_tag = 'projectionWhiteboard'
4301
4351
  this.test_controller.Publish(publish_config)
4302
4352
  }
4303
- }, 0);
4353
+ }
4354
+ videoMedia.addEventListener('play', this.state.whiteboardPlayEvent);
4304
4355
  navigator.mediaDevices.getDisplayMedia({
4305
4356
  video: true,
4306
4357
  preferCurrentTab: true,
@@ -4332,6 +4383,16 @@ class Video extends Component {
4332
4383
  that.test_controller.UnPublish(document.getElementById('video20').name)
4333
4384
  }
4334
4385
  }
4386
+
4387
+ // 关闭当前共享屏幕
4388
+ document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
4389
+ that.state.isSharedScreen = false
4390
+ that.state.isScreenSwitching = false
4391
+ that.setState({
4392
+ screenName: '共享模式'
4393
+ });
4394
+ that.tabTitlesClick('RMScreen', 'delect')
4395
+
4335
4396
  }, error => {
4336
4397
  console.log("Unable to acquire screen capture", error);
4337
4398
  });
@@ -30,7 +30,26 @@ function compressImage(base64, callback) {
30
30
  callback(base64); //必须通过回调函数返回,否则无法及时拿到该值
31
31
  }
32
32
  }
33
-
33
+ function debounce(fn, delay = 500) {
34
+ // 是闭包中的
35
+ let timer
36
+
37
+ // input事件调用的函数,相当于obj调用函数 this指向Input
38
+ return function() {
39
+ // 这个if 判断不做也没关系,判断了(除第一次非空的情况)也就是执行从第二次开始,在延迟时间内多次触发才会走该判断
40
+ if(timer) {clearTimeout(timer)}
41
+ // 此时的箭头函数的this 和 arguments 都是从外部函数继承而来
42
+ // 如果用普通函数就要用词法作用域 var tshat = this var arg = arguments
43
+ timer = setTimeout(() =>{
44
+ // 使得传入的回调函数的this 指向Input这个元素对象
45
+ // arguments是该事件的详情,可以获得该函数被调用时的所有参数,是一个event 对象(所有Dom事件都会传event对象进入)
46
+ // 直接使用 fn() 问题也不大
47
+ fn.apply(this,arguments)
48
+ timer = null
49
+ },delay)
50
+ }
51
+ }
34
52
  export {
35
- compressImage
53
+ compressImage,
54
+ debounce
36
55
  }