react_hsbc_teller 1.1.6 → 1.1.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.
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/common/websocket.js +13 -4
- package/packages/pages/video/video.jsx +50 -45
package/package.json
CHANGED
|
@@ -47,7 +47,9 @@ function websocketonopen() { // 连接建立之后执行send方法发送数据
|
|
|
47
47
|
websocketsend(json2xml(steam));
|
|
48
48
|
}
|
|
49
49
|
function websocketonerror() { // 连接建立失败重连
|
|
50
|
-
window.IMOpenfire(
|
|
50
|
+
window.IMOpenfire({
|
|
51
|
+
status: 'error'
|
|
52
|
+
});
|
|
51
53
|
console.log('失败');
|
|
52
54
|
// initWebSocket()
|
|
53
55
|
}
|
|
@@ -99,11 +101,15 @@ function websocketonmessage(e) {
|
|
|
99
101
|
} else if (undefined != jsondata.failure) {
|
|
100
102
|
islogin = false;
|
|
101
103
|
console.log('登录失败,用户名或者密码错误');
|
|
102
|
-
window.IMOpenfire(
|
|
104
|
+
window.IMOpenfire({
|
|
105
|
+
status: 'error'
|
|
106
|
+
});
|
|
103
107
|
} else if (undefined != jsondata.success) {
|
|
104
108
|
islogin = true;
|
|
105
109
|
console.log('登录成功!');
|
|
106
|
-
window.IMOpenfire(
|
|
110
|
+
window.IMOpenfire({
|
|
111
|
+
status: 'success'
|
|
112
|
+
});
|
|
107
113
|
// 发起新的流
|
|
108
114
|
newopen();
|
|
109
115
|
} else if (undefined != jsondata.iq) {
|
|
@@ -203,7 +209,10 @@ function websocketsend(Data) { // 数据发送
|
|
|
203
209
|
}
|
|
204
210
|
function websocketclose(e) { // 关闭
|
|
205
211
|
console.log('断开连接', e);
|
|
206
|
-
|
|
212
|
+
islogin = false;
|
|
213
|
+
window.IMOpenfire({
|
|
214
|
+
status: 'close'
|
|
215
|
+
})
|
|
207
216
|
}
|
|
208
217
|
// 发消息
|
|
209
218
|
// // 发送消息 to---接收者id,from---发送者id,type---消息类型(chat--单聊,groupchat--群聊)。message--发送的消息
|
|
@@ -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,7 +165,9 @@ 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'
|
|
@@ -842,8 +846,9 @@ class Video extends Component {
|
|
|
842
846
|
let analyser = this.state.analyserData.get(sid)
|
|
843
847
|
aou(analyser)
|
|
844
848
|
function aou(analyser){
|
|
849
|
+
cancelAnimationFrame(microTimerMap.get(sid))
|
|
845
850
|
if(analyser) {
|
|
846
|
-
|
|
851
|
+
|
|
847
852
|
let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
848
853
|
analyser.getByteFrequencyData(dataArray);
|
|
849
854
|
let step = Math.round(dataArray.length / 60); //采样步长
|
|
@@ -867,11 +872,12 @@ class Video extends Component {
|
|
|
867
872
|
let startY = y1 - height // 绘制起始点y
|
|
868
873
|
cobj.fillRect(startX, startY, width, height )
|
|
869
874
|
}
|
|
875
|
+
}
|
|
870
876
|
microTimerMap.set(sid,requestAnimationFrame(aou.bind(this, analyser)) )
|
|
871
877
|
}
|
|
872
878
|
|
|
873
879
|
|
|
874
|
-
|
|
880
|
+
|
|
875
881
|
}
|
|
876
882
|
|
|
877
883
|
}
|
|
@@ -1352,10 +1358,10 @@ class Video extends Component {
|
|
|
1352
1358
|
};
|
|
1353
1359
|
window.IMOpenfire = msg =>{
|
|
1354
1360
|
console.log('im登录', msg)
|
|
1355
|
-
if(
|
|
1361
|
+
if(msg.status == 'error') {
|
|
1356
1362
|
this.state.sessionType = false
|
|
1357
1363
|
this.roomCallBack(2, 'im建立连接失败',5)
|
|
1358
|
-
} else {
|
|
1364
|
+
} else if (msg.status == 'success') {
|
|
1359
1365
|
this.state.imStatus = msg
|
|
1360
1366
|
setTimeout(() => {
|
|
1361
1367
|
if(this.state.imRoomId && !this.state.imJoinRoom) {
|
|
@@ -1364,6 +1370,15 @@ class Video extends Component {
|
|
|
1364
1370
|
console.log('IMOpenfire 加入im房间')
|
|
1365
1371
|
}
|
|
1366
1372
|
}, 200);
|
|
1373
|
+
} else if (msg.status == 'close') {
|
|
1374
|
+
if(!this.state.manualClose) {
|
|
1375
|
+
this.timer && clearInterval(this.timer);
|
|
1376
|
+
this.state.sessionType = false
|
|
1377
|
+
console.log('IMOpenfireclose')
|
|
1378
|
+
this.roomCallBack(2, '账号重复登录',9)
|
|
1379
|
+
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1367
1382
|
}
|
|
1368
1383
|
|
|
1369
1384
|
}
|
|
@@ -1539,8 +1554,8 @@ class Video extends Component {
|
|
|
1539
1554
|
// 音视频关闭通知
|
|
1540
1555
|
this.test_controller.OnMediaClose = (code, sid) => {
|
|
1541
1556
|
console.log(code, sid)
|
|
1542
|
-
if(code == 5004 || code == 5007) {
|
|
1543
|
-
this.roomCallBack(2, '
|
|
1557
|
+
if(code == 5003 || code == 5004 || code == 5005|| code == 5007|| code == 5009|| code == 5010 || code == 5011|| code == 5012) {
|
|
1558
|
+
this.roomCallBack(2, '音视频异常关闭',8)
|
|
1544
1559
|
}
|
|
1545
1560
|
};
|
|
1546
1561
|
// 加入房间成功
|
|
@@ -1550,7 +1565,9 @@ class Video extends Component {
|
|
|
1550
1565
|
publish_config.media_type = 1
|
|
1551
1566
|
publish_config.publish_device = 1
|
|
1552
1567
|
publish_config.need_volume_analyser = true
|
|
1553
|
-
publish_config.video_profile_type = 3
|
|
1568
|
+
// publish_config.video_profile_type = 3
|
|
1569
|
+
publish_config.video_profile_type=100
|
|
1570
|
+
publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
|
|
1554
1571
|
publish_config.publish_video_id = 'publish_video1'
|
|
1555
1572
|
publish_config.publish_streamId_id = 'publish_streamId1'
|
|
1556
1573
|
publish_config.publish_tag = 'tag1'
|
|
@@ -1797,26 +1814,11 @@ class Video extends Component {
|
|
|
1797
1814
|
// 推送“新加⼊房间者”给与会者
|
|
1798
1815
|
this.test_controller.OnNewJoinerIn = (participant) => {
|
|
1799
1816
|
console.log('新加⼊房间者', participant);
|
|
1800
|
-
// this.test_controller.ChangeStreamSize(document.getElementById('publish_video1').name, 5)
|
|
1801
1817
|
this.state.isCustomer= true
|
|
1802
1818
|
};
|
|
1803
1819
|
// 推送“有新发布”给与会者
|
|
1804
1820
|
this.test_controller.OnNewPublish = (feed) => {
|
|
1805
1821
|
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
1822
|
|
|
1821
1823
|
callNimIM('sendCustomCmdMsg', {
|
|
1822
1824
|
customId: this.state.imRoomId,
|
|
@@ -2159,14 +2161,9 @@ class Video extends Component {
|
|
|
2159
2161
|
this.test_controller.OnUnSubscribe = (unsubscriber, feed) => {
|
|
2160
2162
|
console.log('取消订阅者', unsubscriber, feed)
|
|
2161
2163
|
};
|
|
2162
|
-
// ⾳视频关闭通知
|
|
2163
|
-
this.test_controller.OnMediaClose = (code, sid) => {
|
|
2164
|
-
console.log('⾳视频关闭通知', code, sid)
|
|
2165
|
-
};
|
|
2166
2164
|
// 退出房间回调
|
|
2167
2165
|
this.test_controller.OnLeaveRoom = (leaveType) => {
|
|
2168
2166
|
console.log('退出房间回调', leaveType);
|
|
2169
|
-
|
|
2170
2167
|
};
|
|
2171
2168
|
// 推送“退出房间者”给与会者
|
|
2172
2169
|
this.test_controller.OnParticipantLeaveRoom = (
|
|
@@ -2366,6 +2363,7 @@ class Video extends Component {
|
|
|
2366
2363
|
console.log('服务端录制初始化成功', record_id, record_third_id)
|
|
2367
2364
|
};
|
|
2368
2365
|
this.test_controller.OnVolumeAnalyser = (sid, analyser) => {
|
|
2366
|
+
cancelAnimationFrame(this.state.OnVolumeAnalyserMap.get(sid))
|
|
2369
2367
|
let publish_sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
|
|
2370
2368
|
let subscribe_sid1 = document.getElementById('video1').name || document.getElementById('audio1').name;
|
|
2371
2369
|
let subscribe_sid2 = document.getElementById('video2').name || document.getElementById('audio2').name;
|
|
@@ -2461,7 +2459,8 @@ class Video extends Component {
|
|
|
2461
2459
|
}
|
|
2462
2460
|
|
|
2463
2461
|
}
|
|
2464
|
-
requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser))
|
|
2462
|
+
this.state.OnVolumeAnalyserMap.set(sid,requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser)))
|
|
2463
|
+
this.state.OnVolumeAnalyserMap = this.state.OnVolumeAnalyserMap
|
|
2465
2464
|
|
|
2466
2465
|
this.state.analyserData.set(sid, analyser)
|
|
2467
2466
|
this.state.analyserData = this.state.analyserData
|
|
@@ -2534,16 +2533,11 @@ class Video extends Component {
|
|
|
2534
2533
|
}
|
|
2535
2534
|
if(this.state.imStatus) {
|
|
2536
2535
|
console.log('disconnect断开连接')
|
|
2536
|
+
this.state.manualClose = true
|
|
2537
2537
|
disconnect();
|
|
2538
2538
|
}
|
|
2539
2539
|
|
|
2540
2540
|
}
|
|
2541
|
-
clearData=()=>{
|
|
2542
|
-
this.setState = (state, callback) => {
|
|
2543
|
-
return
|
|
2544
|
-
}
|
|
2545
|
-
this.cancel = ''
|
|
2546
|
-
}
|
|
2547
2541
|
finishSessionClick= async () => {
|
|
2548
2542
|
try {
|
|
2549
2543
|
let result = await API.finishSession({
|
|
@@ -2724,6 +2718,7 @@ class Video extends Component {
|
|
|
2724
2718
|
}
|
|
2725
2719
|
|
|
2726
2720
|
voice = () => {
|
|
2721
|
+
if (this.isFileSuccuse()) {
|
|
2727
2722
|
if (!this.state.voiceStatue) {
|
|
2728
2723
|
// 静音本地
|
|
2729
2724
|
this.setState({
|
|
@@ -2778,10 +2773,11 @@ class Video extends Component {
|
|
|
2778
2773
|
console.log(data)
|
|
2779
2774
|
})
|
|
2780
2775
|
}
|
|
2776
|
+
}
|
|
2781
2777
|
};
|
|
2782
2778
|
isFileSuccuse = () => {
|
|
2783
|
-
if (!this.state.sessionId || this.state.isSuspend) {
|
|
2784
|
-
this.messageClick(
|
|
2779
|
+
if (!this.state.sessionId || this.state.isSuspend || !this.state.sessionType) {
|
|
2780
|
+
this.messageClick('当前程序异常请先退出重开','error')
|
|
2785
2781
|
return false
|
|
2786
2782
|
} else {
|
|
2787
2783
|
return true
|
|
@@ -2844,7 +2840,9 @@ class Video extends Component {
|
|
|
2844
2840
|
const publish_config = {}
|
|
2845
2841
|
publish_config.media_type = 1
|
|
2846
2842
|
publish_config.publish_device = 2
|
|
2847
|
-
publish_config.video_profile_type = 1
|
|
2843
|
+
// publish_config.video_profile_type = 1
|
|
2844
|
+
publish_config.video_profile_type=100
|
|
2845
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2848
2846
|
publish_config.enableDesktopAudio=true
|
|
2849
2847
|
publish_config.degradationType=2
|
|
2850
2848
|
publish_config.sid = document.getElementById('video20').name
|
|
@@ -2888,7 +2886,8 @@ class Video extends Component {
|
|
|
2888
2886
|
if (document.getElementById('video20').name) {
|
|
2889
2887
|
publish_config.media_type = 1;
|
|
2890
2888
|
publish_config.publish_device = 2;
|
|
2891
|
-
publish_config.video_profile_type
|
|
2889
|
+
publish_config.video_profile_type=100
|
|
2890
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2892
2891
|
publish_config.enableDesktopAudio=true
|
|
2893
2892
|
publish_config.degradationType=2
|
|
2894
2893
|
publish_config.sid = document.getElementById('video20').name;
|
|
@@ -2897,7 +2896,8 @@ class Video extends Component {
|
|
|
2897
2896
|
publish_config.media_type = 1
|
|
2898
2897
|
publish_config.publish_device = 2
|
|
2899
2898
|
publish_config.need_volume_analyser = true
|
|
2900
|
-
publish_config.video_profile_type
|
|
2899
|
+
publish_config.video_profile_type=100
|
|
2900
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
2901
2901
|
publish_config.enableDesktopAudio=true
|
|
2902
2902
|
publish_config.degradationType=2
|
|
2903
2903
|
publish_config.publish_video_id = 'video20'
|
|
@@ -3049,6 +3049,7 @@ class Video extends Component {
|
|
|
3049
3049
|
transcribingClick = () => {
|
|
3050
3050
|
};
|
|
3051
3051
|
invitationClick = () => {
|
|
3052
|
+
if (this.isFileSuccuse()) {
|
|
3052
3053
|
this.state.linkData = ''
|
|
3053
3054
|
this.setState({
|
|
3054
3055
|
isModalVisibleInvitation: true,
|
|
@@ -3057,7 +3058,7 @@ class Video extends Component {
|
|
|
3057
3058
|
employeeError: '',
|
|
3058
3059
|
|
|
3059
3060
|
})
|
|
3060
|
-
|
|
3061
|
+
}
|
|
3061
3062
|
}
|
|
3062
3063
|
handleOkInvitation = async () => {
|
|
3063
3064
|
if(!this.state.employeeName || this.state.employeeError) {
|
|
@@ -3341,14 +3342,16 @@ class Video extends Component {
|
|
|
3341
3342
|
publish_config.degradationType=2
|
|
3342
3343
|
publish_config.sid = document.getElementById('video20').name
|
|
3343
3344
|
publish_config.stream = canvas.captureStream(10)
|
|
3344
|
-
publish_config.video_profile_type
|
|
3345
|
+
publish_config.video_profile_type=100
|
|
3346
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3345
3347
|
this.test_controller.ChangeMediaStream(publish_config);
|
|
3346
3348
|
} else {
|
|
3347
3349
|
|
|
3348
3350
|
publish_config.media_type = 1
|
|
3349
3351
|
publish_config.publish_device = 5
|
|
3350
3352
|
publish_config.need_volume_analyser = true
|
|
3351
|
-
publish_config.video_profile_type
|
|
3353
|
+
publish_config.video_profile_type=100
|
|
3354
|
+
publish_config.video_profile_diy={width:1280, height:720, frameRate:8, bitrate:1500}
|
|
3352
3355
|
publish_config.degradationType=2
|
|
3353
3356
|
publish_config.stream = canvas.captureStream(10)
|
|
3354
3357
|
publish_config.publish_video_id = 'video20'
|
|
@@ -3379,7 +3382,7 @@ class Video extends Component {
|
|
|
3379
3382
|
});
|
|
3380
3383
|
}
|
|
3381
3384
|
switchExternal = () => {
|
|
3382
|
-
|
|
3385
|
+
if (this.isFileSuccuse()) {
|
|
3383
3386
|
if (!this.state.isWhiteboard) {
|
|
3384
3387
|
this.setState({
|
|
3385
3388
|
isWhiteboard: true
|
|
@@ -3405,7 +3408,7 @@ class Video extends Component {
|
|
|
3405
3408
|
|
|
3406
3409
|
}
|
|
3407
3410
|
|
|
3408
|
-
|
|
3411
|
+
}
|
|
3409
3412
|
}
|
|
3410
3413
|
switchSelect = (value) => {
|
|
3411
3414
|
this.setState({
|
|
@@ -3427,7 +3430,9 @@ class Video extends Component {
|
|
|
3427
3430
|
}
|
|
3428
3431
|
}
|
|
3429
3432
|
inspection = () => {
|
|
3433
|
+
if (this.isFileSuccuse()) {
|
|
3430
3434
|
this.test_controller.GetDevices()
|
|
3435
|
+
}
|
|
3431
3436
|
}
|
|
3432
3437
|
handleOkInspection = () => {
|
|
3433
3438
|
this.setState({
|