react_hsbc_teller 1.1.1 → 1.1.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -4,17 +4,17 @@ import Pdf from './pdf.js'
4
4
 
5
5
  class Demo extends Component {
6
6
  state = {
7
- // imRoomId: "9K9ea1vOM@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
8
- // sessionId: "9K9ea1vOM",
9
- // mtoken: "d4e648858b03",
10
- // roomId: "645110140224386",
7
+ // mtoken: "182f46eea982",
8
+ // roomId: "646380817934933",
9
+ // imRoomId: "E9IYrsxUY@conference.openfire2.leimondata.cn",
10
+ // sessionId: "E9IYrsxUY",
11
11
  roomId: '',
12
12
  mtoken: '',
13
13
  imRoomId: '',
14
14
  sessionId: '',
15
15
  isVideo: false,
16
16
  tellerAccount: '00000000',
17
- callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
17
+ callbackUrl: 'http://182.92.184.31:8720/hsbc/callback',
18
18
  businessNumber: '',
19
19
  lang: 'zh',
20
20
  roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
@@ -36,9 +36,6 @@ export default class foot extends Component {
36
36
  customerFaceClick=(item)=>{
37
37
  this.props.customerFaceClick(item)
38
38
  }
39
- switchExternal=()=>{
40
- this.props.switchExternal()
41
- }
42
39
  facialHandleVisibleChange = visible => {
43
40
  console.log(visible)
44
41
  this.props.facialHandleVisibleChange(visible)
@@ -53,8 +50,11 @@ export default class foot extends Component {
53
50
  screenSwitching =()=>{
54
51
  this.props.screenSwitching()
55
52
  }
53
+ switchExternal=()=>{
54
+ this.props.switchExternal()
55
+ }
56
56
  render() {
57
- const {clickedOcr,clickedFacial,img,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
57
+ const {clickedOcr,clickedFacial,img,isWhiteboard,cameraImg,isTranscribing ,screenName,suspendName,customerList,menus,voiceName} = this.props
58
58
  const content = (
59
59
  <div>
60
60
  {customerList.map((item,index)=>{
@@ -69,6 +69,17 @@ export default class foot extends Component {
69
69
  );
70
70
  const defaultList = (
71
71
  <div className="total totalTwo">
72
+ {
73
+ isWhiteboard&&<div className='footHover' onClick={this.switchExternal.bind(this)}>
74
+ <div className="one">
75
+ <img className="imgClass" src={require("../../assets/img/Projection_screen.png").default} alt="" />
76
+ <div className="text">
77
+ 白板
78
+ </div>
79
+ </div>
80
+ </div>
81
+ }
82
+
72
83
  {
73
84
  menus.map((item,index)=>{
74
85
  return <div key={index}className='footHover'>
@@ -773,7 +773,7 @@ class Video extends Component {
773
773
  cobj.fill();
774
774
  cobj.stroke();
775
775
  cobj.beginPath();
776
- cobj.font = "28px serif";
776
+ cobj.font = "normal lighter 25px sans-serif";
777
777
  cobj.textAlign = 'left';
778
778
  cobj.lineWidth = 1;
779
779
  // 文字
@@ -1155,10 +1155,16 @@ class Video extends Component {
1155
1155
  } else if (Mival.type == 2) {
1156
1156
  this.tabTitlesClick('RMWhiteboard', 'delect')
1157
1157
  if (this.state.isSharedScreen) {
1158
- this.state.isWhiteboard = false
1158
+ this.setState({
1159
+ isWhiteboard: false
1160
+ })
1159
1161
  } else {
1160
- this.test_controller.UnPublish(document.getElementById('video20').name)
1161
- this.state.isWhiteboard = false
1162
+ if(document.getElementById('video20').name) {
1163
+ this.test_controller.UnPublish(document.getElementById('video20').name)
1164
+ }
1165
+ this.setState({
1166
+ isWhiteboard: false
1167
+ })
1162
1168
  }
1163
1169
  }
1164
1170
 
@@ -2833,19 +2839,19 @@ class Video extends Component {
2833
2839
  if (this.isFileSuccuse()) {
2834
2840
  const publish_config = {};
2835
2841
  if (this.state.isSharedScreen) {
2836
- if (this.state.isWhiteboard) {
2837
- publish_config.publish_device = 4
2838
- publish_config.media_type = 1
2839
- publish_config.sid = document.getElementById('video20').name
2840
- publish_config.part_of_screen_id = 'touBoxItem'
2841
- publish_config.video_profile_type = 5
2842
- this.test_controller.ChangeMediaStream(publish_config);
2843
- this.setState({
2844
- isPDF: true,
2845
- })
2846
- } else {
2842
+ // if (this.state.isWhiteboard) {
2843
+ // publish_config.publish_device = 4
2844
+ // publish_config.media_type = 1
2845
+ // publish_config.sid = document.getElementById('video20').name
2846
+ // publish_config.part_of_screen_id = 'touBoxItem'
2847
+ // publish_config.video_profile_type = 5
2848
+ // this.test_controller.ChangeMediaStream(publish_config);
2849
+ // this.setState({
2850
+ // isPDF: true,
2851
+ // })
2852
+ // } else {
2847
2853
  this.test_controller.UnPublish(document.getElementById('video20').name)
2848
- }
2854
+ // }
2849
2855
  this.state.isSharedScreen = false
2850
2856
  this.state.isScreenSwitching = false
2851
2857
  this.setState({
@@ -3266,21 +3272,108 @@ class Video extends Component {
3266
3272
  this.signCanvas.current.canvas.drawing.toDataURL('image/png').replace(/data.+?;base64,/, "")
3267
3273
  )
3268
3274
  }
3275
+ switchExternalAge = ()=>{
3276
+ const that = this
3277
+ if(this.state.isSharedScreen) {
3278
+ this.state.isSharedScreen = false
3279
+ this.setState({
3280
+
3281
+ screenName: '共享模式'
3282
+ });
3283
+ this.tabTitlesClick('RMScreen', 'delect')
3284
+ if (this.state.isPictureInPicture) {
3285
+ document.exitPictureInPicture()
3286
+ }
3287
+ }
3288
+
3289
+ const publish_config = {};
3290
+ const width = this.state.whiteboardWidth;
3291
+ const height = this.state.whiteboardHeight;
3292
+ const canvas = document.createElement('canvas');
3293
+ const videoMedia = document.getElementById('manedvideo');
3294
+ const cobj = canvas.getContext('2d'); // 获取绘图环境
3295
+ const w = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3296
+ const h = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3297
+ canvas.width = width;
3298
+ canvas.height = height;
3299
+ videoMedia.addEventListener('play', (event) =>{
3300
+ var $this = this; //cache
3301
+ console.log('333111',!$this.paused,!$this.ended)
3302
+ loop()
3303
+ function loop() {
3304
+ if (!$this.paused && !$this.ended) {
3305
+ cobj.drawImage(videoMedia, w, h, width, height, 0, 0,width, height,);
3306
+ setTimeout(loop, 1000 / 10); // drawing at 30fps
3307
+ }
3308
+ }
3309
+
3310
+ if (document.getElementById('video20').name) {
3311
+ // 代表已经有了进行切流
3312
+ publish_config.publish_device = 5
3313
+ publish_config.media_type = 1
3314
+ publish_config.degradationType=2
3315
+ publish_config.sid = document.getElementById('video20').name
3316
+ publish_config.stream = canvas.captureStream(10)
3317
+ publish_config.video_profile_type = 9
3318
+ this.test_controller.ChangeMediaStream(publish_config);
3319
+ } else {
3320
+
3321
+ publish_config.media_type = 1
3322
+ publish_config.publish_device = 5
3323
+ publish_config.need_volume_analyser = true
3324
+ publish_config.video_profile_type = 9
3325
+ publish_config.degradationType=2
3326
+ publish_config.stream = canvas.captureStream(10)
3327
+ publish_config.publish_video_id = 'video20'
3328
+ publish_config.publish_streamId_id = 'subscribe_streamId10'
3329
+ publish_config.publish_tag = 'projectionWhiteboard'
3330
+ this.test_controller.Publish(publish_config)
3331
+ }
3332
+ }, 0);
3333
+ navigator.mediaDevices.getDisplayMedia({
3334
+ video: true
3335
+ })
3336
+ .then((stream) => {
3337
+ videoMedia.srcObject = stream;
3338
+ stream.getVideoTracks()[0].onended = async ()=>{
3339
+ //单击停止共享按钮后,触发这个事件
3340
+ if(document.getElementById('video20').name && !this.state.isSharedScreen) {
3341
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3342
+ }
3343
+ }
3344
+ }, error => {
3345
+ console.log("Unable to acquire screen capture", error);
3346
+ });
3347
+ }
3269
3348
  switchExternal = () => {
3349
+ const that = this
3270
3350
  if (!this.state.isWhiteboard) {
3271
3351
  const publish_config = {};
3272
- this.state.isWhiteboard = true
3352
+ this.setState({
3353
+ isWhiteboard: true
3354
+ })
3273
3355
  this.tabTitlesClick({
3274
3356
  value: 'RMWhiteboard',
3275
3357
  name: 'RM白板'
3276
3358
  }, 'add')
3359
+ if(this.state.isSharedScreen) {
3360
+ this.state.isSharedScreen = false
3361
+ this.setState({
3362
+
3363
+ screenName: '共享模式'
3364
+ });
3365
+ this.tabTitlesClick('RMScreen', 'delect')
3366
+ if (this.state.isPictureInPicture) {
3367
+ document.exitPictureInPicture()
3368
+ }
3369
+ }
3277
3370
  const width = this.state.whiteboardWidth;
3278
3371
  const height = this.state.whiteboardHeight;
3279
3372
  const canvas = document.createElement('canvas');
3280
3373
  const videoMedia = document.getElementById('manedvideo');
3281
3374
  const cobj = canvas.getContext('2d'); // 获取绘图环境
3282
- const w = window.screen.width;
3283
- const h = window.screen.height;
3375
+ const w = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
3376
+ const h = document.getElementById("whiteboardDIV").getBoundingClientRect().top
3284
3377
  canvas.width = width;
3285
3378
  canvas.height = height;
3286
3379
  videoMedia.addEventListener('play', (event) =>{
@@ -3289,7 +3382,7 @@ class Video extends Component {
3289
3382
  loop()
3290
3383
  function loop() {
3291
3384
  if (!$this.paused && !$this.ended) {
3292
- cobj.drawImage(videoMedia, 0, 0, width, height, 0, 0,width, height,);
3385
+ cobj.drawImage(videoMedia, w, h, width, height, 0, 0,width, height,);
3293
3386
  setTimeout(loop, 1000 / 10); // drawing at 30fps
3294
3387
  }
3295
3388
  }
@@ -3298,16 +3391,18 @@ class Video extends Component {
3298
3391
  // 代表已经有了进行切流
3299
3392
  publish_config.publish_device = 5
3300
3393
  publish_config.media_type = 1
3394
+ publish_config.degradationType=2
3301
3395
  publish_config.sid = document.getElementById('video20').name
3302
3396
  publish_config.stream = canvas.captureStream(10)
3303
- publish_config.video_profile_type = 5
3397
+ publish_config.video_profile_type = 9
3304
3398
  this.test_controller.ChangeMediaStream(publish_config);
3305
3399
  } else {
3306
3400
 
3307
3401
  publish_config.media_type = 1
3308
3402
  publish_config.publish_device = 5
3309
3403
  publish_config.need_volume_analyser = true
3310
- publish_config.video_profile_type = 5
3404
+ publish_config.video_profile_type = 9
3405
+ publish_config.degradationType=2
3311
3406
  publish_config.stream = canvas.captureStream(10)
3312
3407
  publish_config.publish_video_id = 'video20'
3313
3408
  publish_config.publish_streamId_id = 'subscribe_streamId10'
@@ -3320,6 +3415,12 @@ class Video extends Component {
3320
3415
  })
3321
3416
  .then((stream) => {
3322
3417
  videoMedia.srcObject = stream;
3418
+ stream.getVideoTracks()[0].onended = async ()=>{
3419
+ //单击停止共享按钮后,触发这个事件
3420
+ if(document.getElementById('video20').name&&!this.state.isSharedScreen) {
3421
+ that.test_controller.UnPublish(document.getElementById('video20').name)
3422
+ }
3423
+ }
3323
3424
  }, error => {
3324
3425
  console.log("Unable to acquire screen capture", error);
3325
3426
  });
@@ -3975,6 +4076,7 @@ class Video extends Component {
3975
4076
  customerList={this.state.customerList}
3976
4077
  clickedOcr={this.state.clickedOcr}
3977
4078
  clickedFacial={this.state.clickedFacial}
4079
+ isWhiteboard={this.state.isWhiteboard}
3978
4080
  {...this.props}
3979
4081
  suspend={this.suspend}
3980
4082
  facialHandleVisibleChange={this.facialHandleVisibleChange}
@@ -3989,7 +4091,7 @@ class Video extends Component {
3989
4091
  invitationClick={this.invitationClick}
3990
4092
  customerFaceClick={this.customerFaceClick}
3991
4093
  ocrClick={this.ocrClick}
3992
- switchExternal={this.switchExternal}
4094
+ switchExternal={this.switchExternalAge}
3993
4095
  inspection={this.inspection}
3994
4096
  screenSwitching={this.screenSwitching}
3995
4097
  ></Foot>
@@ -4048,7 +4150,7 @@ class Video extends Component {
4048
4150
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;姓名:</span><span>{this.state.employeeName}</span>
4049
4151
  </div>
4050
4152
 
4051
- <div className='invitationDiv'>
4153
+ <div className='invitationDiv' style={{ height: '27px'}}>
4052
4154
  <span className="modalSpan">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
4053
4155
  <Button style={{ display: this.state.employeeName? '' : 'none'}} className="invitationButton" onClick={this.linkClick}> <img className='invitationImg' src={require("../../assets/img/link.png").default} alt="" />复制会议链接</Button>
4054
4156
  </div>
@@ -4095,7 +4197,9 @@ class Video extends Component {
4095
4197
  {
4096
4198
  this.state.speakerList.length > 0 &&
4097
4199
  <span>
4098
- <div>扬声器:</div>
4200
+ <div>扬声器:
4201
+ <span className='speakerTitle'>(请更改系统设置)</span>
4202
+ </div>
4099
4203
  {speaker}
4100
4204
  </span>
4101
4205
  }
@@ -144,7 +144,6 @@
144
144
  .invitationDiv{
145
145
  margin-left: 40px;
146
146
  margin-bottom: 15px;
147
- height: 27px;
148
147
  input::-webkit-inner-spin-button {
149
148
  -webkit-appearance: none;
150
149
  appearance: none;
@@ -478,4 +477,7 @@
478
477
  margin: 20px 40px;
479
478
  font-size: 14px;
480
479
  word-break: break-all;
480
+ }
481
+ .speakerTitle{
482
+ color: red;
481
483
  }