react_hsbc_teller 1.1.6 → 1.1.9
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/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/common/websocket.js +13 -4
- package/packages/demo/demo.js +0 -1
- package/packages/pages/foot/foot.jsx +0 -11
- package/packages/pages/video/video.jsx +181 -125
|
@@ -127,6 +127,7 @@ class Video extends Component {
|
|
|
127
127
|
imJoinRoom: false,
|
|
128
128
|
analyserData: new Map(),
|
|
129
129
|
analyserHeight: new Map(),
|
|
130
|
+
OnVolumeAnalyserMap: new Map(),
|
|
130
131
|
noVideoOne: false,
|
|
131
132
|
noVideoTwo: false,
|
|
132
133
|
noVideoThree: false,
|
|
@@ -139,6 +140,7 @@ class Video extends Component {
|
|
|
139
140
|
noVideoTen: false,
|
|
140
141
|
noVideoEleven: false,
|
|
141
142
|
noVideoTwelve: false,
|
|
143
|
+
manualClose: false,
|
|
142
144
|
};
|
|
143
145
|
// eslint-disable-next-line no-undef
|
|
144
146
|
test_controller = '';
|
|
@@ -163,17 +165,21 @@ class Video extends Component {
|
|
|
163
165
|
publish_config.media_type = 1
|
|
164
166
|
publish_config.publish_device = 1
|
|
165
167
|
publish_config.need_volume_analyser = true
|
|
166
|
-
publish_config.video_profile_type = 3
|
|
168
|
+
// publish_config.video_profile_type = 3
|
|
169
|
+
publish_config.video_profile_type=100
|
|
170
|
+
publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
|
|
167
171
|
publish_config.publish_video_id = 'publish_video1'
|
|
168
172
|
publish_config.publish_streamId_id = 'publish_streamId1'
|
|
169
173
|
publish_config.publish_tag = 'tag1'
|
|
170
174
|
this.test_controller.Publish(publish_config)
|
|
171
175
|
// eslint-disable-next-line no-undef
|
|
172
|
-
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
if(this.state.imStatus && !this.state.imJoinRoom) {
|
|
173
178
|
joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
|
|
174
179
|
this.state.imJoinRoom =true
|
|
175
180
|
console.log('加入IM房间')
|
|
176
181
|
}
|
|
182
|
+
})
|
|
177
183
|
this.props.createRoomCallback({
|
|
178
184
|
type: 1,
|
|
179
185
|
errorManage: '',
|
|
@@ -842,8 +848,10 @@ class Video extends Component {
|
|
|
842
848
|
let analyser = this.state.analyserData.get(sid)
|
|
843
849
|
aou(analyser)
|
|
844
850
|
function aou(analyser){
|
|
851
|
+
clearInterval(microTimerMap.get(sid))
|
|
852
|
+
// cancelAnimationFrame(microTimerMap.get(sid))
|
|
845
853
|
if(analyser) {
|
|
846
|
-
|
|
854
|
+
|
|
847
855
|
let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
848
856
|
analyser.getByteFrequencyData(dataArray);
|
|
849
857
|
let step = Math.round(dataArray.length / 60); //采样步长
|
|
@@ -867,11 +875,18 @@ class Video extends Component {
|
|
|
867
875
|
let startY = y1 - height // 绘制起始点y
|
|
868
876
|
cobj.fillRect(startX, startY, width, height )
|
|
869
877
|
}
|
|
870
|
-
|
|
878
|
+
}
|
|
879
|
+
microTimerMap.set(sid,
|
|
880
|
+
setInterval(
|
|
881
|
+
aou.bind(this, analyser),
|
|
882
|
+
300
|
|
883
|
+
)
|
|
884
|
+
// requestAnimationFrame(aou.bind(this, analyser))
|
|
885
|
+
)
|
|
871
886
|
}
|
|
872
887
|
|
|
873
888
|
|
|
874
|
-
|
|
889
|
+
|
|
875
890
|
}
|
|
876
891
|
|
|
877
892
|
}
|
|
@@ -1058,7 +1073,10 @@ class Video extends Component {
|
|
|
1058
1073
|
noVideoTwelve: true
|
|
1059
1074
|
})
|
|
1060
1075
|
}
|
|
1061
|
-
this.
|
|
1076
|
+
if(this.state.isPictureInPicture) {
|
|
1077
|
+
this.pictureInPicture('Refresh')
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1062
1080
|
}
|
|
1063
1081
|
}
|
|
1064
1082
|
else if (Mival.typeId == 3003) {
|
|
@@ -1134,7 +1152,9 @@ class Video extends Component {
|
|
|
1134
1152
|
noVideoTwelve: false
|
|
1135
1153
|
})
|
|
1136
1154
|
}
|
|
1137
|
-
this.
|
|
1155
|
+
if(this.state.isPictureInPicture) {
|
|
1156
|
+
this.pictureInPicture('Refresh')
|
|
1157
|
+
}
|
|
1138
1158
|
}
|
|
1139
1159
|
}
|
|
1140
1160
|
else if (Mival.typeId == 1220) {
|
|
@@ -1352,11 +1372,11 @@ class Video extends Component {
|
|
|
1352
1372
|
};
|
|
1353
1373
|
window.IMOpenfire = msg =>{
|
|
1354
1374
|
console.log('im登录', msg)
|
|
1355
|
-
if(
|
|
1356
|
-
this.state.
|
|
1375
|
+
if(msg.status == 'error') {
|
|
1376
|
+
this.state.imStatus = false
|
|
1357
1377
|
this.roomCallBack(2, 'im建立连接失败',5)
|
|
1358
|
-
} else {
|
|
1359
|
-
this.state.imStatus =
|
|
1378
|
+
} else if (msg.status == 'success') {
|
|
1379
|
+
this.state.imStatus = true
|
|
1360
1380
|
setTimeout(() => {
|
|
1361
1381
|
if(this.state.imRoomId && !this.state.imJoinRoom) {
|
|
1362
1382
|
joinRoom((this.props.tellerAccount + '@' + JSON.parse(window.sessionStorage.getItem('sigData')).hostname), this.state.imRoomId)
|
|
@@ -1364,6 +1384,15 @@ class Video extends Component {
|
|
|
1364
1384
|
console.log('IMOpenfire 加入im房间')
|
|
1365
1385
|
}
|
|
1366
1386
|
}, 200);
|
|
1387
|
+
} else if (msg.status == 'close') {
|
|
1388
|
+
if(!this.state.manualClose) {
|
|
1389
|
+
this.timer && clearInterval(this.timer);
|
|
1390
|
+
this.state.imStatus = false
|
|
1391
|
+
console.log('IMOpenfireclose')
|
|
1392
|
+
this.roomCallBack(2, '账号重复登录',9)
|
|
1393
|
+
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1367
1396
|
}
|
|
1368
1397
|
|
|
1369
1398
|
}
|
|
@@ -1539,8 +1568,12 @@ class Video extends Component {
|
|
|
1539
1568
|
// 音视频关闭通知
|
|
1540
1569
|
this.test_controller.OnMediaClose = (code, sid) => {
|
|
1541
1570
|
console.log(code, sid)
|
|
1542
|
-
if(code == 5004 || code == 5007) {
|
|
1543
|
-
|
|
1571
|
+
if(code == 5003 || code == 5004 || code == 5005|| code == 5007|| code == 5009|| code == 5010 || code == 5011|| code == 5012) {
|
|
1572
|
+
if(sid == document.getElementById('publish_video1').name) {
|
|
1573
|
+
this.roomCallBack(2, '音视频异常关闭',8)
|
|
1574
|
+
} else {
|
|
1575
|
+
this.state.isScreenSwitching = false
|
|
1576
|
+
}
|
|
1544
1577
|
}
|
|
1545
1578
|
};
|
|
1546
1579
|
// 加入房间成功
|
|
@@ -1550,7 +1583,9 @@ class Video extends Component {
|
|
|
1550
1583
|
publish_config.media_type = 1
|
|
1551
1584
|
publish_config.publish_device = 1
|
|
1552
1585
|
publish_config.need_volume_analyser = true
|
|
1553
|
-
publish_config.video_profile_type = 3
|
|
1586
|
+
// publish_config.video_profile_type = 3
|
|
1587
|
+
publish_config.video_profile_type=100
|
|
1588
|
+
publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
|
|
1554
1589
|
publish_config.publish_video_id = 'publish_video1'
|
|
1555
1590
|
publish_config.publish_streamId_id = 'publish_streamId1'
|
|
1556
1591
|
publish_config.publish_tag = 'tag1'
|
|
@@ -1592,7 +1627,7 @@ class Video extends Component {
|
|
|
1592
1627
|
'tellerId': this.props.tellerAccount
|
|
1593
1628
|
})
|
|
1594
1629
|
});
|
|
1595
|
-
if(this.state.screenName == '
|
|
1630
|
+
if(this.state.screenName == '切换共享') {
|
|
1596
1631
|
this.state.isSharedScreen = true
|
|
1597
1632
|
this.state.isScreenSwitching = false
|
|
1598
1633
|
}
|
|
@@ -1605,7 +1640,7 @@ class Video extends Component {
|
|
|
1605
1640
|
this.enterRoom()
|
|
1606
1641
|
this.timer = setInterval(
|
|
1607
1642
|
() => {
|
|
1608
|
-
if(!this.state.voiceStatue) {
|
|
1643
|
+
if(!this.state.voiceStatue && this.state.analyserHeight.get(sid).toFixed(2) > 0) {
|
|
1609
1644
|
callNimIM('sendCustomCmdMsg', {
|
|
1610
1645
|
customId: this.state.imRoomId,
|
|
1611
1646
|
content: JSON.stringify({
|
|
@@ -1627,8 +1662,13 @@ class Video extends Component {
|
|
|
1627
1662
|
// 发布媒体流失败
|
|
1628
1663
|
this.test_controller.OnPublishFailed = (sid, err_code, err_msg) => {
|
|
1629
1664
|
console.log('发布媒体流失败', sid, err_code, err_msg)
|
|
1630
|
-
|
|
1631
|
-
|
|
1665
|
+
if(sid == document.getElementById('publish_video1').name) {
|
|
1666
|
+
this.state.sessionType = false
|
|
1667
|
+
this.roomCallBack(2, '发布失败',4)
|
|
1668
|
+
} else {
|
|
1669
|
+
this.messageClick('投屏失败请重新投屏','error')
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1632
1672
|
};
|
|
1633
1673
|
// 订阅媒体流成功
|
|
1634
1674
|
this.test_controller.OnSubscribeSucc = (feed, sid) => {
|
|
@@ -1797,26 +1837,11 @@ class Video extends Component {
|
|
|
1797
1837
|
// 推送“新加⼊房间者”给与会者
|
|
1798
1838
|
this.test_controller.OnNewJoinerIn = (participant) => {
|
|
1799
1839
|
console.log('新加⼊房间者', participant);
|
|
1800
|
-
// this.test_controller.ChangeStreamSize(document.getElementById('publish_video1').name, 5)
|
|
1801
1840
|
this.state.isCustomer= true
|
|
1802
1841
|
};
|
|
1803
1842
|
// 推送“有新发布”给与会者
|
|
1804
1843
|
this.test_controller.OnNewPublish = (feed) => {
|
|
1805
1844
|
console.log('有新发布者', feed);
|
|
1806
|
-
// callNimIM('sendChatMsg', {
|
|
1807
|
-
// customId: feed.uid,
|
|
1808
|
-
// content: JSON.stringify({
|
|
1809
|
-
// 'typeId': 1014,
|
|
1810
|
-
// 'sessionId': this.state.sessionId,
|
|
1811
|
-
// 'meetingInfo': {
|
|
1812
|
-
// 'title': this.props.meetingInfo.title,
|
|
1813
|
-
// 'host': this.props.meetingInfo.host,
|
|
1814
|
-
// 'customers': this.props.meetingInfo.customers
|
|
1815
|
-
// }
|
|
1816
|
-
|
|
1817
|
-
// })
|
|
1818
|
-
// }, function (code, message, data) {
|
|
1819
|
-
// })
|
|
1820
1845
|
|
|
1821
1846
|
callNimIM('sendCustomCmdMsg', {
|
|
1822
1847
|
customId: this.state.imRoomId,
|
|
@@ -2067,78 +2092,92 @@ class Video extends Component {
|
|
|
2067
2092
|
if (!document.getElementById("video1").name) {
|
|
2068
2093
|
this.setState({
|
|
2069
2094
|
videoOneName: '',
|
|
2070
|
-
voiceVideoOne: false
|
|
2095
|
+
voiceVideoOne: false,
|
|
2096
|
+
noVideoOne: false
|
|
2071
2097
|
})
|
|
2072
2098
|
}
|
|
2073
2099
|
if (!document.getElementById("video2").name) {
|
|
2074
2100
|
this.setState({
|
|
2075
2101
|
videoTwoName: '',
|
|
2076
|
-
voiceVideoTwo: false
|
|
2102
|
+
voiceVideoTwo: false,
|
|
2103
|
+
noVideoTwo: false
|
|
2077
2104
|
})
|
|
2078
2105
|
}
|
|
2079
2106
|
if (!document.getElementById("video3").name) {
|
|
2080
2107
|
this.setState({
|
|
2081
2108
|
videoThreeName: '',
|
|
2082
|
-
voiceVideoThree: false
|
|
2109
|
+
voiceVideoThree: false,
|
|
2110
|
+
noVideoThree: false
|
|
2083
2111
|
})
|
|
2084
2112
|
}
|
|
2085
2113
|
if (!document.getElementById("video4").name) {
|
|
2086
2114
|
this.setState({
|
|
2087
2115
|
videoFourName: '',
|
|
2088
2116
|
voiceVideoFour: false,
|
|
2117
|
+
noVideoFour: false
|
|
2089
2118
|
})
|
|
2090
2119
|
}
|
|
2091
2120
|
if (!document.getElementById("video5").name) {
|
|
2092
2121
|
this.setState({
|
|
2093
2122
|
videoFiveName: '',
|
|
2094
|
-
voiceVideoFive: false
|
|
2123
|
+
voiceVideoFive: false,
|
|
2124
|
+
noVideoFive: false
|
|
2095
2125
|
})
|
|
2096
2126
|
}
|
|
2097
2127
|
if (!document.getElementById("video6").name) {
|
|
2098
2128
|
this.setState({
|
|
2099
2129
|
videoSixName: '',
|
|
2100
|
-
voiceVideoSix: false
|
|
2130
|
+
voiceVideoSix: false,
|
|
2131
|
+
noVideoSix: false
|
|
2101
2132
|
})
|
|
2102
2133
|
}
|
|
2103
2134
|
|
|
2104
2135
|
if (!document.getElementById("video7").name) {
|
|
2105
2136
|
this.setState({
|
|
2106
2137
|
videoSevenName: '',
|
|
2107
|
-
voiceVideoSeven: false
|
|
2138
|
+
voiceVideoSeven: false,
|
|
2139
|
+
noVideoSeven: false
|
|
2108
2140
|
})
|
|
2109
2141
|
}
|
|
2110
2142
|
if (!document.getElementById("video8").name) {
|
|
2111
2143
|
this.setState({
|
|
2112
2144
|
videoEightName: '',
|
|
2113
|
-
voiceVideoEight: false
|
|
2145
|
+
voiceVideoEight: false,
|
|
2146
|
+
noVideoEight: false
|
|
2114
2147
|
})
|
|
2115
2148
|
}
|
|
2116
2149
|
if (!document.getElementById("video9").name) {
|
|
2117
2150
|
this.setState({
|
|
2118
2151
|
videoNineName: '',
|
|
2119
|
-
voiceVideoNine: false
|
|
2152
|
+
voiceVideoNine: false,
|
|
2153
|
+
noVideoNine: false
|
|
2120
2154
|
})
|
|
2121
2155
|
}
|
|
2122
2156
|
if (!document.getElementById("video10").name) {
|
|
2123
2157
|
this.setState({
|
|
2124
2158
|
videoTenName: '',
|
|
2125
|
-
voiceVideoTen: false
|
|
2159
|
+
voiceVideoTen: false,
|
|
2160
|
+
noVideoTen: false
|
|
2126
2161
|
})
|
|
2127
2162
|
}
|
|
2128
2163
|
if (!document.getElementById("video11").name) {
|
|
2129
2164
|
this.setState({
|
|
2130
2165
|
videoElevenName: '',
|
|
2131
|
-
voiceVideoEleven: false
|
|
2166
|
+
voiceVideoEleven: false,
|
|
2167
|
+
noVideoEleven: false
|
|
2132
2168
|
})
|
|
2133
2169
|
}
|
|
2134
2170
|
if (!document.getElementById("video12").name) {
|
|
2135
2171
|
this.setState({
|
|
2136
2172
|
videoTwelveName: '',
|
|
2137
|
-
voiceVideoTwelve: false
|
|
2173
|
+
voiceVideoTwelve: false,
|
|
2174
|
+
noVideoTwelve: false
|
|
2138
2175
|
})
|
|
2139
2176
|
}
|
|
2140
2177
|
this.state.analyserData.delete(sid)
|
|
2141
|
-
this.
|
|
2178
|
+
if(this.state.isPictureInPicture) {
|
|
2179
|
+
this.pictureInPicture('Refresh')
|
|
2180
|
+
}
|
|
2142
2181
|
};
|
|
2143
2182
|
// 推送“取消发布”给与会者
|
|
2144
2183
|
this.test_controller.OnUnPublish = (feed) => {
|
|
@@ -2159,14 +2198,9 @@ class Video extends Component {
|
|
|
2159
2198
|
this.test_controller.OnUnSubscribe = (unsubscriber, feed) => {
|
|
2160
2199
|
console.log('取消订阅者', unsubscriber, feed)
|
|
2161
2200
|
};
|
|
2162
|
-
// ⾳视频关闭通知
|
|
2163
|
-
this.test_controller.OnMediaClose = (code, sid) => {
|
|
2164
|
-
console.log('⾳视频关闭通知', code, sid)
|
|
2165
|
-
};
|
|
2166
2201
|
// 退出房间回调
|
|
2167
2202
|
this.test_controller.OnLeaveRoom = (leaveType) => {
|
|
2168
2203
|
console.log('退出房间回调', leaveType);
|
|
2169
|
-
|
|
2170
2204
|
};
|
|
2171
2205
|
// 推送“退出房间者”给与会者
|
|
2172
2206
|
this.test_controller.OnParticipantLeaveRoom = (
|
|
@@ -2338,7 +2372,7 @@ class Video extends Component {
|
|
|
2338
2372
|
})
|
|
2339
2373
|
}
|
|
2340
2374
|
if (sid == document.getElementById('video20').name) {
|
|
2341
|
-
if(this.state.screenName == '
|
|
2375
|
+
if(this.state.screenName == '切换共享') {
|
|
2342
2376
|
this.state.isSharedScreen = true
|
|
2343
2377
|
this.state.isScreenSwitching = false
|
|
2344
2378
|
}
|
|
@@ -2356,7 +2390,19 @@ class Video extends Component {
|
|
|
2356
2390
|
loading: false
|
|
2357
2391
|
})
|
|
2358
2392
|
this.messageClick('切换摄像头或麦克风失败,请先检查设备','error')
|
|
2359
|
-
}
|
|
2393
|
+
} else if(this.state.screenName == '切换共享') {
|
|
2394
|
+
this.test_controller.UnPublish(document.getElementById('video20').name)
|
|
2395
|
+
this.state.isSharedScreen = false
|
|
2396
|
+
this.state.isScreenSwitching = false
|
|
2397
|
+
this.setState({
|
|
2398
|
+
screenName: '共享模式'
|
|
2399
|
+
});
|
|
2400
|
+
console.log(pictureInPictureVideo)
|
|
2401
|
+
this.tabTitlesClick('RMScreen', 'delect')
|
|
2402
|
+
if (this.state.isPictureInPicture) {
|
|
2403
|
+
document.exitPictureInPicture()
|
|
2404
|
+
}
|
|
2405
|
+
}
|
|
2360
2406
|
};
|
|
2361
2407
|
// 服务端录制初始化成功
|
|
2362
2408
|
this.test_controller.OnInitRemoteRecordSucc = (
|
|
@@ -2366,20 +2412,21 @@ class Video extends Component {
|
|
|
2366
2412
|
console.log('服务端录制初始化成功', record_id, record_third_id)
|
|
2367
2413
|
};
|
|
2368
2414
|
this.test_controller.OnVolumeAnalyser = (sid, analyser) => {
|
|
2369
|
-
|
|
2370
|
-
let
|
|
2371
|
-
let
|
|
2372
|
-
let
|
|
2373
|
-
let
|
|
2374
|
-
let
|
|
2375
|
-
let
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
let
|
|
2379
|
-
let
|
|
2380
|
-
let
|
|
2381
|
-
let
|
|
2382
|
-
let
|
|
2415
|
+
clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
|
|
2416
|
+
let publish_sid = (document.getElementById('publish_video1') ? document.getElementById('publish_video1').name : '') || (document.getElementById('publish_streamId1') ? document.getElementById('publish_streamId1').name : '');
|
|
2417
|
+
let subscribe_sid1 = (document.getElementById('video1') ? document.getElementById('video1').name : '') || (document.getElementById('audio1') ? document.getElementById('audio1').name : '');
|
|
2418
|
+
let subscribe_sid2 = (document.getElementById('video2') ? document.getElementById('video2').name : '') || (document.getElementById('audio2') ? document.getElementById('audio2').name : '');
|
|
2419
|
+
let subscribe_sid3 =(document.getElementById('video3') ? document.getElementById('video3').name : '') || (document.getElementById('audio3') ? document.getElementById('audio3').name : '');
|
|
2420
|
+
let subscribe_sid4 = (document.getElementById('video4') ? document.getElementById('video4').name : '') || (document.getElementById('audio4') ? document.getElementById('audio4').name : '');
|
|
2421
|
+
let subscribe_sid5 = (document.getElementById('video5') ? document.getElementById('video5').name : '') || (document.getElementById('audio5') ? document.getElementById('audio5').name : '');
|
|
2422
|
+
let subscribe_sid6 = (document.getElementById('video6') ? document.getElementById('video6').name : '') || (document.getElementById('audio6') ? document.getElementById('audio6').name : '');
|
|
2423
|
+
|
|
2424
|
+
let subscribe_sid7 = (document.getElementById('video7') ? document.getElementById('video7').name : '') || (document.getElementById('audio7') ? document.getElementById('audio7').name : '');
|
|
2425
|
+
let subscribe_sid8 = (document.getElementById('video8') ? document.getElementById('video8').name : '') || (document.getElementById('audio8') ? document.getElementById('audio8').name : '');
|
|
2426
|
+
let subscribe_sid9 = (document.getElementById('video9') ? document.getElementById('video9').name : '') || (document.getElementById('audio9') ? document.getElementById('audio9').name : '');
|
|
2427
|
+
let subscribe_sid10 = (document.getElementById('video10') ? document.getElementById('video10').name : '') || (document.getElementById('audio10') ? document.getElementById('audio10').name : '');
|
|
2428
|
+
let subscribe_sid11 = (document.getElementById('video11') ? document.getElementById('video11').name : '') || (document.getElementById('audio11') ? document.getElementById('audio11').name : '');
|
|
2429
|
+
let subscribe_sid12 = (document.getElementById('video12') ? document.getElementById('video12').name : '') || (document.getElementById('audio12') ? document.getElementById('audio12').name : '');
|
|
2383
2430
|
|
|
2384
2431
|
let volumeView;
|
|
2385
2432
|
switch (sid) {
|
|
@@ -2446,7 +2493,7 @@ class Video extends Component {
|
|
|
2446
2493
|
}
|
|
2447
2494
|
|
|
2448
2495
|
for (var i = 0; i < 40; i++) {
|
|
2449
|
-
let energy = (dataArray[step * i] / 256.0) *
|
|
2496
|
+
let energy = (dataArray[step * i] / 256.0) * 100;
|
|
2450
2497
|
ctx.beginPath();
|
|
2451
2498
|
ctx.fillStyle = this.props.voiceColor;
|
|
2452
2499
|
const { x1, y1, x2, y2 } = drawArea
|
|
@@ -2456,12 +2503,17 @@ class Video extends Component {
|
|
|
2456
2503
|
let startY = y1 - height // 绘制起始点y
|
|
2457
2504
|
ctx.fillRect(startX, startY, width, height)
|
|
2458
2505
|
if(document.getElementById('publish_video1').name == sid) {
|
|
2459
|
-
this.state.analyserHeight.set(sid,energy/
|
|
2506
|
+
this.state.analyserHeight.set(sid,energy/25)
|
|
2460
2507
|
this.state.analyserHeight = this.state.analyserHeight
|
|
2461
2508
|
}
|
|
2462
2509
|
|
|
2463
2510
|
}
|
|
2464
|
-
|
|
2511
|
+
this.state.OnVolumeAnalyserMap.set(sid,setInterval(
|
|
2512
|
+
this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser),
|
|
2513
|
+
300
|
|
2514
|
+
))
|
|
2515
|
+
this.state.OnVolumeAnalyserMap = this.state.OnVolumeAnalyserMap
|
|
2516
|
+
// requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
|
|
2465
2517
|
|
|
2466
2518
|
this.state.analyserData.set(sid, analyser)
|
|
2467
2519
|
this.state.analyserData = this.state.analyserData
|
|
@@ -2472,9 +2524,32 @@ class Video extends Component {
|
|
|
2472
2524
|
if(this.state.isScreenSwitching) {
|
|
2473
2525
|
this.state.isScreenSwitching = false
|
|
2474
2526
|
} else {
|
|
2475
|
-
|
|
2476
|
-
|
|
2527
|
+
// if (this.state.isWhiteboard) {
|
|
2528
|
+
// publish_config.publish_device = 4
|
|
2529
|
+
// publish_config.media_type = 1
|
|
2530
|
+
// publish_config.sid = document.getElementById('video20').name
|
|
2531
|
+
// publish_config.part_of_screen_id = 'touBoxItem'
|
|
2532
|
+
// publish_config.video_profile_type = 5
|
|
2533
|
+
// this.test_controller.ChangeMediaStream(publish_config);
|
|
2534
|
+
// this.setState({
|
|
2535
|
+
// isPDF: true,
|
|
2536
|
+
// })
|
|
2537
|
+
// } else {
|
|
2538
|
+
document.getElementById('video20') && document.getElementById('video20').name ? this.test_controller.UnPublish(document.getElementById('video20').name) : ''
|
|
2539
|
+
// }
|
|
2540
|
+
this.state.isSharedScreen = false
|
|
2541
|
+
this.state.isScreenSwitching = false
|
|
2542
|
+
this.setState({
|
|
2543
|
+
screenName: '共享模式'
|
|
2544
|
+
});
|
|
2545
|
+
console.log(pictureInPictureVideo)
|
|
2546
|
+
this.tabTitlesClick('RMScreen', 'delect')
|
|
2547
|
+
if (this.state.isPictureInPicture) {
|
|
2548
|
+
document.exitPictureInPicture()
|
|
2477
2549
|
}
|
|
2550
|
+
// if (!this.state.laveRoomSharedScreen && this.state.isSharedScreen) {
|
|
2551
|
+
// this.sharedScreen()
|
|
2552
|
+
// }
|
|
2478
2553
|
}
|
|
2479
2554
|
|
|
2480
2555
|
|
|
@@ -2534,16 +2609,11 @@ class Video extends Component {
|
|
|
2534
2609
|
}
|
|
2535
2610
|
if(this.state.imStatus) {
|
|
2536
2611
|
console.log('disconnect断开连接')
|
|
2612
|
+
this.state.manualClose = true
|
|
2537
2613
|
disconnect();
|
|
2538
2614
|
}
|
|
2539
2615
|
|
|
2540
2616
|
}
|
|
2541
|
-
clearData=()=>{
|
|
2542
|
-
this.setState = (state, callback) => {
|
|
2543
|
-
return
|
|
2544
|
-
}
|
|
2545
|
-
this.cancel = ''
|
|
2546
|
-
}
|
|
2547
2617
|
finishSessionClick= async () => {
|
|
2548
2618
|
try {
|
|
2549
2619
|
let result = await API.finishSession({
|
|
@@ -2554,6 +2624,10 @@ class Video extends Component {
|
|
|
2554
2624
|
}
|
|
2555
2625
|
}
|
|
2556
2626
|
finishSession = () => {
|
|
2627
|
+
// clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
|
|
2628
|
+
this.state.OnVolumeAnalyserMap.forEach((value,key,map)=>{
|
|
2629
|
+
clearInterval(value)
|
|
2630
|
+
})
|
|
2557
2631
|
this.timer && clearInterval(this.timer);
|
|
2558
2632
|
if(this.state.isSharedScreen) {
|
|
2559
2633
|
this.setState({
|
|
@@ -2724,6 +2798,7 @@ class Video extends Component {
|
|
|
2724
2798
|
}
|
|
2725
2799
|
|
|
2726
2800
|
voice = () => {
|
|
2801
|
+
if (this.isFileSuccuse()) {
|
|
2727
2802
|
if (!this.state.voiceStatue) {
|
|
2728
2803
|
// 静音本地
|
|
2729
2804
|
this.setState({
|
|
@@ -2778,10 +2853,11 @@ class Video extends Component {
|
|
|
2778
2853
|
console.log(data)
|
|
2779
2854
|
})
|
|
2780
2855
|
}
|
|
2856
|
+
}
|
|
2781
2857
|
};
|
|
2782
2858
|
isFileSuccuse = () => {
|
|
2783
|
-
if (!this.state.sessionId || this.state.
|
|
2784
|
-
this.messageClick(
|
|
2859
|
+
if (!this.state.sessionId || !this.state.sessionType || !this.state.imStatus) {
|
|
2860
|
+
this.messageClick('当前程序异常请先退出重开','error')
|
|
2785
2861
|
return false
|
|
2786
2862
|
} else {
|
|
2787
2863
|
return true
|
|
@@ -2837,58 +2913,31 @@ class Video extends Component {
|
|
|
2837
2913
|
}
|
|
2838
2914
|
}
|
|
2839
2915
|
};
|
|
2840
|
-
|
|
2916
|
+
sharedScreen = () => {
|
|
2917
|
+
console.log('投屏')
|
|
2841
2918
|
if (this.isFileSuccuse()) {
|
|
2842
2919
|
const publish_config = {};
|
|
2920
|
+
if(streamShare) {
|
|
2921
|
+
streamShare.getTracks().forEach(track => track.stop());
|
|
2922
|
+
}
|
|
2843
2923
|
if (this.state.isSharedScreen) {
|
|
2844
2924
|
const publish_config = {}
|
|
2845
2925
|
publish_config.media_type = 1
|
|
2846
2926
|
publish_config.publish_device = 2
|
|
2847
|
-
publish_config.video_profile_type = 1
|
|
2927
|
+
// publish_config.video_profile_type = 1
|
|
2928
|
+
publish_config.video_profile_type=100
|
|
2929
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2848
2930
|
publish_config.enableDesktopAudio=true
|
|
2849
2931
|
publish_config.degradationType=2
|
|
2850
2932
|
publish_config.sid = document.getElementById('video20').name
|
|
2851
2933
|
this.test_controller.ChangeMediaStream(publish_config)
|
|
2852
2934
|
this.state.isScreenSwitching = true
|
|
2853
|
-
}
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
sharedScreen = () => {
|
|
2857
|
-
console.log('投屏')
|
|
2858
|
-
if (this.isFileSuccuse()) {
|
|
2859
|
-
const publish_config = {};
|
|
2860
|
-
if(streamShare) {
|
|
2861
|
-
streamShare.getTracks().forEach(track => track.stop());
|
|
2862
|
-
}
|
|
2863
|
-
if (this.state.isSharedScreen) {
|
|
2864
|
-
// if (this.state.isWhiteboard) {
|
|
2865
|
-
// publish_config.publish_device = 4
|
|
2866
|
-
// publish_config.media_type = 1
|
|
2867
|
-
// publish_config.sid = document.getElementById('video20').name
|
|
2868
|
-
// publish_config.part_of_screen_id = 'touBoxItem'
|
|
2869
|
-
// publish_config.video_profile_type = 5
|
|
2870
|
-
// this.test_controller.ChangeMediaStream(publish_config);
|
|
2871
|
-
// this.setState({
|
|
2872
|
-
// isPDF: true,
|
|
2873
|
-
// })
|
|
2874
|
-
// } else {
|
|
2875
|
-
this.test_controller.UnPublish(document.getElementById('video20').name)
|
|
2876
|
-
// }
|
|
2877
|
-
this.state.isSharedScreen = false
|
|
2878
|
-
this.state.isScreenSwitching = false
|
|
2879
|
-
this.setState({
|
|
2880
|
-
screenName: '共享模式'
|
|
2881
|
-
});
|
|
2882
|
-
console.log(pictureInPictureVideo)
|
|
2883
|
-
this.tabTitlesClick('RMScreen', 'delect')
|
|
2884
|
-
if (this.state.isPictureInPicture) {
|
|
2885
|
-
document.exitPictureInPicture()
|
|
2886
|
-
}
|
|
2887
2935
|
} else {
|
|
2888
2936
|
if (document.getElementById('video20').name) {
|
|
2889
2937
|
publish_config.media_type = 1;
|
|
2890
2938
|
publish_config.publish_device = 2;
|
|
2891
|
-
publish_config.video_profile_type
|
|
2939
|
+
publish_config.video_profile_type=100
|
|
2940
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2892
2941
|
publish_config.enableDesktopAudio=true
|
|
2893
2942
|
publish_config.degradationType=2
|
|
2894
2943
|
publish_config.sid = document.getElementById('video20').name;
|
|
@@ -2897,7 +2946,8 @@ class Video extends Component {
|
|
|
2897
2946
|
publish_config.media_type = 1
|
|
2898
2947
|
publish_config.publish_device = 2
|
|
2899
2948
|
publish_config.need_volume_analyser = true
|
|
2900
|
-
publish_config.video_profile_type
|
|
2949
|
+
publish_config.video_profile_type=100
|
|
2950
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2901
2951
|
publish_config.enableDesktopAudio=true
|
|
2902
2952
|
publish_config.degradationType=2
|
|
2903
2953
|
publish_config.publish_video_id = 'video20'
|
|
@@ -2908,7 +2958,7 @@ class Video extends Component {
|
|
|
2908
2958
|
// this.state.isSharedScreen = true
|
|
2909
2959
|
// this.state.isScreenSwitching = false
|
|
2910
2960
|
this.setState({
|
|
2911
|
-
screenName: '
|
|
2961
|
+
screenName: '切换共享',
|
|
2912
2962
|
isPDF: false
|
|
2913
2963
|
})
|
|
2914
2964
|
this.tabTitlesClick(
|
|
@@ -3049,6 +3099,7 @@ class Video extends Component {
|
|
|
3049
3099
|
transcribingClick = () => {
|
|
3050
3100
|
};
|
|
3051
3101
|
invitationClick = () => {
|
|
3102
|
+
if (this.isFileSuccuse()) {
|
|
3052
3103
|
this.state.linkData = ''
|
|
3053
3104
|
this.setState({
|
|
3054
3105
|
isModalVisibleInvitation: true,
|
|
@@ -3057,7 +3108,7 @@ class Video extends Component {
|
|
|
3057
3108
|
employeeError: '',
|
|
3058
3109
|
|
|
3059
3110
|
})
|
|
3060
|
-
|
|
3111
|
+
}
|
|
3061
3112
|
}
|
|
3062
3113
|
handleOkInvitation = async () => {
|
|
3063
3114
|
if(!this.state.employeeName || this.state.employeeError) {
|
|
@@ -3246,7 +3297,9 @@ class Video extends Component {
|
|
|
3246
3297
|
videoTwelveName: this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById("feedId12").innerText).tag == 'VIDEO_SOURCE_SCREEN' ? '共享屏幕' : data ? data : '客户12'
|
|
3247
3298
|
})
|
|
3248
3299
|
}
|
|
3249
|
-
this.
|
|
3300
|
+
if(this.state.isPictureInPicture) {
|
|
3301
|
+
this.pictureInPicture('Refresh')
|
|
3302
|
+
}
|
|
3250
3303
|
} catch (err) {
|
|
3251
3304
|
if(err.status == 502 || err.status== 404) {
|
|
3252
3305
|
this.roomCallBack(2, '连接服务器失败','SYS-02')
|
|
@@ -3341,14 +3394,16 @@ class Video extends Component {
|
|
|
3341
3394
|
publish_config.degradationType=2
|
|
3342
3395
|
publish_config.sid = document.getElementById('video20').name
|
|
3343
3396
|
publish_config.stream = canvas.captureStream(10)
|
|
3344
|
-
publish_config.video_profile_type
|
|
3397
|
+
publish_config.video_profile_type=100
|
|
3398
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3345
3399
|
this.test_controller.ChangeMediaStream(publish_config);
|
|
3346
3400
|
} else {
|
|
3347
3401
|
|
|
3348
3402
|
publish_config.media_type = 1
|
|
3349
3403
|
publish_config.publish_device = 5
|
|
3350
3404
|
publish_config.need_volume_analyser = true
|
|
3351
|
-
publish_config.video_profile_type
|
|
3405
|
+
publish_config.video_profile_type=100
|
|
3406
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3352
3407
|
publish_config.degradationType=2
|
|
3353
3408
|
publish_config.stream = canvas.captureStream(10)
|
|
3354
3409
|
publish_config.publish_video_id = 'video20'
|
|
@@ -3379,7 +3434,7 @@ class Video extends Component {
|
|
|
3379
3434
|
});
|
|
3380
3435
|
}
|
|
3381
3436
|
switchExternal = () => {
|
|
3382
|
-
|
|
3437
|
+
if (this.isFileSuccuse()) {
|
|
3383
3438
|
if (!this.state.isWhiteboard) {
|
|
3384
3439
|
this.setState({
|
|
3385
3440
|
isWhiteboard: true
|
|
@@ -3405,7 +3460,7 @@ class Video extends Component {
|
|
|
3405
3460
|
|
|
3406
3461
|
}
|
|
3407
3462
|
|
|
3408
|
-
|
|
3463
|
+
}
|
|
3409
3464
|
}
|
|
3410
3465
|
switchSelect = (value) => {
|
|
3411
3466
|
this.setState({
|
|
@@ -3427,7 +3482,9 @@ class Video extends Component {
|
|
|
3427
3482
|
}
|
|
3428
3483
|
}
|
|
3429
3484
|
inspection = () => {
|
|
3485
|
+
if (this.isFileSuccuse()) {
|
|
3430
3486
|
this.test_controller.GetDevices()
|
|
3487
|
+
}
|
|
3431
3488
|
}
|
|
3432
3489
|
handleOkInspection = () => {
|
|
3433
3490
|
this.setState({
|
|
@@ -4049,7 +4106,6 @@ class Video extends Component {
|
|
|
4049
4106
|
ocrClick={this.ocrClick}
|
|
4050
4107
|
switchExternal={this.switchExternalAge}
|
|
4051
4108
|
inspection={this.inspection}
|
|
4052
|
-
screenSwitching={this.screenSwitching}
|
|
4053
4109
|
></Foot>
|
|
4054
4110
|
<Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
|
|
4055
4111
|
onCancel={this.handleCancel}>
|