react_hsbc_teller 2.0.68 → 2.0.70
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/README.md +7 -0
- package/lib/hsbc.js +1 -1
- package/package.json +1 -1
- package/packages/assets/mp3/connect_error.mp3 +0 -0
- package/packages/assets/mp3/startMedia_error.mp3 +0 -0
- package/packages/demo/demo.js +14 -0
- package/packages/pages/video/video.jsx +77 -24
- package/packages/pages/video/video.less +3 -0
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/packages/demo/demo.js
CHANGED
|
@@ -45,6 +45,16 @@ class Demo extends Component {
|
|
|
45
45
|
audioinputNameList: ['默认值 - 外部麦克风 (Realtek(R) Audio)']
|
|
46
46
|
}
|
|
47
47
|
componentWillMount() {
|
|
48
|
+
if(window.localStorage.getItem('sessionId') && window.localStorage.getItem('sessionId') != 'null' && window.localStorage.getItem('sessionId') != 'undefined') {
|
|
49
|
+
this.setState({roomId: window.localStorage.getItem('roomId')});
|
|
50
|
+
this.setState({mtoken: window.localStorage.getItem('mtoken')});
|
|
51
|
+
this.setState({sessionId:window.localStorage.getItem('sessionId')});
|
|
52
|
+
this.setState({imRoomId: window.localStorage.getItem('imRoomId')});
|
|
53
|
+
this.setState({
|
|
54
|
+
isVideo: true
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
48
58
|
}
|
|
49
59
|
handleChangeRoomId = (event) => {
|
|
50
60
|
this.setState({roomId: event.target.value});
|
|
@@ -73,6 +83,10 @@ onLeaveRoom = (val) => {
|
|
|
73
83
|
this.setState({
|
|
74
84
|
isVideo: false
|
|
75
85
|
})
|
|
86
|
+
this.setState({roomId: ''});
|
|
87
|
+
this.setState({mtoken: ''});
|
|
88
|
+
this.setState({sessionId: ''});
|
|
89
|
+
this.setState({imRoomId: ''});
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
handleChangeTeller = (event) => {
|
|
@@ -46,11 +46,13 @@ import IpadLeaveAudio from '../../assets/mp3/ipad_leave_error.mp3';
|
|
|
46
46
|
import IpadLowPowerAudio from '../../assets/mp3/ipad_low_power.mp3';
|
|
47
47
|
import ipadMediaCloseAudio from '../../assets/mp3/ipad_media_close.mp3';
|
|
48
48
|
import MediaErrorAudio from '../../assets/mp3/media_error.mp3';
|
|
49
|
+
import startMediaError from '../../assets/mp3/startMedia_error.mp3'
|
|
49
50
|
import internalJoin from '../../assets/mp3/internalJoin.mp3'
|
|
50
51
|
import internalLeft from '../../assets/mp3/internalLeft.mp3'
|
|
51
52
|
import leftMetting from '../../assets/mp3/leftmeeting.mp3'
|
|
52
53
|
import networkWeakAudio from '../../assets/mp3/networkweak.mp3'
|
|
53
54
|
import PIPictureClosedAudio from '../../assets/mp3/pip_close.mp3'
|
|
55
|
+
import connectErrorAudio from '../../assets/mp3/connect_error.mp3'
|
|
54
56
|
import screenSharedIntervalAudio from '../../assets/mp3/share_stop_audio.mp3'
|
|
55
57
|
import errorPng from '../../assets/img/tooltips2_fail.png'
|
|
56
58
|
import styled from 'styled-components';
|
|
@@ -61,7 +63,7 @@ import MultiModule from '../multiModule/multiModule'//签字、抄录
|
|
|
61
63
|
import axios from 'axios';
|
|
62
64
|
import CryptoJS from "crypto-js";
|
|
63
65
|
|
|
64
|
-
const SDK_VERISON = '2.0.
|
|
66
|
+
const SDK_VERISON = '2.0.70'
|
|
65
67
|
const IDtypeFront = '请客户在其设备后置摄像头下展示证件正面(如:身份证照片页面)'
|
|
66
68
|
const IDtypeBack = '请在后置摄像头下展示证件反面(如:身份证国徽页)'
|
|
67
69
|
const { Option } = Select;
|
|
@@ -344,6 +346,9 @@ class Video extends Component {
|
|
|
344
346
|
certificateValidityType: true,
|
|
345
347
|
drawCanvasInterval: null,
|
|
346
348
|
faceDetectionTimer: null, // 人脸检测定时器
|
|
349
|
+
mediaErrorModalMessage: '',
|
|
350
|
+
transcribeErrorModalVisible: false, // 双录异常
|
|
351
|
+
transcribeErrorCode: ''
|
|
347
352
|
};
|
|
348
353
|
// eslint-disable-next-line no-undef
|
|
349
354
|
test_controller = '';
|
|
@@ -763,6 +768,7 @@ class Video extends Component {
|
|
|
763
768
|
},
|
|
764
769
|
];
|
|
765
770
|
recordParam.tagPositions = list
|
|
771
|
+
// recordParam.tagFilter = 'customer1'
|
|
766
772
|
console.log('recordParam', recordParam);
|
|
767
773
|
that.test_controller.StartRemoteRecord(filePath, recordParam, record_business_id)
|
|
768
774
|
|
|
@@ -1577,7 +1583,7 @@ class Video extends Component {
|
|
|
1577
1583
|
})
|
|
1578
1584
|
this.saveLog('aborted code:' + code)
|
|
1579
1585
|
if (this.state.sessionId) {
|
|
1580
|
-
if (code == 'SYS-01' || code == 'SYS-02') {
|
|
1586
|
+
if (code == 'SYS-01' || code == 'SYS-02' || String(code).includes('record-')) {
|
|
1581
1587
|
this.props.joinRoomCallback({
|
|
1582
1588
|
type: type,
|
|
1583
1589
|
errorManage: manege,
|
|
@@ -1594,7 +1600,7 @@ class Video extends Component {
|
|
|
1594
1600
|
}
|
|
1595
1601
|
|
|
1596
1602
|
} else {
|
|
1597
|
-
if (code == 'SYS-01' || code == 'SYS-02') {
|
|
1603
|
+
if (code == 'SYS-01' || code == 'SYS-02' || String(code).includes('record-')) {
|
|
1598
1604
|
this.props.createRoomCallback({
|
|
1599
1605
|
type: type,
|
|
1600
1606
|
errorManage: manege,
|
|
@@ -2297,7 +2303,7 @@ class Video extends Component {
|
|
|
2297
2303
|
this.saveLog('Failed to get device, code='+code)
|
|
2298
2304
|
this.state.sessionType = false
|
|
2299
2305
|
this.messageClick('获取设备失败,请检查摄像头设备是否可用或是否禁用摄像头', 'error')
|
|
2300
|
-
this.roomCallBack(2, '获取设备失败', 1)
|
|
2306
|
+
this.roomCallBack(2, '获取设备失败', '1-' + code)
|
|
2301
2307
|
this.showEnvDetection()
|
|
2302
2308
|
};
|
|
2303
2309
|
// 建立连接成功
|
|
@@ -2306,10 +2312,21 @@ class Video extends Component {
|
|
|
2306
2312
|
this.ConnectMRTC()
|
|
2307
2313
|
};
|
|
2308
2314
|
this.test_controller.OnConnectFailed = (code, msg) => {
|
|
2315
|
+
// -101:初始化超时-102/-1004:初始化失败 (MTC close) 30001: 信令连接失败 transcribeError
|
|
2309
2316
|
console.log('建立连接失败', code, msg)
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2317
|
+
if(code == 30001) {
|
|
2318
|
+
this.setState({
|
|
2319
|
+
transcribeErrorCode: 30001,
|
|
2320
|
+
transcribeErrorModalVisible: true
|
|
2321
|
+
})
|
|
2322
|
+
} else {
|
|
2323
|
+
|
|
2324
|
+
this.saveLog('Failed to establish connection,' + code)
|
|
2325
|
+
this.messageClick('建立连接失败', 'error')
|
|
2326
|
+
this.state.sessionType = false
|
|
2327
|
+
this.roomCallBack(2, '连接失败', '2-'+code)
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2313
2330
|
};
|
|
2314
2331
|
// 断开连接回调
|
|
2315
2332
|
this.test_controller.OnConnectClose = (code, msg) => {
|
|
@@ -2325,7 +2342,7 @@ class Video extends Component {
|
|
|
2325
2342
|
console.log('初始化房间失败', err_code, err_msg)
|
|
2326
2343
|
this.saveLog('Failed to initialize room,' + err_code)
|
|
2327
2344
|
this.state.sessionType = false
|
|
2328
|
-
this.roomCallBack(2, '初始化失败', 3)
|
|
2345
|
+
this.roomCallBack(2, '初始化失败', '3-' + err_code)
|
|
2329
2346
|
};
|
|
2330
2347
|
// 初始化成功回调
|
|
2331
2348
|
this.test_controller.OnInitRoomConfigOK = () => {
|
|
@@ -2357,7 +2374,7 @@ class Video extends Component {
|
|
|
2357
2374
|
console.log('创建房间失败', err_code, err_msg)
|
|
2358
2375
|
this.saveLog('Failed to create room,' + err_code)
|
|
2359
2376
|
this.state.sessionType = false
|
|
2360
|
-
this.roomCallBack(2, '创建房间失败', 7)
|
|
2377
|
+
this.roomCallBack(2, '创建房间失败', '7-' + err_code)
|
|
2361
2378
|
};
|
|
2362
2379
|
// 初始化⾳视频成功
|
|
2363
2380
|
this.test_controller.OnMediaCallSucc = (sid) => {
|
|
@@ -2370,8 +2387,13 @@ class Video extends Component {
|
|
|
2370
2387
|
this.saveLog('OnMediaCallFail, code=' + err_code)
|
|
2371
2388
|
};
|
|
2372
2389
|
|
|
2373
|
-
const playAudioTip = () => {
|
|
2374
|
-
this.messageClick('
|
|
2390
|
+
const playAudioTip = (code) => {
|
|
2391
|
+
this.messageClick('媒体流服务异常断开,请刷新', 'error')
|
|
2392
|
+
if(code == 5003) {
|
|
2393
|
+
this.state.mediaErrorModalMessage = '媒体流服务异常,请刷新('+ code + ')'
|
|
2394
|
+
} else {
|
|
2395
|
+
this.state.mediaErrorModalMessage = '媒体流服务异常,请刷新('+ code + ')'
|
|
2396
|
+
}
|
|
2375
2397
|
this.setState({
|
|
2376
2398
|
mediaErrorModalVisible: true,
|
|
2377
2399
|
})
|
|
@@ -2380,7 +2402,11 @@ class Video extends Component {
|
|
|
2380
2402
|
this.mediaErrorPlay = () => {
|
|
2381
2403
|
if(this.state.mediaErrorModalVisible){
|
|
2382
2404
|
if (this.mediaErrorAudio) this.mediaErrorAudio.pause()
|
|
2383
|
-
|
|
2405
|
+
if(code == 5003) {
|
|
2406
|
+
this.mediaErrorAudio = new Audio(startMediaError)
|
|
2407
|
+
} else {
|
|
2408
|
+
this.mediaErrorAudio = new Audio(MediaErrorAudio)
|
|
2409
|
+
}
|
|
2384
2410
|
this.mediaErrorAudio.play()
|
|
2385
2411
|
this.mediaErrorPlayTimer = setTimeout(this.mediaErrorPlay, 3000);
|
|
2386
2412
|
}
|
|
@@ -2391,12 +2417,17 @@ class Video extends Component {
|
|
|
2391
2417
|
this.test_controller.OnMediaClose = (code, sid) => {
|
|
2392
2418
|
console.log('OnMediaClose',code, sid)
|
|
2393
2419
|
if (code == 5003 || code == 5004 || code == 5005 || code == 5007 || code == 5009 || code == 5010 || code == 5011 || code == 5012) {
|
|
2394
|
-
if (sid == this.state.publishSid) {
|
|
2420
|
+
if (sid == this.state.publishSid) {
|
|
2395
2421
|
this.saveLog('Audio and video close notification,' + code)
|
|
2396
|
-
this.roomCallBack(2, '音视频异常关闭', 8)
|
|
2422
|
+
this.roomCallBack(2, '音视频异常关闭', '8-' + code)
|
|
2397
2423
|
if (code == 5007 || code == 5007 || code == 5009 || code == 5010 || code == 5011) {
|
|
2398
2424
|
this.saveVideoPoint('conFail', `RM端媒体链路断开, err_code=${code}`)
|
|
2399
|
-
playAudioTip();
|
|
2425
|
+
playAudioTip(code);
|
|
2426
|
+
}
|
|
2427
|
+
//5003:启动流失败(信令阶段)
|
|
2428
|
+
if (code == 5003) {
|
|
2429
|
+
this.saveVideoPoint('conFail', `RM端启动流失败, err_code=${code}`)
|
|
2430
|
+
playAudioTip(code);
|
|
2400
2431
|
}
|
|
2401
2432
|
} else if (sid == this.state.publishScreenSid) {
|
|
2402
2433
|
this.state.isScreenSwitching = false
|
|
@@ -2404,7 +2435,12 @@ class Video extends Component {
|
|
|
2404
2435
|
this.setSharedScreenTimer(false)
|
|
2405
2436
|
if (code == 5007 || code == 5007 || code == 5009 || code == 5010 || code == 5011) {
|
|
2406
2437
|
this.saveVideoPoint('conFail', `RM投屏媒体链路断开, err_code=${code}`)
|
|
2407
|
-
playAudioTip();
|
|
2438
|
+
playAudioTip(code);
|
|
2439
|
+
}
|
|
2440
|
+
//5003:启动流失败(信令阶段)
|
|
2441
|
+
if (code == 5003) {
|
|
2442
|
+
this.saveVideoPoint('conFail', `RM投屏启动流失败, err_code=${code}`)
|
|
2443
|
+
playAudioTip(code);
|
|
2408
2444
|
}
|
|
2409
2445
|
if (code == 5012) {
|
|
2410
2446
|
this.saveLog('Manual cancel share'); // 点了取消,拒绝系统授权
|
|
@@ -2459,7 +2495,7 @@ class Video extends Component {
|
|
|
2459
2495
|
// sessionType: false,
|
|
2460
2496
|
// isJoinRoom: true
|
|
2461
2497
|
// })
|
|
2462
|
-
|
|
2498
|
+
this.roomCallBack(2, '加入失败','5-' + err_code)
|
|
2463
2499
|
this.state.channelId = '',
|
|
2464
2500
|
this.state.rtoken = '',
|
|
2465
2501
|
this.state.sessionId = '',
|
|
@@ -2679,7 +2715,11 @@ class Video extends Component {
|
|
|
2679
2715
|
console.log('Publishing media stream failed,', sid, err_code, err_msg)
|
|
2680
2716
|
if (sid == document.getElementById('publish_streamId1').name) {
|
|
2681
2717
|
this.state.sessionType = false
|
|
2682
|
-
this.
|
|
2718
|
+
this.setState({
|
|
2719
|
+
transcribeErrorCode: err_code,
|
|
2720
|
+
transcribeErrorModalVisible: true
|
|
2721
|
+
})
|
|
2722
|
+
this.roomCallBack(2, '发布失败', '4-' + err_code)
|
|
2683
2723
|
} else {
|
|
2684
2724
|
this.messageClick('投屏失败请重新投屏', 'error')
|
|
2685
2725
|
this.setSharedScreenState(false)
|
|
@@ -3233,6 +3273,7 @@ class Video extends Component {
|
|
|
3233
3273
|
this.businessRecordCallback('1', false, record_third_id)
|
|
3234
3274
|
this.saveLog('mrtc OnStartRemoteBusinessRecordFailed, code='+err_code + ',businessId=' + record_third_id)
|
|
3235
3275
|
}
|
|
3276
|
+
this.roomCallBack(2, '开始服务端录制失败', 'record-' + err_code)
|
|
3236
3277
|
};
|
|
3237
3278
|
// 结束服务端录制成功
|
|
3238
3279
|
this.test_controller.OnStopRemoteRecordSucc = (recordId, record_third_id) => {
|
|
@@ -4706,7 +4747,11 @@ class Video extends Component {
|
|
|
4706
4747
|
handleOkMediaErrorConfirm = () => {
|
|
4707
4748
|
// 刷新重试
|
|
4708
4749
|
clearTimeout(this.mediaErrorPlayTimer)
|
|
4709
|
-
|
|
4750
|
+
location.reload(false);
|
|
4751
|
+
// this.handleOkEnd()
|
|
4752
|
+
}
|
|
4753
|
+
handleOktranscribeErrorConfirm = () => {
|
|
4754
|
+
location.reload(false);
|
|
4710
4755
|
}
|
|
4711
4756
|
handleCancelMediaError = () => {
|
|
4712
4757
|
clearTimeout(this.mediaErrorPlayTimer)
|
|
@@ -7241,11 +7286,19 @@ class Video extends Component {
|
|
|
7241
7286
|
{/* 媒体流断开提示 */}
|
|
7242
7287
|
<Modal closable={false} centered={true} visible={this.state.mediaErrorModalVisible} maskClosable={false} footer={[
|
|
7243
7288
|
<div key='end'>
|
|
7244
|
-
<Button className="modelButtonCancel" onClick={this.handleCancelMediaError}>取消</Button>
|
|
7289
|
+
{/* <Button className="modelButtonCancel" onClick={this.handleCancelMediaError}>取消</Button> */}
|
|
7245
7290
|
<Button className="modelButtonOk" type="primary" danger onClick={this.handleOkMediaErrorConfirm}>确定</Button>
|
|
7246
7291
|
</div>
|
|
7247
7292
|
]}>
|
|
7248
|
-
<div className='endModal'
|
|
7293
|
+
<div className='endModal'>{this.state.mediaErrorModalMessage}</div>
|
|
7294
|
+
</Modal>
|
|
7295
|
+
{/* 30001(在信令链接失败回调中)/发布失败/音视频异常回调 相关事件印象双录失败提示 */}
|
|
7296
|
+
<Modal closable={false} centered={true} visible={this.state.transcribeErrorModalVisible} maskClosable={false} footer={[
|
|
7297
|
+
<div key='end'>
|
|
7298
|
+
<Button className="modelButtonOk" type="primary" danger onClick={this.handleOktranscribeErrorConfirm}>确定</Button>
|
|
7299
|
+
</div>
|
|
7300
|
+
]}>
|
|
7301
|
+
<div className='endModal'>{'系统异常请刷新('+ this.state.transcribeErrorCode + ')'}</div>
|
|
7249
7302
|
</Modal>
|
|
7250
7303
|
{/* 是否退出会议*/}
|
|
7251
7304
|
<Modal closable={false} centered={true} visible={this.state.isModalVisibleEnd} maskClosable={false} footer={[
|
|
@@ -7626,7 +7679,7 @@ class Video extends Component {
|
|
|
7626
7679
|
this.state.cameraList.map((item, index) => {
|
|
7627
7680
|
return <div key={index} className="envClass">
|
|
7628
7681
|
{/* <input type="radio" name="camere" value={item.actionid} style={{ float: 'left' }} checked={this.state.cameraValue == item.actionid} readOnly disabled /><i></i> */}
|
|
7629
|
-
{item.actionname}{this.state.cameraValue == item.actionid ?
|
|
7682
|
+
{item.actionname}{this.state.cameraValue == item.actionid ? <span class="currentDevice">(当前设备)</span> : ''}
|
|
7630
7683
|
</div>
|
|
7631
7684
|
})
|
|
7632
7685
|
}
|
|
@@ -7639,7 +7692,7 @@ class Video extends Component {
|
|
|
7639
7692
|
{
|
|
7640
7693
|
this.state.microphoneList.map((item, index) => {
|
|
7641
7694
|
return <div key={index} className="envClass">
|
|
7642
|
-
{item.actionname}{this.state.microphoneValue == item.actionid ?
|
|
7695
|
+
{item.actionname}{this.state.microphoneValue == item.actionid ? <span class="currentDevice">(当前设备)</span> : ''}
|
|
7643
7696
|
</div>
|
|
7644
7697
|
})
|
|
7645
7698
|
}
|
|
@@ -7651,7 +7704,7 @@ class Video extends Component {
|
|
|
7651
7704
|
{
|
|
7652
7705
|
this.state.speakerList.map((item, index) => {
|
|
7653
7706
|
return <div key={index} className="envClass">
|
|
7654
|
-
{item.actionname}{
|
|
7707
|
+
{item.actionname}{<span class="currentDevice">(当前设备)</span>}
|
|
7655
7708
|
</div>
|
|
7656
7709
|
})
|
|
7657
7710
|
}
|