react_hsbc_teller 1.5.4 → 1.5.5

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.4",
3
+ "version": "1.5.5",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -38,23 +38,6 @@ let muteJson = new Map()
38
38
  let dateTime = 0
39
39
  let messageValue = ''
40
40
  let rateList = []
41
- var os = function() {
42
- var ua = navigator.userAgent,
43
- isWindowsPhone = /(?:Windows Phone)/.test(ua),
44
- isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
45
- isAndroid = /(?:Android)/.test(ua),
46
- isFireFox = /(?:Firefox)/.test(ua),
47
- isChrome = /(?:Chrome|CriOS)/.test(ua),
48
- isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
49
- isPhone = /(?:iPhone)/.test(ua) && !isTablet,
50
- isPc = !isPhone && !isAndroid && !isSymbian;
51
- return {
52
- isTablet: isTablet,
53
- isPhone: isPhone,
54
- isAndroid: isAndroid,
55
- isPc: isPc
56
- };
57
- }();
58
41
  message.config({
59
42
  getContainer: ()=>document.getElementById('allHSBC')
60
43
  })
@@ -62,10 +45,8 @@ message.config({
62
45
  class Video extends Component {
63
46
  constructor(props) {
64
47
  super(props)
65
- // this.cancel = axios.CancelToken.source()
66
48
  }
67
49
  cancel = axios.CancelToken.source()
68
- // signCanvas = React.createRef();
69
50
  state = {
70
51
  signNoClick: false,
71
52
  listVideoPicture: [],
@@ -525,6 +506,7 @@ class Video extends Component {
525
506
  // height: 180
526
507
  // }
527
508
  ]
509
+ Array.isArray(res) ?
528
510
  res.map((item)=>{
529
511
  list.push({
530
512
  tag: item.tag,
@@ -533,6 +515,12 @@ class Video extends Component {
533
515
  width: item.width,
534
516
  height: item.height
535
517
  })
518
+ }) : list.push({
519
+ tag: 'VIDEO_SOURCE_SCREEN',
520
+ xPosition: 1290,
521
+ yPosition: 640,
522
+ width: 630,
523
+ height: 350
536
524
  })
537
525
  const filePath = 'recordId_' + new Date().valueOf();
538
526
  const recordParam = {};
@@ -1711,11 +1699,10 @@ class Video extends Component {
1711
1699
  errorType: -1
1712
1700
  })
1713
1701
  }
1714
- } else if (Mival.typeId == 4100 && Mival.data.sessionId == this.state.sessionId) {
1702
+ } else if (Mival.typeId == 4001) {
1715
1703
  // 手机端停止投屏
1716
- if (!document.getElementById("video21").name) {
1717
- this.tabTitlesClick('customerScreen', 'delect')
1718
- }
1704
+ this.tabTitlesClick('customerScreen', 'delect')
1705
+
1719
1706
  }
1720
1707
  };
1721
1708
  window.IMOpenfire = msg =>{
@@ -1752,9 +1739,9 @@ class Video extends Component {
1752
1739
  this.workerClick()
1753
1740
  rateList = []
1754
1741
  this.rateAll().then((res)=>{
1755
- res.map((item)=>{
1742
+ Array.isArray(res) ? res.map((item)=>{
1756
1743
  rateList.push(item.tag)
1757
- })
1744
+ }) : rateList = []
1758
1745
  console.log('rateList',rateList)
1759
1746
  })
1760
1747
  this.test_controller.GetDevices();
@@ -4105,13 +4092,6 @@ class Video extends Component {
4105
4092
  }
4106
4093
  }
4107
4094
  navigatorClick=()=>{
4108
- if(os.isAndroid || os.isPhone) {
4109
- console.log("手机")
4110
- } else if(os.isTablet) {
4111
- console.log("平板")
4112
- } else if(os.isPc) {
4113
- console.log("电脑")
4114
- }
4115
4095
  const that = this
4116
4096
  const publish_config = {};
4117
4097
  const canvas = document.createElement('canvas');
@@ -4125,23 +4105,13 @@ class Video extends Component {
4125
4105
  let height = 0
4126
4106
  let x = 0
4127
4107
  let y = 0
4128
- // if(os.isTablet){
4129
4108
  width = ((right - left)* window.screen.width / document.body.clientWidth) - 5
4130
4109
  height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 30
4131
4110
  x = (left * window.screen.width / document.body.clientWidth)
4132
4111
  y = (top* window.screen.width / document.body.clientWidth) + 8
4133
- // }
4134
- // if(os.isPc) {
4135
- // width = right - left
4136
- // height = bottom - top
4137
- // x = left
4138
- // y = top
4139
- // }
4140
4112
  canvas.width = 960;
4141
4113
  canvas.height = 540;
4142
- // cobj.fillStyle = 'rgb(255 255 255)'
4143
- // cobj.fillRect(0,0,1280,720)
4144
- // const height1 = document.getElementById("whiteboardDIV").getBoundingClientRect().height* window.screen.height / (document.body.clientHeight + 280)
4114
+
4145
4115
 
4146
4116
  videoMedia.addEventListener('play', (event) =>{
4147
4117
  var $this = this; //cache
@@ -4149,7 +4119,13 @@ class Video extends Component {
4149
4119
  loop()
4150
4120
  function loop() {
4151
4121
  if (!$this.paused && !$this.ended) {
4152
- cobj.drawImage(videoMedia, x, y, width, height, 0, 0,960, 540);
4122
+ // if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
4123
+ cobj.drawImage(videoMedia, x, y, width, height, 0, 0,960, 540);
4124
+ // } else {
4125
+ // cobj.fillStyle = 'rgb(0 0 0)'
4126
+ // cobj.fillRect(0,0,960,540)
4127
+ // }
4128
+
4153
4129
  setTimeout(loop, 1000 / 10); // drawing at 30fps
4154
4130
  }
4155
4131
  }
@@ -4162,7 +4138,6 @@ class Video extends Component {
4162
4138
  publish_config.sid = document.getElementById('video20').name
4163
4139
  publish_config.stream = canvas.captureStream(10)
4164
4140
  publish_config.video_profile_type=1
4165
- // publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
4166
4141
  this.test_controller.ChangeMediaStream(publish_config);
4167
4142
  } else {
4168
4143
 
@@ -4170,7 +4145,6 @@ class Video extends Component {
4170
4145
  publish_config.publish_device = 5
4171
4146
  publish_config.need_volume_analyser = true
4172
4147
  publish_config.video_profile_type=1
4173
- // publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
4174
4148
  publish_config.degradationType=2
4175
4149
  publish_config.stream = canvas.captureStream(10)
4176
4150
  publish_config.publish_video_id = 'video20'
@@ -4189,18 +4163,10 @@ class Video extends Component {
4189
4163
  streamShare = ''
4190
4164
  }
4191
4165
  videoMedia.srcObject = stream;
4192
- // if(os.isTablet){
4193
4166
  stream.getVideoTracks()[0].applyConstraints({
4194
4167
  width: window.screen.width,
4195
4168
  height: window.screen.height
4196
4169
  })
4197
- // }
4198
- // if(os.isPc) {
4199
- // stream.getVideoTracks()[0].applyConstraints({
4200
- // width: document.body.clientWidth,
4201
- // height: document.body.clientHeight - 50
4202
- // })
4203
- // }
4204
4170
 
4205
4171
  streamShare = stream
4206
4172
  stream.getVideoTracks()[0].onended = async ()=>{
@@ -4425,7 +4391,7 @@ class Video extends Component {
4425
4391
  sendNotification = () =>{
4426
4392
  console.log(this.props.shareMask,this.state.shareMaskState)
4427
4393
  this.state.shareMaskState = this.props.shareMask
4428
- setTimeout(() => {
4394
+ // setTimeout(() => {
4429
4395
  callNimIM('sendCustomCmdMsg', {
4430
4396
  customId: this.state.imRoomId,
4431
4397
  content: JSON.stringify({
@@ -4434,7 +4400,7 @@ class Video extends Component {
4434
4400
  'type': this.state.shareMaskState ? 1 : 2
4435
4401
  })
4436
4402
  });
4437
- },100)
4403
+ // },100)
4438
4404
 
4439
4405
  }
4440
4406
  componentDidUpdate(prevProps){