react_hsbc_teller 1.6.1 → 1.6.2
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/package.json
CHANGED
|
Binary file
|
|
@@ -50,8 +50,11 @@ export default class foot extends Component {
|
|
|
50
50
|
switchExternal=()=>{
|
|
51
51
|
this.props.switchExternal()
|
|
52
52
|
}
|
|
53
|
+
beautyClick=()=>{
|
|
54
|
+
this.props.beautyClick()
|
|
55
|
+
}
|
|
53
56
|
render() {
|
|
54
|
-
const {clickedOcr,clickedFacial,img,isWhiteboard,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
|
|
57
|
+
const {clickedOcr,clickedFacial,img,isWhiteboard,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName,beautyName} = this.props
|
|
55
58
|
const content = (
|
|
56
59
|
<div>
|
|
57
60
|
{customerList.map((item,index)=>{
|
|
@@ -149,6 +152,14 @@ export default class foot extends Component {
|
|
|
149
152
|
|
|
150
153
|
})
|
|
151
154
|
}
|
|
155
|
+
{
|
|
156
|
+
<div className="one" onClick={this.beautyClick.bind(this)}>
|
|
157
|
+
<img className="imgClass" src={require("../../assets/img/meiyan.png").default} alt="" />
|
|
158
|
+
<div className="text">
|
|
159
|
+
{beautyName}
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
}
|
|
152
163
|
</div>
|
|
153
164
|
);
|
|
154
165
|
return (
|
|
@@ -39,7 +39,29 @@ let streamShare
|
|
|
39
39
|
let muteJson = new Map()
|
|
40
40
|
let dateTime = 0
|
|
41
41
|
let messageValue = ''
|
|
42
|
+
let beautyNum = 0 // 0-关闭 1--弱 2--中 5---高
|
|
42
43
|
let rateList = []
|
|
44
|
+
let beautyDiv = {};
|
|
45
|
+
function clearStreamRemain() {
|
|
46
|
+
if (!(beautyDiv.beauty_canvas == null || beautyDiv.beauty_canvas == undefined)) {
|
|
47
|
+
beautyDiv.beauty_canvas = null;
|
|
48
|
+
}
|
|
49
|
+
if (!(beautyDiv.beauty_player == null || beautyDiv.beauty_player == undefined)) {
|
|
50
|
+
beautyDiv.beauty_player.destroy();
|
|
51
|
+
beautyDiv.beauty_player = null;
|
|
52
|
+
}
|
|
53
|
+
if (!(beautyDiv.beauty_div == null || beautyDiv.beauty_div == undefined)) {
|
|
54
|
+
document.body.removeChild(beautyDiv.beauty_div);
|
|
55
|
+
beautyDiv.beauty_div = null;
|
|
56
|
+
}
|
|
57
|
+
beautyDiv = {};
|
|
58
|
+
};
|
|
59
|
+
function startBeauty(stream) {
|
|
60
|
+
let newStream = stream;
|
|
61
|
+
beautyDiv = meetingBeautifyStream(newStream, beautyNum);
|
|
62
|
+
newStream = beautyDiv.stream;
|
|
63
|
+
return newStream
|
|
64
|
+
}
|
|
43
65
|
message.config({
|
|
44
66
|
getContainer: ()=>document.getElementById('allHSBC')
|
|
45
67
|
})
|
|
@@ -50,6 +72,7 @@ class Video extends Component {
|
|
|
50
72
|
}
|
|
51
73
|
cancel = axios.CancelToken.source()
|
|
52
74
|
state = {
|
|
75
|
+
beautyName: '开启美颜',
|
|
53
76
|
signNoClick: false,
|
|
54
77
|
listVideoPicture: [],
|
|
55
78
|
isScreenSwitching: false,
|
|
@@ -1984,6 +2007,45 @@ class Video extends Component {
|
|
|
1984
2007
|
this.test_controller.OnSendTextMsgFailed =(msgId, code, msg)=>{
|
|
1985
2008
|
console.log('发送失败',msgId,code, msg)
|
|
1986
2009
|
}
|
|
2010
|
+
this.test_controller.StreamFilterHandler = async function (publish_tag, stream, stream_type, publish_device, media_type) {
|
|
2011
|
+
console.log(`stream processed by client, publish_device=${publish_device}, media_type=${media_type}, publish_tag=${publish_tag},stream_type=${stream_type}`);
|
|
2012
|
+
if (stream_type == "subscribe") {
|
|
2013
|
+
return stream
|
|
2014
|
+
}
|
|
2015
|
+
if (media_type == 2 || media_type == 4) {
|
|
2016
|
+
return stream
|
|
2017
|
+
}
|
|
2018
|
+
// if (publish_device != 1) {
|
|
2019
|
+
// return stream
|
|
2020
|
+
// }
|
|
2021
|
+
if(publish_tag == 'tag1') {
|
|
2022
|
+
let newStream = stream;
|
|
2023
|
+
let beauty_strength = beautyNum;
|
|
2024
|
+
if (beauty_strength != 0 && stream.getVideoTracks()[0]) {
|
|
2025
|
+
newStream = new MediaStream([startBeauty(stream).getVideoTracks()[0]]);
|
|
2026
|
+
// 清理原始流
|
|
2027
|
+
newStream.oninactive = function () {
|
|
2028
|
+
clearOriginStream(stream);
|
|
2029
|
+
};
|
|
2030
|
+
newStream.getVideoTracks()[0].onended = function () {
|
|
2031
|
+
clearOriginStream(stream);
|
|
2032
|
+
};
|
|
2033
|
+
function clearOriginStream(stream) {
|
|
2034
|
+
stream.getTracks().forEach((track) => {
|
|
2035
|
+
track.stop();
|
|
2036
|
+
});
|
|
2037
|
+
stream = null;
|
|
2038
|
+
}
|
|
2039
|
+
};
|
|
2040
|
+
if (stream.getAudioTracks()[0] && newStream.addTrack) {
|
|
2041
|
+
newStream.addTrack(stream.getAudioTracks()[0])
|
|
2042
|
+
}
|
|
2043
|
+
return newStream
|
|
2044
|
+
} else {
|
|
2045
|
+
return stream
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
}
|
|
1987
2049
|
// 发布媒体流成功
|
|
1988
2050
|
this.test_controller.OnPublishSucc = (sid) => {
|
|
1989
2051
|
console.log('发布媒体流成功', sid)
|
|
@@ -2628,6 +2690,9 @@ class Video extends Component {
|
|
|
2628
2690
|
// }
|
|
2629
2691
|
|
|
2630
2692
|
}
|
|
2693
|
+
if(sid == document.getElementById('publish_video1').name || !document.getElementById('publish_video1').name) {
|
|
2694
|
+
clearStreamRemain()
|
|
2695
|
+
}
|
|
2631
2696
|
};
|
|
2632
2697
|
// 取消订阅媒体流成功
|
|
2633
2698
|
this.test_controller.OnUnSubscribeSucc = (sid) => {
|
|
@@ -3220,6 +3285,8 @@ userType:'1'
|
|
|
3220
3285
|
this.finishSessionClick()
|
|
3221
3286
|
}
|
|
3222
3287
|
if (this.test_controller&&this.state.sessionType) {
|
|
3288
|
+
clearStreamRemain()
|
|
3289
|
+
beautyNum = 0
|
|
3223
3290
|
this.test_controller.LeaveRoom()
|
|
3224
3291
|
this.test_controller.Disconnect()
|
|
3225
3292
|
}
|
|
@@ -4332,6 +4399,21 @@ userType:'1'
|
|
|
4332
4399
|
microphoneValue: event.target.value
|
|
4333
4400
|
})
|
|
4334
4401
|
}
|
|
4402
|
+
beautyClick = () =>{
|
|
4403
|
+
const publish_config = {}
|
|
4404
|
+
publish_config.sid = document.getElementById('publish_video1').name
|
|
4405
|
+
publish_config.media_type = 1
|
|
4406
|
+
publish_config.publish_device = 1
|
|
4407
|
+
publish_config.videoSource = this.state.cameraValue
|
|
4408
|
+
publish_config.audioSource = this.state.microphoneValue
|
|
4409
|
+
publish_config.video_profile_type=100
|
|
4410
|
+
publish_config.video_profile_diy={width:640, height:360, frameRate:15, bitrate:400}
|
|
4411
|
+
this.test_controller.ChangeMediaStream(publish_config)
|
|
4412
|
+
beautyNum = beautyNum == 0 ? 2 : 0
|
|
4413
|
+
this.setState({
|
|
4414
|
+
beautyName: beautyNum == 0 ? '开启美颜' : '关闭美颜'
|
|
4415
|
+
})
|
|
4416
|
+
}
|
|
4335
4417
|
componentDidMount() {
|
|
4336
4418
|
var box=document.getElementById("whiteboardDIV");
|
|
4337
4419
|
if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
|
|
@@ -5085,6 +5167,7 @@ userType:'1'
|
|
|
5085
5167
|
</div>
|
|
5086
5168
|
</div>
|
|
5087
5169
|
<Foot
|
|
5170
|
+
beautyName={this.state.beautyName}
|
|
5088
5171
|
voiceName={this.state.voiceName}
|
|
5089
5172
|
img={this.state.voiceImg}
|
|
5090
5173
|
screenName={this.state.screenName}
|
|
@@ -5110,6 +5193,7 @@ userType:'1'
|
|
|
5110
5193
|
ocrClick={this.ocrClick}
|
|
5111
5194
|
switchExternal={this.switchExternal}
|
|
5112
5195
|
inspection={this.inspection}
|
|
5196
|
+
beautyClick={this.beautyClick}
|
|
5113
5197
|
></Foot>
|
|
5114
5198
|
<Modal cancelText="取消" okText="确定" visible={this.state.isModalVisible} onOk={this.handleOk}
|
|
5115
5199
|
onCancel={this.handleCancel}>
|
|
@@ -5266,7 +5350,7 @@ sessionId: "",
|
|
|
5266
5350
|
meetingInfo: {
|
|
5267
5351
|
title: '--',
|
|
5268
5352
|
host: '--',
|
|
5269
|
-
customers: ['--'
|
|
5353
|
+
customers: ['--'],
|
|
5270
5354
|
otherAttendees: undefined
|
|
5271
5355
|
},
|
|
5272
5356
|
isTranscribing: false,
|