react_hsbc_teller 0.3.5 → 0.3.6
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
|
|
@@ -158,7 +158,7 @@ class Video extends Component {
|
|
|
158
158
|
config_param.auto_publish_subscribe = 3;
|
|
159
159
|
config_param.media_type = 1;
|
|
160
160
|
config_param.publish_device = 1;
|
|
161
|
-
config_param.video_profile_type = '
|
|
161
|
+
config_param.video_profile_type = '3';
|
|
162
162
|
config_param.need_volume_analyser = true;
|
|
163
163
|
// config_param.audioSource = that.microphone[0].actionid
|
|
164
164
|
// config_param.videoSource = that.checkOne[0]
|
|
@@ -428,7 +428,7 @@ class Video extends Component {
|
|
|
428
428
|
this.setState({ isBigVideo: 'video1' })
|
|
429
429
|
}
|
|
430
430
|
} else if (val == 'isLangPublishVideo1') {
|
|
431
|
-
if (document.getElementById('publish_video1').name) {
|
|
431
|
+
if (document.getElementById('publish_video1').name && this.state.isCustomer) {
|
|
432
432
|
this.setState({ isBigVideo: 'publish_video1' })
|
|
433
433
|
}
|
|
434
434
|
} else if (val == 'isLangVideo2') {
|
|
@@ -782,6 +782,7 @@ class Video extends Component {
|
|
|
782
782
|
// 推送“新加⼊房间者”给与会者
|
|
783
783
|
this.test_controller.OnNewJoinerIn = (participant) => {
|
|
784
784
|
console.log('新加⼊房间者', participant);
|
|
785
|
+
this.test_controller.ChangeStreamSize(document.getElementById('publish_video1').name, 5)
|
|
785
786
|
this.setState(
|
|
786
787
|
{
|
|
787
788
|
isCustomer: true
|
|
@@ -1059,50 +1060,103 @@ class Video extends Component {
|
|
|
1059
1060
|
return;
|
|
1060
1061
|
}
|
|
1061
1062
|
let canvas = document.getElementById(volumeView);
|
|
1063
|
+
canvas.width = this.props.microphoneSize
|
|
1064
|
+
canvas.height = this.props.microphoneSize
|
|
1062
1065
|
let ctx = canvas.getContext("2d");
|
|
1063
1066
|
|
|
1064
1067
|
let outcanvas = document.createElement("canvas");
|
|
1065
1068
|
outcanvas.width = canvas.width;
|
|
1066
1069
|
outcanvas.height = canvas.height;
|
|
1067
|
-
ctx.strokeStyle =
|
|
1070
|
+
ctx.strokeStyle = "#db0011";
|
|
1068
1071
|
ctx.lineWidth = 2;
|
|
1069
1072
|
ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
|
|
1073
|
+
// ctx.fillStyle ='rgba(0, 0, 0, 0.2)';
|
|
1074
|
+
// ctx.fillRect(0, 0, canvas.width, canvas.height, )
|
|
1070
1075
|
let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
1071
1076
|
analyser.getByteFrequencyData(dataArray);
|
|
1072
1077
|
let step = Math.round(dataArray.length / 60); //采样步长
|
|
1078
|
+
var img = document.getElementById("icon_huatong");
|
|
1079
|
+
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
|
|
1080
|
+
// 以画布左上角为坐标原点
|
|
1081
|
+
let drawArea = {
|
|
1082
|
+
x1: 28/50*canvas.width, // 波动范围右下角的点坐标
|
|
1083
|
+
y1: 25/50*canvas.height,
|
|
1084
|
+
x2: 22/50*canvas.width, // 波动范围左上角的点坐标
|
|
1085
|
+
y2: 10/50*canvas.height,
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1073
1088
|
for (var i = 0; i < 40; i++) {
|
|
1074
1089
|
let energy = (dataArray[step * i] / 256.0) * 80;
|
|
1075
|
-
for (var j = 0; j < energy; j++) {
|
|
1076
|
-
ctx.beginPath();
|
|
1077
|
-
ctx.moveTo(20 * i + 2, 200 + 4 * j);
|
|
1078
|
-
ctx.lineTo(20 * (i + 1) - 2, 200 + 4 * j);
|
|
1079
|
-
ctx.stroke();
|
|
1080
|
-
ctx.beginPath();
|
|
1081
|
-
ctx.moveTo(20 * i + 2, 200 - 4 * j);
|
|
1082
|
-
ctx.lineTo(20 * (i + 1) - 2, 200 - 4 * j);
|
|
1083
|
-
ctx.stroke();
|
|
1084
|
-
}
|
|
1085
1090
|
ctx.beginPath();
|
|
1086
|
-
ctx.
|
|
1087
|
-
|
|
1088
|
-
|
|
1091
|
+
ctx.fillStyle = this.props.voiceColor;
|
|
1092
|
+
const { x1,y1,x2,y2} = drawArea
|
|
1093
|
+
let width = x1-x2;
|
|
1094
|
+
let height = (energy>20?(energy-20):0) * (y1 - y2 ) / 70
|
|
1095
|
+
let startX = x2 // 绘制起始点x
|
|
1096
|
+
let startY = y1 - height // 绘制起始点y
|
|
1097
|
+
ctx.fillRect(startX, startY, width, height )
|
|
1089
1098
|
}
|
|
1090
1099
|
|
|
1091
1100
|
//制造半透明投影
|
|
1092
1101
|
function draw() {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
+
ctx.drawImage(outcanvas, 0, 0);
|
|
1103
|
+
ctx.save();
|
|
1104
|
+
ctx.translate(canvas.width / 2, canvas.height / 2);
|
|
1105
|
+
ctx.rotate(Math.PI);
|
|
1106
|
+
ctx.scale(-1, 1);
|
|
1107
|
+
ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
|
|
1108
|
+
ctx.restore();
|
|
1109
|
+
ctx.fillStyle = 'rgba(192,192,192, .0)';
|
|
1110
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
1102
1111
|
}
|
|
1103
1112
|
|
|
1104
1113
|
draw();
|
|
1105
1114
|
requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
|
|
1115
|
+
// let canvas = document.getElementById(volumeView);
|
|
1116
|
+
// let ctx = canvas.getContext("2d");
|
|
1117
|
+
|
|
1118
|
+
// let outcanvas = document.createElement("canvas");
|
|
1119
|
+
// outcanvas.width = canvas.width;
|
|
1120
|
+
// outcanvas.height = canvas.height;
|
|
1121
|
+
// ctx.strokeStyle = this.props.voiceColor;
|
|
1122
|
+
// ctx.lineWidth = 2;
|
|
1123
|
+
// ctx.clearRect(0, 0, canvas.width, canvas.height); //清理画布
|
|
1124
|
+
// let dataArray = new Uint8Array(analyser.frequencyBinCount);
|
|
1125
|
+
// analyser.getByteFrequencyData(dataArray);
|
|
1126
|
+
// let step = Math.round(dataArray.length / 60); //采样步长
|
|
1127
|
+
// for (var i = 0; i < 40; i++) {
|
|
1128
|
+
// let energy = (dataArray[step * i] / 256.0) * 50;
|
|
1129
|
+
// for (var j = 0; j < energy; j++) {
|
|
1130
|
+
// ctx.beginPath();
|
|
1131
|
+
// ctx.moveTo(20 * i + 2, 200 + 4 * j);
|
|
1132
|
+
// ctx.lineTo(20 * (i + 1) - 2, 200 + 4 * j);
|
|
1133
|
+
// ctx.stroke();
|
|
1134
|
+
// ctx.beginPath();
|
|
1135
|
+
// ctx.moveTo(20 * i + 2, 200 - 4 * j);
|
|
1136
|
+
// ctx.lineTo(20 * (i + 1) - 2, 200 - 4 * j);
|
|
1137
|
+
// ctx.stroke();
|
|
1138
|
+
// }
|
|
1139
|
+
// ctx.beginPath();
|
|
1140
|
+
// ctx.moveTo(20 * i + 2, 200);
|
|
1141
|
+
// ctx.lineTo(20 * (i + 1) - 2, 200);
|
|
1142
|
+
// ctx.stroke();
|
|
1143
|
+
// }
|
|
1144
|
+
|
|
1145
|
+
// //制造半透明投影
|
|
1146
|
+
// function draw() {
|
|
1147
|
+
// ctx.drawImage(outcanvas, 0, 0);
|
|
1148
|
+
// ctx.save();
|
|
1149
|
+
// ctx.translate(canvas.width / 4, canvas.height / 2);
|
|
1150
|
+
// ctx.rotate(Math.PI);
|
|
1151
|
+
// ctx.scale(-1, 1);
|
|
1152
|
+
// ctx.drawImage(outcanvas, -canvas.width / 2, -canvas.height / 2);
|
|
1153
|
+
// ctx.restore();
|
|
1154
|
+
// ctx.fillStyle = 'rgba(192,192,192, .0)';
|
|
1155
|
+
// ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
1156
|
+
// }
|
|
1157
|
+
|
|
1158
|
+
// draw();
|
|
1159
|
+
// requestAnimationFrame(this.test_controller.OnVolumeAnalyser.bind(this, sid, analyser));
|
|
1106
1160
|
}
|
|
1107
1161
|
|
|
1108
1162
|
}
|
|
@@ -1784,7 +1838,7 @@ class Video extends Component {
|
|
|
1784
1838
|
/>
|
|
1785
1839
|
<audio id="audio1" autoPlay />
|
|
1786
1840
|
<label style={{ display: 'none' }} id="feedId1" type="text" />
|
|
1787
|
-
<div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor }} className='customerTitle'>客户</div>
|
|
1841
|
+
<div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily }} className='customerTitle'>客户</div>
|
|
1788
1842
|
<canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClassOne" id="subscribe_volumeView1" width="40" height="70"></canvas>
|
|
1789
1843
|
</div>
|
|
1790
1844
|
</div>
|
|
@@ -1824,7 +1878,7 @@ class Video extends Component {
|
|
|
1824
1878
|
/>
|
|
1825
1879
|
<audio id="audio1" autoPlay />
|
|
1826
1880
|
<label style={{ display: 'none' }} id="publish_streamId1" type="text" />
|
|
1827
|
-
<div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor}} className='tellerTitle'>坐席</div>
|
|
1881
|
+
<div style={{ display: (this.state.isCustomer) ? '' : 'none', background: this.props.titleBackground,color: this.props.titleColor,'font-size': this.props.fontSize + 'px','font-family' : this.props.fontFamily}} className='tellerTitle'>坐席</div>
|
|
1828
1882
|
<canvas style={{ display: (this.state.isCustomer) ? '' : 'none', }} className="canvasClass" id="publish_volumeView" width="40" height="70"></canvas>
|
|
1829
1883
|
</div>
|
|
1830
1884
|
|
|
@@ -1897,7 +1951,7 @@ class Video extends Component {
|
|
|
1897
1951
|
|
|
1898
1952
|
</div>
|
|
1899
1953
|
</div>
|
|
1900
|
-
|
|
1954
|
+
<img id="icon_huatong" style={{display:'none'}} src={require("../../assets/img/icon_huatong.png").default}></img>
|
|
1901
1955
|
</div>
|
|
1902
1956
|
<Foot
|
|
1903
1957
|
img={this.state.voiceImg}
|
|
@@ -1988,8 +2042,11 @@ Video.defaultProps = {
|
|
|
1988
2042
|
roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
|
|
1989
2043
|
resourcePath: 'https://counter-web.leimondata.cn:7199',
|
|
1990
2044
|
prohibitPrompt: '当前无客户',
|
|
1991
|
-
voiceColor: '#
|
|
2045
|
+
voiceColor: '#0AE544',
|
|
1992
2046
|
titleBackground: 'rgba(219, 0, 17, 0.1)',
|
|
1993
|
-
titleColor: '#DB0011'
|
|
2047
|
+
titleColor: '#DB0011',
|
|
2048
|
+
microphoneSize: '50',
|
|
2049
|
+
fontSize: '14',
|
|
2050
|
+
fontFamily: 'auto'
|
|
1994
2051
|
}
|
|
1995
2052
|
export default Video
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
z-index: 2000;
|
|
53
53
|
}
|
|
54
54
|
.videoFit{
|
|
55
|
-
object-fit:
|
|
55
|
+
object-fit: contain !important;
|
|
56
56
|
}
|
|
57
57
|
.itemPublic {
|
|
58
58
|
grid-column-start: 1;
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
// background: #fff;
|
|
151
151
|
.button{
|
|
152
152
|
display: inline-flex;
|
|
153
|
-
width: 100%;
|
|
153
|
+
// width: 100%;
|
|
154
154
|
position: absolute;
|
|
155
155
|
z-index: 1;
|
|
156
156
|
top: 0;
|
|
@@ -191,7 +191,7 @@ border-radius: 0px 0px 2px 2px;
|
|
|
191
191
|
// background: rgba(219, 0, 17, 0.1);
|
|
192
192
|
border-radius: 4px 0px 2px 0px;
|
|
193
193
|
// color: #DB0011;
|
|
194
|
-
font-size: 14px;
|
|
194
|
+
// font-size: 14px;
|
|
195
195
|
}
|
|
196
196
|
.tellerTitle{
|
|
197
197
|
position: absolute;
|