react_hsbc_teller 1.3.8 → 1.4.1
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/pages/video/video.jsx +67 -24
package/package.json
CHANGED
|
@@ -38,6 +38,23 @@ let streamShare
|
|
|
38
38
|
let muteJson = new Map()
|
|
39
39
|
let dateTime = 0
|
|
40
40
|
let messageValue = ''
|
|
41
|
+
var os = function() {
|
|
42
|
+
var ua = navigator.userAgent,
|
|
43
|
+
isWindowsPhone = /(?:Windows Phone)/.test(ua),
|
|
44
|
+
isSymbian = /(?:SymbianOS)/.test(ua) || isWindowsPhone,
|
|
45
|
+
isAndroid = /(?:Android)/.test(ua),
|
|
46
|
+
isFireFox = /(?:Firefox)/.test(ua),
|
|
47
|
+
isChrome = /(?:Chrome|CriOS)/.test(ua),
|
|
48
|
+
isTablet = /(?:iPad|PlayBook)/.test(ua) || (isAndroid && !/(?:Mobile)/.test(ua)) || (isFireFox && /(?:Tablet)/.test(ua)),
|
|
49
|
+
isPhone = /(?:iPhone)/.test(ua) && !isTablet,
|
|
50
|
+
isPc = !isPhone && !isAndroid && !isSymbian;
|
|
51
|
+
return {
|
|
52
|
+
isTablet: isTablet,
|
|
53
|
+
isPhone: isPhone,
|
|
54
|
+
isAndroid: isAndroid,
|
|
55
|
+
isPc: isPc
|
|
56
|
+
};
|
|
57
|
+
}();
|
|
41
58
|
message.config({
|
|
42
59
|
getContainer: ()=>document.getElementById('allHSBC')
|
|
43
60
|
})
|
|
@@ -262,8 +279,8 @@ class Video extends Component {
|
|
|
262
279
|
let result = await API.getBase64Image({ fileName: data});
|
|
263
280
|
console.log('getBase64Image',result)
|
|
264
281
|
this.props.imgCallback({
|
|
265
|
-
type: result.data.type,
|
|
266
|
-
file: result.data.
|
|
282
|
+
type: result.data.type + '',
|
|
283
|
+
file: result.data.base64Image}
|
|
267
284
|
)
|
|
268
285
|
} catch (err) {
|
|
269
286
|
console.error(err);
|
|
@@ -1437,7 +1454,7 @@ class Video extends Component {
|
|
|
1437
1454
|
// 一炒多的图片
|
|
1438
1455
|
if (Mival.sessionId == this.state.sessionId) {
|
|
1439
1456
|
this.props.imgCallback({
|
|
1440
|
-
type: Mival.data.type,
|
|
1457
|
+
type: Mival.data.type + '',
|
|
1441
1458
|
file: Mival.data.file}
|
|
1442
1459
|
) // 文字抄录和风险抄录,3--风险,,2--文字
|
|
1443
1460
|
}
|
|
@@ -2733,7 +2750,7 @@ class Video extends Component {
|
|
|
2733
2750
|
this.test_controller.OnStartRemoteRecordSucc = (record_id) => {
|
|
2734
2751
|
console.log('开始服务端录制成功', record_id);
|
|
2735
2752
|
this.state.recordId = record_id
|
|
2736
|
-
this.videoRecordCallback('1')
|
|
2753
|
+
this.videoRecordCallback('1',true)
|
|
2737
2754
|
};
|
|
2738
2755
|
// 开始服务端录制失败
|
|
2739
2756
|
this.test_controller.OnStartRemoteRecordFailed = (
|
|
@@ -2741,12 +2758,13 @@ class Video extends Component {
|
|
|
2741
2758
|
err_code,
|
|
2742
2759
|
err_msg
|
|
2743
2760
|
) => {
|
|
2761
|
+
this.videoRecordCallback('1',false)
|
|
2744
2762
|
console.log('开始服务端录制失败', record_id, err_code, err_msg)
|
|
2745
2763
|
};
|
|
2746
2764
|
// 结束服务端录制成功
|
|
2747
2765
|
this.test_controller.OnStopRemoteRecordSucc = (recordId) => {
|
|
2748
2766
|
console.log('结束服务端录制成功', recordId);
|
|
2749
|
-
this.videoRecordCallback('2')
|
|
2767
|
+
this.videoRecordCallback('2',true)
|
|
2750
2768
|
// this.endSessionValue()
|
|
2751
2769
|
// 获取服务端录制结果
|
|
2752
2770
|
};
|
|
@@ -2756,6 +2774,7 @@ class Video extends Component {
|
|
|
2756
2774
|
err_code,
|
|
2757
2775
|
err_msg
|
|
2758
2776
|
) => {
|
|
2777
|
+
this.videoRecordCallback('2',false)
|
|
2759
2778
|
console.log('结束服务端录制失败', recordId, err_code, err_msg)
|
|
2760
2779
|
};
|
|
2761
2780
|
// 开启浏览器录制成功
|
|
@@ -3069,12 +3088,13 @@ class Video extends Component {
|
|
|
3069
3088
|
|
|
3070
3089
|
};
|
|
3071
3090
|
}
|
|
3072
|
-
videoRecordCallback = async(type)=>{
|
|
3091
|
+
videoRecordCallback = async(type,status)=>{
|
|
3073
3092
|
try {
|
|
3074
3093
|
let result = await API.videoRecordCallback({
|
|
3075
3094
|
activityId: this.props.businessNumber,
|
|
3076
3095
|
sessionId: this.state.sessionId,
|
|
3077
|
-
type: type
|
|
3096
|
+
type: type,
|
|
3097
|
+
status: status
|
|
3078
3098
|
});
|
|
3079
3099
|
console.log(result);
|
|
3080
3100
|
} catch (err) {
|
|
@@ -4004,8 +4024,15 @@ class Video extends Component {
|
|
|
4004
4024
|
handleCancelSign=()=>{
|
|
4005
4025
|
this.signCanvas.current.clear()
|
|
4006
4026
|
}
|
|
4007
|
-
|
|
4027
|
+
|
|
4008
4028
|
navigatorClick=()=>{
|
|
4029
|
+
if(os.isAndroid || os.isPhone) {
|
|
4030
|
+
console.log("手机")
|
|
4031
|
+
} else if(os.isTablet) {
|
|
4032
|
+
console.log("平板")
|
|
4033
|
+
} else if(os.isPc) {
|
|
4034
|
+
console.log("电脑")
|
|
4035
|
+
}
|
|
4009
4036
|
const that = this
|
|
4010
4037
|
const publish_config = {};
|
|
4011
4038
|
const canvas = document.createElement('canvas');
|
|
@@ -4015,12 +4042,24 @@ class Video extends Component {
|
|
|
4015
4042
|
const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
|
|
4016
4043
|
const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
|
|
4017
4044
|
const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4045
|
+
let width = 0
|
|
4046
|
+
let height = 0
|
|
4047
|
+
let x = 0
|
|
4048
|
+
let y = 0
|
|
4049
|
+
// if(os.isTablet){
|
|
4050
|
+
width = (right - left)* window.screen.width / document.body.clientWidth
|
|
4051
|
+
height = ((bottom - top)* window.screen.width / document.body.clientWidth) - 50
|
|
4052
|
+
x = left * window.screen.width / document.body.clientWidth + 2
|
|
4053
|
+
y = top* window.screen.width / document.body.clientWidth
|
|
4054
|
+
// }
|
|
4055
|
+
// if(os.isPc) {
|
|
4056
|
+
// width = right - left
|
|
4057
|
+
// height = bottom - top
|
|
4058
|
+
// x = left
|
|
4059
|
+
// y = top
|
|
4060
|
+
// }
|
|
4061
|
+
canvas.width = 960;
|
|
4062
|
+
canvas.height = 540;
|
|
4024
4063
|
cobj.fillStyle = 'rgb(255 255 255)'
|
|
4025
4064
|
cobj.fillRect(0,0,1280,720)
|
|
4026
4065
|
// const height1 = document.getElementById("whiteboardDIV").getBoundingClientRect().height* window.screen.height / (document.body.clientHeight + 280)
|
|
@@ -4031,10 +4070,7 @@ class Video extends Component {
|
|
|
4031
4070
|
loop()
|
|
4032
4071
|
function loop() {
|
|
4033
4072
|
if (!$this.paused && !$this.ended) {
|
|
4034
|
-
|
|
4035
|
-
// console.log('addEventListener',x,y,width,height1,height)
|
|
4036
|
-
|
|
4037
|
-
cobj.drawImage(videoMedia, x, y, width, height, 0, 0,1280, 720);
|
|
4073
|
+
cobj.drawImage(videoMedia, x, y, width, height, 0, 0,960, 540);
|
|
4038
4074
|
setTimeout(loop, 1000 / 10); // drawing at 30fps
|
|
4039
4075
|
}
|
|
4040
4076
|
}
|
|
@@ -4074,12 +4110,19 @@ class Video extends Component {
|
|
|
4074
4110
|
streamShare = ''
|
|
4075
4111
|
}
|
|
4076
4112
|
videoMedia.srcObject = stream;
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
}
|
|
4113
|
+
// if(os.isTablet){
|
|
4114
|
+
stream.getVideoTracks()[0].applyConstraints({
|
|
4115
|
+
width: window.screen.width,
|
|
4116
|
+
height: window.screen.height
|
|
4117
|
+
})
|
|
4118
|
+
// }
|
|
4119
|
+
// if(os.isPc) {
|
|
4120
|
+
// stream.getVideoTracks()[0].applyConstraints({
|
|
4121
|
+
// width: document.body.clientWidth,
|
|
4122
|
+
// height: document.body.clientHeight - 50
|
|
4123
|
+
// })
|
|
4124
|
+
// }
|
|
4125
|
+
|
|
4083
4126
|
streamShare = stream
|
|
4084
4127
|
stream.getVideoTracks()[0].onended = async ()=>{
|
|
4085
4128
|
//单击停止共享按钮后,触发这个事件
|