react_hsbc_teller 1.2.4 → 1.2.7

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.
@@ -35,6 +35,7 @@ let pictureInPictureVideo
35
35
  let mix_stream
36
36
  let worker
37
37
  let streamShare
38
+ let muteJson = new Map()
38
39
  message.config({
39
40
  getContainer: ()=>document.getElementById('allHSBC')
40
41
  })
@@ -310,6 +311,7 @@ class Video extends Component {
310
311
  // 初始化视频
311
312
  ConnectMRTC = () => {
312
313
  this.test_controller.SetLocalCodecType("H264")
314
+ this.test_controller.SetPublishWeakBitrateLimit(200);
313
315
  const config_param = {};
314
316
  config_param.auto_publish_subscribe = 4;
315
317
  config_param.media_type = 1;
@@ -1442,7 +1444,9 @@ class Video extends Component {
1442
1444
 
1443
1445
  } else if (Mival.typeId == 3100) {
1444
1446
  if (Mival.data.sessionId == this.state.sessionId) {
1447
+ muteJson.set(Mival.data.userId, JSON.stringify(Mival))
1445
1448
  if (Mival.data.userId == this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid) {
1449
+ muteJson.delete(Mival.data.userId)
1446
1450
  if (Mival.muteStatus == 0) {
1447
1451
  this.setState({
1448
1452
  voiceVideoOne: false
@@ -1455,6 +1459,7 @@ class Video extends Component {
1455
1459
 
1456
1460
  }
1457
1461
  if (Mival.data.userId == (document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : '')) {
1462
+ muteJson.delete(Mival.data.userId)
1458
1463
  if (Mival.muteStatus == 0) {
1459
1464
  this.setState({
1460
1465
  voiceVideoTwo: false
@@ -1467,6 +1472,7 @@ class Video extends Component {
1467
1472
 
1468
1473
  }
1469
1474
  if (Mival.data.userId == (document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : '')) {
1475
+ muteJson.delete(Mival.data.userId)
1470
1476
  if (Mival.muteStatus == 0) {
1471
1477
  this.setState({
1472
1478
  voiceVideoThree: false
@@ -1479,6 +1485,7 @@ class Video extends Component {
1479
1485
 
1480
1486
  }
1481
1487
  if (Mival.data.userId == (document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : '')) {
1488
+ muteJson.delete(Mival.data.userId)
1482
1489
  if (Mival.muteStatus == 0) {
1483
1490
  this.setState({
1484
1491
  voiceVideoFour: false
@@ -1491,6 +1498,7 @@ class Video extends Component {
1491
1498
 
1492
1499
  }
1493
1500
  if (Mival.data.userId == (document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : '')) {
1501
+ muteJson.delete(Mival.data.userId)
1494
1502
  if (Mival.muteStatus == 0) {
1495
1503
  this.setState({
1496
1504
  voiceVideoFive: false
@@ -1503,6 +1511,7 @@ class Video extends Component {
1503
1511
 
1504
1512
  }
1505
1513
  if (Mival.data.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1514
+ muteJson.delete(Mival.data.userId)
1506
1515
  if (Mival.muteStatus == 0) {
1507
1516
  this.setState({
1508
1517
  voiceVideoSix: false
@@ -1515,31 +1524,8 @@ class Video extends Component {
1515
1524
 
1516
1525
  }
1517
1526
 
1518
- if (Mival.data.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1519
- if (Mival.muteStatus == 0) {
1520
- this.setState({
1521
- voiceVideoSix: false
1522
- })
1523
- } else if (Mival.muteStatus == 1) {
1524
- this.setState({
1525
- voiceVideoSix: true
1526
- })
1527
- }
1528
-
1529
- }
1530
- if (Mival.data.userId == (document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
1531
- if (Mival.muteStatus == 0) {
1532
- this.setState({
1533
- voiceVideoSix: false
1534
- })
1535
- } else if (Mival.muteStatus == 1) {
1536
- this.setState({
1537
- voiceVideoSix: true
1538
- })
1539
- }
1540
-
1541
- }
1542
1527
  if (Mival.data.userId == (document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : '')) {
1528
+ muteJson.delete(Mival.data.userId)
1543
1529
  if (Mival.muteStatus == 0) {
1544
1530
  this.setState({
1545
1531
  voiceVideoSeven: false
@@ -1552,6 +1538,7 @@ class Video extends Component {
1552
1538
 
1553
1539
  }
1554
1540
  if (Mival.data.userId == (document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : '')) {
1541
+ muteJson.delete(Mival.data.userId)
1555
1542
  if (Mival.muteStatus == 0) {
1556
1543
  this.setState({
1557
1544
  voiceVideoEight: false
@@ -1564,6 +1551,7 @@ class Video extends Component {
1564
1551
 
1565
1552
  }
1566
1553
  if (Mival.data.userId == (document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : '')) {
1554
+ muteJson.delete(Mival.data.userId)
1567
1555
  if (Mival.muteStatus == 0) {
1568
1556
  this.setState({
1569
1557
  voiceVideoNine: false
@@ -1576,6 +1564,7 @@ class Video extends Component {
1576
1564
 
1577
1565
  }
1578
1566
  if (Mival.data.userId == (document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : '')) {
1567
+ muteJson.delete(Mival.data.userId)
1579
1568
  if (Mival.muteStatus == 0) {
1580
1569
  this.setState({
1581
1570
  voiceVideoTen: false
@@ -1588,6 +1577,7 @@ class Video extends Component {
1588
1577
 
1589
1578
  }
1590
1579
  if (Mival.data.userId == (document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : '')) {
1580
+ muteJson.delete(Mival.data.userId)
1591
1581
  if (Mival.muteStatus == 0) {
1592
1582
  this.setState({
1593
1583
  voiceVideoEleven: false
@@ -1600,6 +1590,7 @@ class Video extends Component {
1600
1590
 
1601
1591
  }
1602
1592
  if (Mival.data.userId == (document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : '')) {
1593
+ muteJson.delete(Mival.data.userId)
1603
1594
  if (Mival.muteStatus == 0) {
1604
1595
  this.setState({
1605
1596
  voiceVideoTwelve: false
@@ -1650,7 +1641,11 @@ class Video extends Component {
1650
1641
  // 获取设备成功
1651
1642
  this.test_controller.OnGetDevicesSuccess = (devicesInfo) => {
1652
1643
  console.log('devicesInfo' + JSON.stringify(devicesInfo));
1653
- const obj = [];
1644
+ const obj = [
1645
+ // {actionid: '0133d06019b8fe9426818ae7573ccfc31c150e09138e7f5ccfda03d6e224ffd4', groupId: '9c0334ba5cba71b60acb3ec6669c3aac78371ec9d9e33d2e8af72a758d895d27', actionname: 'Integrated Camera (13d3:56fb)'},
1646
+
1647
+ // {actionid: '4695c628677498d876074b941c16f6921d4e57534b50bfc2cb973da84e0e2622', groupId: '0d86c9467f096440ed74449192be5fafea59ac469866975f30b61fe964e2a80e', actionname: 'C2D Camera (0416:5035)'}
1648
+ ];
1654
1649
  const obj1 = [];
1655
1650
  const obj2 = [];
1656
1651
  let num = 0;
@@ -1671,7 +1666,8 @@ class Video extends Component {
1671
1666
  b.actionname = devicesInfo[i].label
1672
1667
  }
1673
1668
  obj.push(b)
1674
- } else if (devicesInfo[i].kind === 'audioinput') {
1669
+ } else
1670
+ if (devicesInfo[i].kind === 'audioinput') {
1675
1671
  // 麦克风
1676
1672
  b.actionid = devicesInfo[i].deviceId;
1677
1673
  b.groupId = devicesInfo[i].groupId || 'empty';
@@ -1731,19 +1727,22 @@ class Video extends Component {
1731
1727
  microphoneList: objList1,
1732
1728
  speakerList: objList2.length>0? [objList2[0]]: []
1733
1729
  })
1730
+ let indexId = 0
1731
+ objList.map((item,index)=>{
1732
+ if(item.actionname.indexOf('Integrated Camera') != -1) {
1733
+ indexId = index
1734
+ }
1735
+ })
1736
+ console.log(indexId)
1737
+ this.setState({
1738
+ cameraValue: objList[indexId].actionid,
1739
+ microphoneValue: objList1[0].actionid
1740
+ })
1734
1741
  if (!this.state.appId && !this.state.sessionType) {
1742
+ console.log('cameraValue',this.state.cameraValue)
1735
1743
  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
1744
  } else {
1745
+ console.log('cameraValue',this.state.cameraValue)
1747
1746
  this.setState({
1748
1747
  isModalVisibleInspection: true
1749
1748
  })
@@ -1864,6 +1863,12 @@ class Video extends Component {
1864
1863
  };
1865
1864
  this.mpaasSig(data);
1866
1865
  };
1866
+ this.test_controller.OnSendTextMsgSucc = (msgId)=>{
1867
+ console.log('发送成功',msgId)
1868
+ }
1869
+ this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
1870
+ console.log('发送失败',msgId,code, msg)
1871
+ }
1867
1872
  // 发布媒体流成功
1868
1873
  this.test_controller.OnPublishSucc = (sid) => {
1869
1874
  console.log('发布媒体流成功', sid)
@@ -1891,7 +1896,17 @@ class Video extends Component {
1891
1896
  this.enterRoom()
1892
1897
  this.timer = setInterval(
1893
1898
  () => {
1894
- if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0) {
1899
+ if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0.1) {
1900
+ // this.test_controller.SendTextMsg(JSON.stringify({
1901
+ // 'typeId': 3200,
1902
+ // 'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1903
+ // "data": {
1904
+ // 'sessionId': this.state.sessionId,
1905
+ // 'userId': this.props.tellerAccount,
1906
+ // 'data': (new Date()).valueOf()
1907
+ // }
1908
+
1909
+ // }))
1895
1910
  callNimIM('sendCustomCmdMsg', {
1896
1911
  customId: this.state.imRoomId,
1897
1912
  content: JSON.stringify({
@@ -1899,7 +1914,8 @@ class Video extends Component {
1899
1914
  'decibelValue': this.state.analyserHeight.get(sid).toFixed(2),
1900
1915
  "data": {
1901
1916
  'sessionId': this.state.sessionId,
1902
- 'userId': this.props.tellerAccount
1917
+ 'userId': this.props.tellerAccount,
1918
+ 'data': (new Date()).valueOf()
1903
1919
  }
1904
1920
 
1905
1921
  })
@@ -1925,6 +1941,171 @@ class Video extends Component {
1925
1941
  this.test_controller.OnSubscribeSucc = (feed, sid) => {
1926
1942
  console.log('订阅媒体流成功', feed, sid);
1927
1943
  this.appGetUsername(sid)
1944
+ console.log(muteJson,muteJson.size)
1945
+ if(muteJson.size > 0) {
1946
+ let userId = ''
1947
+ if (muteJson.get(this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid)) {
1948
+ userId = this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId1").innerText).uid
1949
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
1950
+ this.setState({
1951
+ voiceVideoOne: false
1952
+ })
1953
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
1954
+ this.setState({
1955
+ voiceVideoOne: true
1956
+ })
1957
+ }
1958
+ muteJson.delete(userId)
1959
+ }
1960
+ if (muteJson.get(document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : '')) {
1961
+ userId = document.getElementById("feedId2").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId2").innerText).uid : ''
1962
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
1963
+ this.setState({
1964
+ voiceVideoTwo: false
1965
+ })
1966
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
1967
+ this.setState({
1968
+ voiceVideoTwo: true
1969
+ })
1970
+ }
1971
+ muteJson.delete(userId)
1972
+ }
1973
+ if (muteJson.get(document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : '')) {
1974
+ userId = document.getElementById("feedId3").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId3").innerText).uid : ''
1975
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
1976
+ this.setState({
1977
+ voiceVideoThree: false
1978
+ })
1979
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
1980
+ this.setState({
1981
+ voiceVideoThree: true
1982
+ })
1983
+ }
1984
+ muteJson.delete(userId)
1985
+ }
1986
+ if (muteJson.get(document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : '')) {
1987
+ userId = document.getElementById("feedId4").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId4").innerText).uid : ''
1988
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
1989
+ this.setState({
1990
+ voiceVideoFour: false
1991
+ })
1992
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
1993
+ this.setState({
1994
+ voiceVideoFour: true
1995
+ })
1996
+ }
1997
+ muteJson.delete(userId)
1998
+ }
1999
+ if (muteJson.get(document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : '')) {
2000
+ userId = document.getElementById("feedId5").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId5").innerText).uid : ''
2001
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2002
+ this.setState({
2003
+ voiceVideoFive: false
2004
+ })
2005
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2006
+ this.setState({
2007
+ voiceVideoFive: true
2008
+ })
2009
+ }
2010
+ muteJson.delete(userId)
2011
+ }
2012
+ if (muteJson.get(document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : '')) {
2013
+ userId = document.getElementById("feedId6").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId6").innerText).uid : ''
2014
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2015
+ this.setState({
2016
+ voiceVideoSix: false
2017
+ })
2018
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2019
+ this.setState({
2020
+ voiceVideoSix: true
2021
+ })
2022
+ }
2023
+ muteJson.delete(userId)
2024
+ }
2025
+ if (muteJson.get(document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : '')) {
2026
+ userId = document.getElementById("feedId7").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId7").innerText).uid : ''
2027
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2028
+ this.setState({
2029
+ voiceVideoSeven: false
2030
+ })
2031
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2032
+ this.setState({
2033
+ voiceVideoSeven: true
2034
+ })
2035
+ }
2036
+ muteJson.delete(userId)
2037
+ }
2038
+ if (muteJson.get(document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : '')) {
2039
+ userId = document.getElementById("feedId8").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId8").innerText).uid : ''
2040
+
2041
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2042
+ this.setState({
2043
+ voiceVideoEight: false
2044
+ })
2045
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2046
+ this.setState({
2047
+ voiceVideoEight: true
2048
+ })
2049
+ }
2050
+ muteJson.delete(userId)
2051
+ }
2052
+ if (muteJson.get(document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : '')) {
2053
+ userId = document.getElementById("feedId9").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId9").innerText).uid : ''
2054
+
2055
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2056
+ this.setState({
2057
+ voiceVideoNine: false
2058
+ })
2059
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2060
+ this.setState({
2061
+ voiceVideoNine: true
2062
+ })
2063
+ }
2064
+ muteJson.delete(userId)
2065
+ }
2066
+ if (muteJson.get(document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : '')) {
2067
+ userId = document.getElementById("feedId10").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId10").innerText).uid : ''
2068
+
2069
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2070
+ this.setState({
2071
+ voiceVideoTen: false
2072
+ })
2073
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2074
+ this.setState({
2075
+ voiceVideoTen: true
2076
+ })
2077
+ }
2078
+ muteJson.delete(userId)
2079
+ }
2080
+ if (muteJson.get(document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : '')) {
2081
+ userId = document.getElementById("feedId11").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId11").innerText).uid : ''
2082
+
2083
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2084
+ this.setState({
2085
+ voiceVideoEleven: false
2086
+ })
2087
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2088
+ this.setState({
2089
+ voiceVideoEleven: true
2090
+ })
2091
+ }
2092
+ muteJson.delete(userId)
2093
+ }
2094
+ if (muteJson.get(document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : '')) {
2095
+ userId = document.getElementById("feedId12").innerText ? this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).uid : ''
2096
+ if (JSON.parse(muteJson.get(userId)).muteStatus == 0) {
2097
+ this.setState({
2098
+ voiceVideoTwelve: false
2099
+ })
2100
+ } else if (JSON.parse(muteJson.get(userId)).muteStatus == 1) {
2101
+ this.setState({
2102
+ voiceVideoTwelve: true
2103
+ })
2104
+ }
2105
+ muteJson.delete(userId)
2106
+ }
2107
+ console.log(muteJson,muteJson.length)
2108
+ }
1928
2109
  };
1929
2110
  // 订阅媒体流失败
1930
2111
  this.test_controller.OnSubscribeFailed = (
@@ -2079,7 +2260,9 @@ class Video extends Component {
2079
2260
  if (config_param !== undefined) {
2080
2261
  config_param.need_volume_analyser = true
2081
2262
  console.log(config_param)
2082
- this.test_controller.Subscribe(config_param)
2263
+ setTimeout(() => {
2264
+ this.test_controller.Subscribe(config_param)
2265
+ }, 2000);
2083
2266
  }
2084
2267
  })
2085
2268
  }
@@ -2112,12 +2295,11 @@ class Video extends Component {
2112
2295
  })
2113
2296
  }, function (code, message, data) {
2114
2297
  })
2115
- if(this.state.voiceStatue) {
2116
2298
  callNimIM('sendCustomCmdMsg', {
2117
2299
  customId: this.state.imRoomId,
2118
2300
  content: JSON.stringify({
2119
2301
  'typeId': 1013,
2120
- 'muteStatus': 1,
2302
+ 'muteStatus': this.state.voiceStatue ? 1 : 0,
2121
2303
  'data': {
2122
2304
  'sessionId': this.state.sessionId,
2123
2305
  'userId': this.props.tellerAccount
@@ -2126,7 +2308,7 @@ class Video extends Component {
2126
2308
  }, function (code, message, data) {
2127
2309
  console.log(data)
2128
2310
  })
2129
- }
2311
+
2130
2312
  let array = this.state.roomCustomerList;
2131
2313
  let newArray = [...array];
2132
2314
  newArray.push({
@@ -2293,7 +2475,9 @@ class Video extends Component {
2293
2475
  config_param.need_volume_analyser = true
2294
2476
  console.log(config_param)
2295
2477
 
2296
- this.test_controller.Subscribe(config_param)
2478
+ setTimeout(() => {
2479
+ this.test_controller.Subscribe(config_param)
2480
+ }, 2000);
2297
2481
 
2298
2482
  }
2299
2483
  // })
@@ -2488,11 +2672,15 @@ class Video extends Component {
2488
2672
  // 弱网回调
2489
2673
  this.test_controller.OnNetworkWeak = (bpsSend, bpsRecv, sid) => {
2490
2674
  console.log('弱网回调', bpsSend, bpsRecv, sid)
2675
+ if(sid == document.getElementById('publish_video1').name) {
2676
+ this.messageClick('当前网络环境较差','error')
2677
+ }
2491
2678
  };
2492
2679
  // 开始服务端录制成功
2493
2680
  this.test_controller.OnStartRemoteRecordSucc = (record_id) => {
2494
2681
  console.log('开始服务端录制成功', record_id);
2495
2682
  this.state.recordId = record_id
2683
+ this.videoRecordCallback('1')
2496
2684
  };
2497
2685
  // 开始服务端录制失败
2498
2686
  this.test_controller.OnStartRemoteRecordFailed = (
@@ -2505,6 +2693,7 @@ class Video extends Component {
2505
2693
  // 结束服务端录制成功
2506
2694
  this.test_controller.OnStopRemoteRecordSucc = (recordId) => {
2507
2695
  console.log('结束服务端录制成功', recordId);
2696
+ this.videoRecordCallback('2')
2508
2697
  // this.endSessionValue()
2509
2698
  // 获取服务端录制结果
2510
2699
  };
@@ -2766,9 +2955,11 @@ class Video extends Component {
2766
2955
  x2: 22 / 50 * canvas.width, // 波动范围左上角的点坐标
2767
2956
  y2: 10 / 50 * canvas.height,
2768
2957
  }
2769
-
2958
+ let number = 0
2770
2959
  for (var i = 0; i < 40; i++) {
2771
- let energy = (dataArray[step * i] / 256.0) * 80;
2960
+
2961
+ let energy = (dataArray[step * i] / 256.0) * 100;
2962
+ number = number + energy
2772
2963
  ctx.beginPath();
2773
2964
  ctx.fillStyle = this.props.voiceColor;
2774
2965
  const { x1, y1, x2, y2 } = drawArea
@@ -2777,12 +2968,12 @@ class Video extends Component {
2777
2968
  let startX = x2 // 绘制起始点x
2778
2969
  let startY = y1 - height // 绘制起始点y
2779
2970
  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)
2971
+ if(document.getElementById('publish_video1').name == sid && i == 39) {
2972
+ this.state.analyserHeight.set(sid,number / 40 / 70)
2782
2973
  this.state.analyserHeight = this.state.analyserHeight
2783
2974
  }
2784
-
2785
2975
  }
2976
+
2786
2977
  this.state.OnVolumeAnalyserMap.set(sid,setInterval(
2787
2978
  this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser),
2788
2979
  300
@@ -2830,6 +3021,20 @@ class Video extends Component {
2830
3021
 
2831
3022
  };
2832
3023
  }
3024
+ videoRecordCallback = async(type)=>{
3025
+ try {
3026
+ let result = await API.videoRecordCallback({
3027
+ activityId: this.props.businessNumber,
3028
+ sessionId: this.state.sessionId,
3029
+ type: type
3030
+ });
3031
+ console.log(result);
3032
+ } catch (err) {
3033
+ console.error(err);
3034
+ if(err.status == 502 || err.status== 404) {
3035
+ }
3036
+ }
3037
+ }
2833
3038
  enterRoom = async () =>{
2834
3039
  try {
2835
3040
  let result = await API.enterRoom({
@@ -3740,35 +3945,19 @@ class Video extends Component {
3740
3945
  this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
3741
3946
  )
3742
3947
  }
3743
- switchExternalAge = ()=>{
3744
- if(this.state.isSharedScreen) {
3745
- this.state.isSharedScreen = false
3746
- this.setState({
3747
-
3748
- screenName: '共享模式'
3749
- });
3750
- this.tabTitlesClick('RMScreen', 'delect')
3751
- if (this.state.isPictureInPicture) {
3752
- document.exitPictureInPicture()
3753
- }
3754
- }
3755
3948
 
3756
- this.navigatorClick()
3757
-
3758
- }
3759
3949
  navigatorClick=()=>{
3760
3950
  const that = this
3761
3951
  const publish_config = {};
3762
3952
  const canvas = document.createElement('canvas');
3763
3953
  const videoMedia = document.getElementById('manedvideo');
3764
3954
  const cobj = canvas.getContext('2d'); // 获取绘图环境
3765
- const left =document.getElementById("allHSBC").getBoundingClientRect().left;
3955
+ const left =document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3766
3956
  const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
3767
3957
  const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3768
3958
  const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
3769
- const width = right - left
3770
- const height = bottom - top + 10
3771
- const x = left - 20 > 0 ? left - 20 : 0
3959
+ const width = right - left + 50
3960
+ const height = bottom - top
3772
3961
  canvas.width = width;
3773
3962
  canvas.height = height;
3774
3963
  videoMedia.addEventListener('play', (event) =>{
@@ -3777,7 +3966,7 @@ class Video extends Component {
3777
3966
  loop()
3778
3967
  function loop() {
3779
3968
  if (!$this.paused && !$this.ended) {
3780
- cobj.drawImage(videoMedia, x, top, width, height, 0, 0,width, height,);
3969
+ cobj.drawImage(videoMedia, left, top, width, height, 0, 0,width, height,);
3781
3970
  setTimeout(loop, 1000 / 10); // drawing at 30fps
3782
3971
  }
3783
3972
  }
@@ -3812,6 +4001,9 @@ class Video extends Component {
3812
4001
  preferCurrentTab:true,
3813
4002
  })
3814
4003
  .then((stream) => {
4004
+ if(streamShare) {
4005
+ streamShare.getTracks().forEach(track => track.stop());
4006
+ }
3815
4007
  videoMedia.srcObject = stream;
3816
4008
  stream.getVideoTracks()[0].applyConstraints({
3817
4009
  width: document.body.offsetWidth,
@@ -3849,12 +4041,9 @@ class Video extends Component {
3849
4041
  document.exitPictureInPicture()
3850
4042
  }
3851
4043
  }
3852
- this.navigatorClick()
3853
- } else {
3854
- this.messageClick('当前已经切换RM白板','success')
3855
-
3856
4044
  }
3857
-
4045
+
4046
+ this.navigatorClick()
3858
4047
  }
3859
4048
  }
3860
4049
  switchSelect = (value) => {
@@ -4165,6 +4354,7 @@ class Video extends Component {
4165
4354
  autoPlay
4166
4355
  muted={true}
4167
4356
  className="videoTab"
4357
+ disablePictureInPicture
4168
4358
  />
4169
4359
  <audio id="audio20" autoPlay />
4170
4360
  <label style={{ display: 'none' }} id="feedId20" type="text" />
@@ -4184,6 +4374,7 @@ class Video extends Component {
4184
4374
  autoPlay
4185
4375
  muted={true}
4186
4376
  className="videoTab"
4377
+ disablePictureInPicture
4187
4378
  />
4188
4379
  <audio id="audio21" autoPlay />
4189
4380
  <label style={{ display: 'none' }} id="feedId21" type="text" />
@@ -4234,18 +4425,21 @@ class Video extends Component {
4234
4425
  className={`publishVideoClass`}
4235
4426
  autoPlay
4236
4427
  muted={true}
4428
+ disablePictureInPicture
4237
4429
  />
4238
4430
  <label style={{ display: 'none' }} id="publish_streamId1" type="text" />
4239
4431
 
4240
4432
  <div id="publish_video_div" className={`tellerTitle titleSamlle`}>
4433
+ <div>
4241
4434
  {
4242
4435
  this.state.voiceStatue && <img
4243
4436
  alt=""
4244
4437
  src={require("../../assets/img/jingyin.png").default}
4245
- className="imgClassVoice voiceClass"
4438
+ className="voiceClass"
4246
4439
  />
4247
4440
  }
4248
4441
  <canvas style={{ display: (!this.state.voiceStatue) ? '' : 'none',width: '25px',height:'25px',marginTop: '4px' }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
4442
+ </div>
4249
4443
  <div className='titleName' style={{ color: this.props.titleColor, fontSize: this.props.fontSize + 'px', fontFamily: this.props.fontFamily }}>{this.state.titleNameRm}</div>
4250
4444
  </div>
4251
4445
  </div>
@@ -4267,6 +4461,7 @@ class Video extends Component {
4267
4461
  id="video1"
4268
4462
  autoPlay
4269
4463
  muted={true}
4464
+ disablePictureInPicture
4270
4465
  className={`video1 ${this.state.noVideoOne ? 'isNoVideo' : ''}`}
4271
4466
  />
4272
4467
  <audio id="audio1" autoPlay />
@@ -4295,6 +4490,7 @@ class Video extends Component {
4295
4490
  <video
4296
4491
  id="video2"
4297
4492
  autoPlay
4493
+ disablePictureInPicture
4298
4494
  muted={true}
4299
4495
  className={`video ${this.state.noVideoTwo ? 'isNoVideo' : ''}`}
4300
4496
  />
@@ -4323,6 +4519,7 @@ class Video extends Component {
4323
4519
  id="video3"
4324
4520
  autoPlay
4325
4521
  muted={true}
4522
+ disablePictureInPicture
4326
4523
  className={`video ${this.state.noVideoThree ? 'isNoVideo' : ''}`}
4327
4524
  />
4328
4525
  <audio id="audio3" autoPlay />
@@ -4349,6 +4546,7 @@ class Video extends Component {
4349
4546
  id="video4"
4350
4547
  autoPlay
4351
4548
  muted={true}
4549
+ disablePictureInPicture
4352
4550
  className={`video ${this.state.noVideoFour ? 'isNoVideo' : ''}`}
4353
4551
  />
4354
4552
  <audio id="audio4" autoPlay />
@@ -4376,6 +4574,7 @@ class Video extends Component {
4376
4574
  id="video5"
4377
4575
  autoPlay
4378
4576
  muted={true}
4577
+ disablePictureInPicture
4379
4578
  className={`video ${this.state.noVideoFive ? 'isNoVideo' : ''}`}
4380
4579
  />
4381
4580
  <audio id="audio5" autoPlay />
@@ -4402,6 +4601,7 @@ class Video extends Component {
4402
4601
  id="video6"
4403
4602
  autoPlay
4404
4603
  muted={true}
4604
+ disablePictureInPicture
4405
4605
  className={`video ${this.state.noVideoSix ? 'isNoVideo' : ''}`}
4406
4606
  />
4407
4607
  <audio id="audio6" autoPlay />
@@ -4440,6 +4640,7 @@ class Video extends Component {
4440
4640
  id="video7"
4441
4641
  autoPlay
4442
4642
  muted={true}
4643
+ disablePictureInPicture
4443
4644
  className={`video ${this.state.noVideoSeven ? 'isNoVideo' : ''}`}
4444
4645
  />
4445
4646
  <audio id="audio7" autoPlay />
@@ -4469,6 +4670,7 @@ class Video extends Component {
4469
4670
  id="video8"
4470
4671
  autoPlay
4471
4672
  muted={true}
4673
+ disablePictureInPicture
4472
4674
  className={`video ${this.state.noVideoEight ? 'isNoVideo' : ''}`}
4473
4675
  />
4474
4676
  <audio id="audio8" autoPlay />
@@ -4495,6 +4697,7 @@ class Video extends Component {
4495
4697
  id="video9"
4496
4698
  autoPlay
4497
4699
  muted={true}
4700
+ disablePictureInPicture
4498
4701
  className={`video ${this.state.noVideoNine ? 'isNoVideo' : ''}`}
4499
4702
  />
4500
4703
  <audio id="audio9" autoPlay />
@@ -4523,6 +4726,7 @@ class Video extends Component {
4523
4726
  id="video10"
4524
4727
  autoPlay
4525
4728
  muted={true}
4729
+ disablePictureInPicture
4526
4730
  className={`video ${this.state.noVideoTen ? 'isNoVideo' : ''}`}
4527
4731
  />
4528
4732
  <audio id="audio10" autoPlay />
@@ -4549,6 +4753,7 @@ class Video extends Component {
4549
4753
  id="video11"
4550
4754
  autoPlay
4551
4755
  muted={true}
4756
+ disablePictureInPicture
4552
4757
  className={`video ${this.state.noVideoEleven ? 'isNoVideo' : ''}`}
4553
4758
  />
4554
4759
  <audio id="audio11" autoPlay />
@@ -4576,6 +4781,7 @@ class Video extends Component {
4576
4781
  id="video12"
4577
4782
  autoPlay
4578
4783
  muted={true}
4784
+ disablePictureInPicture
4579
4785
  className={`video ${this.state.noVideoTwelve ? 'isNoVideo' : ''}`}
4580
4786
  />
4581
4787
  <audio id="audio12" autoPlay />
@@ -4628,7 +4834,7 @@ class Video extends Component {
4628
4834
  invitationClick={this.invitationClick}
4629
4835
  customerFaceClick={this.customerFaceClick}
4630
4836
  ocrClick={this.ocrClick}
4631
- switchExternal={this.switchExternalAge}
4837
+ switchExternal={this.switchExternal}
4632
4838
  inspection={this.inspection}
4633
4839
  ></Foot>
4634
4840
  <Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
@@ -4778,7 +4984,7 @@ sessionId: "",
4778
4984
  microphoneSize: 25,
4779
4985
  fontSize: '14',
4780
4986
  fontFamily: 'auto',
4781
- menus: ['SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
4987
+ menus: ['BOARD','SHARE', 'FRIES', 'OCR', 'INVITE', 'PIP'],
4782
4988
  customLeaveRoom: '客户离开房间',
4783
4989
  meetingInfo: {
4784
4990
  title: '--',