react_hsbc_teller 1.9.19 → 1.9.20
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/demo/demo.js +15 -0
- package/packages/demo/pdf.js +15 -0
- package/packages/pages/video/video.jsx +49 -100
package/package.json
CHANGED
package/packages/demo/demo.js
CHANGED
|
@@ -21,6 +21,7 @@ roomId
|
|
|
21
21
|
// mtoken: '',
|
|
22
22
|
// imRoomId: '',
|
|
23
23
|
// sessionId: '',
|
|
24
|
+
pdfRendering: false,
|
|
24
25
|
isVideo: false,
|
|
25
26
|
tellerAccount: 'wmzTeller',
|
|
26
27
|
// callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
|
|
@@ -142,6 +143,17 @@ shareMaskClick=()=>{
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
}
|
|
146
|
+
pdfRenderingClick=()=>{
|
|
147
|
+
if(this.state.pdfRendering) {
|
|
148
|
+
this.setState({
|
|
149
|
+
pdfRendering: false
|
|
150
|
+
})
|
|
151
|
+
} else {
|
|
152
|
+
this.setState({
|
|
153
|
+
pdfRendering: true
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
}
|
|
145
157
|
createRoomCallback=(data)=>{
|
|
146
158
|
console.log('createRoomCallback', data)
|
|
147
159
|
this.setState({roomId: data.data.roomId});
|
|
@@ -195,6 +207,7 @@ userExit =(val)=>{
|
|
|
195
207
|
<div>
|
|
196
208
|
<HSBC
|
|
197
209
|
shareMask={this.state.shareMask}
|
|
210
|
+
pdfRendering={this.state.pdfRendering}
|
|
198
211
|
roomId={this.state.roomId}
|
|
199
212
|
mtoken={this.state.mtoken}
|
|
200
213
|
sessionId={this.state.sessionId}
|
|
@@ -219,6 +232,7 @@ userExit =(val)=>{
|
|
|
219
232
|
createRoomCallback={this.createRoomCallback}
|
|
220
233
|
joinRoomCallback={this.joinRoomCallback}
|
|
221
234
|
imgCallback={this.imgCallback}
|
|
235
|
+
sfpCallback={()=>{console.log('sfpCallback success')}}
|
|
222
236
|
userExit={this.userExit}
|
|
223
237
|
staffPermission={this.staffPermission}
|
|
224
238
|
>
|
|
@@ -226,6 +240,7 @@ userExit =(val)=>{
|
|
|
226
240
|
<Pdf></Pdf>
|
|
227
241
|
</HSBC>
|
|
228
242
|
<button onClick={this.shareMaskClick.bind(this)}>遮罩层</button>
|
|
243
|
+
<button onClick={this.pdfRenderingClick.bind(this)}>{this.state.pdfRendering?'继续':'暂停'}渲染</button>
|
|
229
244
|
</div>
|
|
230
245
|
:
|
|
231
246
|
<div>
|
package/packages/demo/pdf.js
CHANGED
|
@@ -2,6 +2,7 @@ import React, { Component } from "react";
|
|
|
2
2
|
|
|
3
3
|
class pdf extends Component {
|
|
4
4
|
state = {
|
|
5
|
+
testTime: '',
|
|
5
6
|
isVideo: false,
|
|
6
7
|
tellerAccount: '',
|
|
7
8
|
callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
|
|
@@ -11,6 +12,12 @@ class pdf extends Component {
|
|
|
11
12
|
baseURL:'https://counter-web.leimondata.cn:18082/api/leimon-counter-api',
|
|
12
13
|
resourcePath:'https://counter-web.leimondata.cn:7199',
|
|
13
14
|
}
|
|
15
|
+
componentDidMount () {
|
|
16
|
+
this.countTimer()
|
|
17
|
+
}
|
|
18
|
+
componentWillUnmount() {
|
|
19
|
+
clearInterval(this.state.timer)
|
|
20
|
+
}
|
|
14
21
|
startVideo = () => {
|
|
15
22
|
this.setState({
|
|
16
23
|
isVideo: true
|
|
@@ -53,6 +60,13 @@ handleResourcePath = (event) => {
|
|
|
53
60
|
resourcePath: event.target.value
|
|
54
61
|
})
|
|
55
62
|
}
|
|
63
|
+
countTimer = () => {
|
|
64
|
+
this.state.timer = setInterval(() => {
|
|
65
|
+
this.setState({
|
|
66
|
+
testTime: new Date().toString()
|
|
67
|
+
})
|
|
68
|
+
}, 1000);
|
|
69
|
+
}
|
|
56
70
|
|
|
57
71
|
render() {
|
|
58
72
|
console.log('22',this.props)
|
|
@@ -68,6 +82,7 @@ handleResourcePath = (event) => {
|
|
|
68
82
|
阿里资源服务地址:<input placeholder="请输入阿里资源服务地址" value={this.state.resourcePath} onChange={e => this.handleResourcePath(e)}></input>
|
|
69
83
|
|
|
70
84
|
<button className="button" onClick={this.startVideo.bind(this)}>开启视频</button>
|
|
85
|
+
<div>{this.state.testTime}</div>
|
|
71
86
|
</div>
|
|
72
87
|
}
|
|
73
88
|
</div>
|
|
@@ -287,6 +287,7 @@ class Video extends Component {
|
|
|
287
287
|
cardFailReason: '',
|
|
288
288
|
videoType: '',
|
|
289
289
|
certificateValidityType: true,
|
|
290
|
+
drawCanvasInterval: null,
|
|
290
291
|
};
|
|
291
292
|
// eslint-disable-next-line no-undef
|
|
292
293
|
test_controller = '';
|
|
@@ -294,7 +295,7 @@ class Video extends Component {
|
|
|
294
295
|
saveLog = (val) => {
|
|
295
296
|
axios({
|
|
296
297
|
method: 'get',
|
|
297
|
-
baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.
|
|
298
|
+
baseURL: this.props.logUrl + '&message=' + encodeURIComponent(val) + '&react_hsbc_teller=1.9.20&logTime=' + Date.now() + '&mtoken=' + encodeURIComponent(this.state.rtoken) + '&roomId=' + encodeURIComponent(this.state.channelId) + '&sessionId=' + encodeURIComponent(this.state.sessionId) + '&appointmentID=' + this.props.businessNumber,
|
|
298
299
|
|
|
299
300
|
}).then(res => {
|
|
300
301
|
|
|
@@ -1361,6 +1362,9 @@ class Video extends Component {
|
|
|
1361
1362
|
if (Mival.type == 1) {
|
|
1362
1363
|
this.switchExternal()
|
|
1363
1364
|
this.saveLog('whiteboard start, typeId=1218,')
|
|
1365
|
+
if (typeof this.props.sfpCallback === 'function'){
|
|
1366
|
+
this.props.sfpCallback()
|
|
1367
|
+
}
|
|
1364
1368
|
} else if (Mival.type == 2) {
|
|
1365
1369
|
if (streamShare) {
|
|
1366
1370
|
streamShare.getTracks().forEach(track => track.stop());
|
|
@@ -1427,47 +1431,6 @@ class Video extends Component {
|
|
|
1427
1431
|
this.tabTitlesClick('customerScreen', 'delect')
|
|
1428
1432
|
this.saveLog('app stop sharing screen, typeId=4001, ')
|
|
1429
1433
|
|
|
1430
|
-
} else if (Mival.typeId == 4004) {
|
|
1431
|
-
// 线下demo静音处理
|
|
1432
|
-
if (Mival.data.sessionId == this.state.sessionId && this.isFileSuccuse()) {
|
|
1433
|
-
if (!this.state.voiceStatue) {
|
|
1434
|
-
// 静音本地
|
|
1435
|
-
this.setState({
|
|
1436
|
-
voiceStatue: true,
|
|
1437
|
-
voiceImg: voiceImgCloe,
|
|
1438
|
-
voiceName: '解除静音'
|
|
1439
|
-
});
|
|
1440
|
-
let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
|
|
1441
|
-
this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
|
|
1442
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1443
|
-
customId: this.state.imRoomId,
|
|
1444
|
-
content: JSON.stringify({
|
|
1445
|
-
'typeId': 1013,
|
|
1446
|
-
'muteStatus': 1,
|
|
1447
|
-
'data': {
|
|
1448
|
-
'sessionId': this.state.sessionId,
|
|
1449
|
-
'userId': this.props.tellerAccount
|
|
1450
|
-
}
|
|
1451
|
-
})
|
|
1452
|
-
}, function (code, message, data) {
|
|
1453
|
-
// console.log(data)
|
|
1454
|
-
})
|
|
1455
|
-
}
|
|
1456
|
-
document.getElementById('audio1').muted = true
|
|
1457
|
-
console.log('音频流静音')
|
|
1458
|
-
console.log(document.getElementById('audio1').muted)
|
|
1459
|
-
setTimeout(() => {
|
|
1460
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1461
|
-
customId: this.state.imRoomId,
|
|
1462
|
-
content: JSON.stringify({
|
|
1463
|
-
'typeId': 1223,
|
|
1464
|
-
'state': 1, // app解除静音
|
|
1465
|
-
'sessionId': this.state.sessionId,
|
|
1466
|
-
'userId': Mival.data.userId //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
|
|
1467
|
-
})
|
|
1468
|
-
});
|
|
1469
|
-
}, 1000);
|
|
1470
|
-
}
|
|
1471
1434
|
} else if (Mival.typeId == 1401) {
|
|
1472
1435
|
// 用户修改名字
|
|
1473
1436
|
if (Mival.sessionId == this.state.sessionId) {
|
|
@@ -1787,48 +1750,6 @@ class Video extends Component {
|
|
|
1787
1750
|
this.customerFaceClick(this.state.customerList[this.state.customerSelect - 1])
|
|
1788
1751
|
}
|
|
1789
1752
|
}
|
|
1790
|
-
// 线下demo静音处理
|
|
1791
|
-
if (JSON.parse(msg).typeId == 4004 && this.state.sessionId == JSON.parse(msg).data.sessionId) {
|
|
1792
|
-
if (this.isFileSuccuse()) {
|
|
1793
|
-
if (!this.state.voiceStatue) {
|
|
1794
|
-
// 静音本地
|
|
1795
|
-
this.setState({
|
|
1796
|
-
voiceStatue: true,
|
|
1797
|
-
voiceImg: voiceImgCloe,
|
|
1798
|
-
voiceName: '解除静音'
|
|
1799
|
-
});
|
|
1800
|
-
let sid = document.getElementById('publish_video1').name || document.getElementById('publish_streamId1').name;
|
|
1801
|
-
this.test_controller.SetLocalAudioEnable(0, parseInt(sid, 10));
|
|
1802
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1803
|
-
customId: this.state.imRoomId,
|
|
1804
|
-
content: JSON.stringify({
|
|
1805
|
-
'typeId': 1013,
|
|
1806
|
-
'muteStatus': 1,
|
|
1807
|
-
'data': {
|
|
1808
|
-
'sessionId': this.state.sessionId,
|
|
1809
|
-
'userId': this.props.tellerAccount
|
|
1810
|
-
}
|
|
1811
|
-
})
|
|
1812
|
-
}, function (code, message, data) {
|
|
1813
|
-
// console.log(data)
|
|
1814
|
-
})
|
|
1815
|
-
}
|
|
1816
|
-
document.getElementById('audio1').muted = true
|
|
1817
|
-
console.log('音频流静音')
|
|
1818
|
-
console.log(document.getElementById('audio1').muted)
|
|
1819
|
-
setTimeout(() => {
|
|
1820
|
-
callNimIM('sendCustomCmdMsg', {
|
|
1821
|
-
customId: this.state.imRoomId,
|
|
1822
|
-
content: JSON.stringify({
|
|
1823
|
-
'typeId': 1223,
|
|
1824
|
-
'state': 1, // app解除静音
|
|
1825
|
-
'sessionId': this.state.sessionId,
|
|
1826
|
-
'userId': uid //this.seeList(this.state.roomCustomerList, 'feedId', document.getElementById('feedId1').innerText).uid
|
|
1827
|
-
})
|
|
1828
|
-
});
|
|
1829
|
-
}, 1000);
|
|
1830
|
-
}
|
|
1831
|
-
}
|
|
1832
1753
|
this.saveLog('mrtc OnReceiveTextMsg info:' + msg)
|
|
1833
1754
|
}
|
|
1834
1755
|
this.test_controller.StreamFilterHandler = async (publish_tag, stream, stream_type, publish_device, media_type) => {
|
|
@@ -2296,9 +2217,16 @@ class Video extends Component {
|
|
|
2296
2217
|
})
|
|
2297
2218
|
}
|
|
2298
2219
|
}
|
|
2299
|
-
if (!document.getElementById("video1").name) {
|
|
2300
|
-
|
|
2301
|
-
|
|
2220
|
+
// if (!document.getElementById("video1").name) {
|
|
2221
|
+
// this.state.isPIBIntranet[0].type = false
|
|
2222
|
+
// this.setState({
|
|
2223
|
+
// videoOneName: '',
|
|
2224
|
+
// voiceVideoOne: false,
|
|
2225
|
+
// noVideoOne: false
|
|
2226
|
+
// },()=>{
|
|
2227
|
+
// this.videoListClick()
|
|
2228
|
+
// })
|
|
2229
|
+
// }
|
|
2302
2230
|
this.state.analyserData.delete(sid)
|
|
2303
2231
|
if (this.state.isPictureInPicture) {
|
|
2304
2232
|
this.pictureInPicture('Refresh')
|
|
@@ -2822,6 +2750,7 @@ class Video extends Component {
|
|
|
2822
2750
|
disconnect();
|
|
2823
2751
|
}
|
|
2824
2752
|
message.destroy()
|
|
2753
|
+
clearInterval(this.state.drawCanvasInterval)
|
|
2825
2754
|
}
|
|
2826
2755
|
finishSession = () => {
|
|
2827
2756
|
// clearInterval(this.state.OnVolumeAnalyserMap.get(sid))
|
|
@@ -3012,7 +2941,7 @@ class Video extends Component {
|
|
|
3012
2941
|
}
|
|
3013
2942
|
}
|
|
3014
2943
|
componentWillMount() {
|
|
3015
|
-
console.log('hsbc_teller_sdk', '1.9.
|
|
2944
|
+
console.log('hsbc_teller_sdk', '1.9.20')
|
|
3016
2945
|
let arr = []
|
|
3017
2946
|
for(let i=1;i<=12;i++){
|
|
3018
2947
|
arr.push({
|
|
@@ -4209,6 +4138,21 @@ class Video extends Component {
|
|
|
4209
4138
|
})
|
|
4210
4139
|
}
|
|
4211
4140
|
}
|
|
4141
|
+
changePdfRendering = () => {
|
|
4142
|
+
if (this.props.pdfRendering) {
|
|
4143
|
+
// 暂停绘制
|
|
4144
|
+
clearInterval(this.state.drawCanvasInterval)
|
|
4145
|
+
} else {
|
|
4146
|
+
// 继续绘制
|
|
4147
|
+
if (!this.drawFunction) {
|
|
4148
|
+
console.log('未开始远程签署')
|
|
4149
|
+
return
|
|
4150
|
+
}
|
|
4151
|
+
clearInterval(this.state.drawCanvasInterval)
|
|
4152
|
+
this.state.drawCanvasInterval = setInterval(this.drawFunction, 1000 / 20);
|
|
4153
|
+
}
|
|
4154
|
+
|
|
4155
|
+
}
|
|
4212
4156
|
navigatorClick = () => {
|
|
4213
4157
|
const that = this
|
|
4214
4158
|
const publish_config = {};
|
|
@@ -4250,20 +4194,21 @@ class Video extends Component {
|
|
|
4250
4194
|
canvas.width = this.state.whiteboardWidth
|
|
4251
4195
|
}
|
|
4252
4196
|
console.log('addEventListener', !$this.paused, !$this.ended, x, y, width, height)
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
}
|
|
4197
|
+
|
|
4198
|
+
if (this.state.drawCanvasInterval) clearInterval(this.state.drawCanvasInterval)
|
|
4199
|
+
$this.drawFunction = () => {
|
|
4200
|
+
if (!$this.paused && !$this.ended) {
|
|
4201
|
+
// if(!that.state.tabTitles.find(el=>el.value == 'customerScreen')) {
|
|
4202
|
+
cobj.drawImage(videoMedia, x, y, width, height, 0, 0, 960, 540);
|
|
4203
|
+
// } else {
|
|
4204
|
+
// cobj.fillStyle = 'rgb(0 0 0)'
|
|
4205
|
+
// cobj.fillRect(0,0,960,540)
|
|
4206
|
+
// }
|
|
4207
|
+
}
|
|
4265
4208
|
}
|
|
4266
4209
|
|
|
4210
|
+
this.state.drawCanvasInterval = setInterval($this.drawFunction , 1000/ 20);
|
|
4211
|
+
|
|
4267
4212
|
if (document.getElementById('video20').name) {
|
|
4268
4213
|
// 代表已经有了进行切流
|
|
4269
4214
|
publish_config.publish_device = 5
|
|
@@ -4764,6 +4709,9 @@ class Video extends Component {
|
|
|
4764
4709
|
if (this.props.shareMask != prevProps.shareMask) {
|
|
4765
4710
|
this.sendNotification()
|
|
4766
4711
|
}
|
|
4712
|
+
if (this.props.pdfRendering != prevProps.pdfRendering) {
|
|
4713
|
+
this.changePdfRendering()
|
|
4714
|
+
}
|
|
4767
4715
|
}
|
|
4768
4716
|
onChangeOCRCustomer = (e) => {
|
|
4769
4717
|
console.log(e)
|
|
@@ -5721,6 +5669,7 @@ Video.defaultProps = {
|
|
|
5721
5669
|
customers: ['--'],
|
|
5722
5670
|
otherAttendees: undefined
|
|
5723
5671
|
},
|
|
5672
|
+
pdfRendering: false,
|
|
5724
5673
|
isTranscribing: false,
|
|
5725
5674
|
shareMask: false,
|
|
5726
5675
|
isOpenSound: false, // true开启进出音效 false不开启
|