react_hsbc_teller 1.3.8 → 1.3.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/pages/video/video.jsx +66 -16
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
|
})
|
|
@@ -263,7 +280,7 @@ class Video extends Component {
|
|
|
263
280
|
console.log('getBase64Image',result)
|
|
264
281
|
this.props.imgCallback({
|
|
265
282
|
type: result.data.type,
|
|
266
|
-
file: result.data.
|
|
283
|
+
file: result.data.base64Image}
|
|
267
284
|
)
|
|
268
285
|
} catch (err) {
|
|
269
286
|
console.error(err);
|
|
@@ -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,10 +4042,22 @@ 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
|
-
|
|
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
|
|
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
|
+
}
|
|
4022
4061
|
canvas.width = 1280;
|
|
4023
4062
|
canvas.height = 720;
|
|
4024
4063
|
cobj.fillStyle = 'rgb(255 255 255)'
|
|
@@ -4074,12 +4113,23 @@ class Video extends Component {
|
|
|
4074
4113
|
streamShare = ''
|
|
4075
4114
|
}
|
|
4076
4115
|
videoMedia.srcObject = stream;
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4116
|
+
if(os.isTablet){
|
|
4117
|
+
stream.getVideoTracks()[0].applyConstraints({
|
|
4118
|
+
// width: document.body.clientWidth,
|
|
4119
|
+
// height: document.body.clientHeight
|
|
4120
|
+
width: window.screen.width,
|
|
4121
|
+
height: window.screen.height
|
|
4122
|
+
})
|
|
4123
|
+
}
|
|
4124
|
+
if(os.isPc) {
|
|
4125
|
+
stream.getVideoTracks()[0].applyConstraints({
|
|
4126
|
+
width: document.body.clientWidth,
|
|
4127
|
+
height: document.body.clientHeight - 50
|
|
4128
|
+
// width: window.screen.width,
|
|
4129
|
+
// height: window.screen.height
|
|
4130
|
+
})
|
|
4131
|
+
}
|
|
4132
|
+
|
|
4083
4133
|
streamShare = stream
|
|
4084
4134
|
stream.getVideoTracks()[0].onended = async ()=>{
|
|
4085
4135
|
//单击停止共享按钮后,触发这个事件
|