react_hsbc_teller 1.2.4 → 1.2.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.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -2,6 +2,26 @@ import Server from './server';
2
2
 
3
3
  class API extends Server{
4
4
 
5
+ async videoRecordCallback(params = {}){
6
+ // return this.axios('get', '/lang/select/2', params);
7
+ try{
8
+ let result = await this.axios('post', '/hsbc/video/record/callback', params);
9
+ console.log(result)
10
+ if(result && (result.data instanceof Object) && result.code === 200){
11
+ return result||[];
12
+ }else{
13
+ let err = {
14
+ tip: '服务异常',
15
+ response: result,
16
+ data: params,
17
+ // url: 'https://api.cangdu.org/shopro/data/products',
18
+ }
19
+ throw err;
20
+ }
21
+ }catch(err){
22
+ throw err;
23
+ }
24
+ }
5
25
  async retrieveCustomerInfoByActivityId(params = {}){
6
26
  // return this.axios('get', '/lang/select/2', params);
7
27
  try{
Binary file
@@ -69,7 +69,7 @@ export default class foot extends Component {
69
69
  {
70
70
  isWhiteboard&&<div className='footHover' onClick={this.switchExternal.bind(this)}>
71
71
  <div className="one">
72
- <img className="imgClass" src={require("../../assets/img/Projection_screen.png").default} alt="" />
72
+ <img className="imgClass" src={require("../../assets/img/switchExternal.png").default} alt="" />
73
73
  <div className="text">
74
74
  白板
75
75
  </div>
@@ -1650,7 +1650,11 @@ class Video extends Component {
1650
1650
  // 获取设备成功
1651
1651
  this.test_controller.OnGetDevicesSuccess = (devicesInfo) => {
1652
1652
  console.log('devicesInfo' + JSON.stringify(devicesInfo));
1653
- const obj = [];
1653
+ const obj = [
1654
+ // {actionid: '0133d06019b8fe9426818ae7573ccfc31c150e09138e7f5ccfda03d6e224ffd4', groupId: '9c0334ba5cba71b60acb3ec6669c3aac78371ec9d9e33d2e8af72a758d895d27', actionname: 'Integrated Camera (13d3:56fb)'},
1655
+
1656
+ // {actionid: '4695c628677498d876074b941c16f6921d4e57534b50bfc2cb973da84e0e2622', groupId: '0d86c9467f096440ed74449192be5fafea59ac469866975f30b61fe964e2a80e', actionname: 'C2D Camera (0416:5035)'}
1657
+ ];
1654
1658
  const obj1 = [];
1655
1659
  const obj2 = [];
1656
1660
  let num = 0;
@@ -1671,7 +1675,8 @@ class Video extends Component {
1671
1675
  b.actionname = devicesInfo[i].label
1672
1676
  }
1673
1677
  obj.push(b)
1674
- } else if (devicesInfo[i].kind === 'audioinput') {
1678
+ } else
1679
+ if (devicesInfo[i].kind === 'audioinput') {
1675
1680
  // 麦克风
1676
1681
  b.actionid = devicesInfo[i].deviceId;
1677
1682
  b.groupId = devicesInfo[i].groupId || 'empty';
@@ -1731,19 +1736,22 @@ class Video extends Component {
1731
1736
  microphoneList: objList1,
1732
1737
  speakerList: objList2.length>0? [objList2[0]]: []
1733
1738
  })
1739
+ let indexId = 0
1740
+ objList.map((item,index)=>{
1741
+ if(item.actionname.indexOf('Integrated Camera') != -1) {
1742
+ indexId = index
1743
+ }
1744
+ })
1745
+ console.log(indexId)
1746
+ this.setState({
1747
+ cameraValue: objList[indexId].actionid,
1748
+ microphoneValue: objList1[0].actionid
1749
+ })
1734
1750
  if (!this.state.appId && !this.state.sessionType) {
1751
+ console.log('cameraValue',this.state.cameraValue)
1735
1752
  this.mpaasSig(data);
1736
- let indexId = 0
1737
- objList.map((item,index)=>{
1738
- if(item.actionname.indexOf('Integrated Camera') != -1) {
1739
- indexId = index
1740
- }
1741
- })
1742
- this.setState({
1743
- cameraValue: objList[indexId].actionid,
1744
- microphoneValue: objList1[0].actionid
1745
- })
1746
1753
  } else {
1754
+ console.log('cameraValue',this.state.cameraValue)
1747
1755
  this.setState({
1748
1756
  isModalVisibleInspection: true
1749
1757
  })
@@ -1891,7 +1899,7 @@ class Video extends Component {
1891
1899
  this.enterRoom()
1892
1900
  this.timer = setInterval(
1893
1901
  () => {
1894
- if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0) {
1902
+ if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
1895
1903
  callNimIM('sendCustomCmdMsg', {
1896
1904
  customId: this.state.imRoomId,
1897
1905
  content: JSON.stringify({
@@ -2488,11 +2496,15 @@ class Video extends Component {
2488
2496
  // 弱网回调
2489
2497
  this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
2490
2498
  console.log('弱网回调', bpsSend, bpsRecv, sid)
2499
+ if(sid == document.getElementById('publish_video1').name) {
2500
+ this.messageClick('当前网络环境较差','error')
2501
+ }
2491
2502
  };
2492
2503
  // 开始服务端录制成功
2493
2504
  this.test_controller.OnStartRemoteRecordSucc = (record_id) => {
2494
2505
  console.log('开始服务端录制成功', record_id);
2495
2506
  this.state.recordId = record_id
2507
+ this.videoRecordCallback('1')
2496
2508
  };
2497
2509
  // 开始服务端录制失败
2498
2510
  this.test_controller.OnStartRemoteRecordFailed = (
@@ -2505,6 +2517,7 @@ class Video extends Component {
2505
2517
  // 结束服务端录制成功
2506
2518
  this.test_controller.OnStopRemoteRecordSucc = (recordId) => {
2507
2519
  console.log('结束服务端录制成功', recordId);
2520
+ this.videoRecordCallback('2')
2508
2521
  // this.endSessionValue()
2509
2522
  // 获取服务端录制结果
2510
2523
  };
@@ -2766,9 +2779,11 @@ class Video extends Component {
2766
2779
  x2: 22 / 50 * canvas.width, // 波动范围左上角的点坐标
2767
2780
  y2: 10 / 50 * canvas.height,
2768
2781
  }
2769
-
2782
+ let number = 0
2770
2783
  for (var i = 0; i < 40; i++) {
2784
+
2771
2785
  let energy = (dataArray[step * i] / 256.0) * 80;
2786
+ number = number + energy
2772
2787
  ctx.beginPath();
2773
2788
  ctx.fillStyle = this.props.voiceColor;
2774
2789
  const { x1, y1, x2, y2 } = drawArea
@@ -2777,12 +2792,13 @@ class Video extends Component {
2777
2792
  let startX = x2 // 绘制起始点x
2778
2793
  let startY = y1 - height // 绘制起始点y
2779
2794
  ctx.fillRect(startX, startY, width, height)
2780
- if(document.getElementById('publish_video1').name == sid) {
2781
- this.state.analyserHeight.set(sid,dataArray[step * 20] / 256.0)
2795
+ if(document.getElementById('publish_video1').name == sid && i == 39) {
2796
+ console.log(number / 40 / 70,number / 40)
2797
+ this.state.analyserHeight.set(sid,number / 40 / 70)
2782
2798
  this.state.analyserHeight = this.state.analyserHeight
2783
2799
  }
2784
-
2785
2800
  }
2801
+
2786
2802
  this.state.OnVolumeAnalyserMap.set(sid,setInterval(
2787
2803
  this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser),
2788
2804
  300
@@ -2830,6 +2846,21 @@ class Video extends Component {
2830
2846
 
2831
2847
  };
2832
2848
  }
2849
+ videoRecordCallback = async(type)=>{
2850
+ try {
2851
+ let result = await API.videoRecordCallback({
2852
+ activityId: this.props.businessNumber,
2853
+ sessionId: this.state.sessionId,
2854
+ type: type
2855
+ });
2856
+ console.log(result);
2857
+ } catch (err) {
2858
+ console.error(err);
2859
+ if(err.status == 502 || err.status== 404) {
2860
+ this.roomCallBack(2, '连接服务器失败','SYS-02')
2861
+ }
2862
+ }
2863
+ }
2833
2864
  enterRoom = async () =>{
2834
2865
  try {
2835
2866
  let result = await API.enterRoom({