react_hsbc_teller 1.0.8 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react_hsbc_teller",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -35,6 +35,7 @@ width: 100%;
35
35
  padding-bottom: 10px;
36
36
  text-align: center;
37
37
  max-width: 110px;
38
+ min-width: 80px;
38
39
  height: 11px;
39
40
  font-size: 14px;
40
41
  font-family: PingFangSC-Regular, PingFang SC;
@@ -2017,7 +2017,6 @@ class Video extends Component {
2017
2017
  'tellerId': this.props.tellerAccount
2018
2018
  })
2019
2019
  })
2020
- this.state.sessionType = false
2021
2020
  this.state.isSharedScreen = false
2022
2021
  this.setState({
2023
2022
 
@@ -3255,26 +3254,75 @@ class Video extends Component {
3255
3254
  value: 'RMWhiteboard',
3256
3255
  name: 'RM白板'
3257
3256
  }, 'add')
3258
- if (document.getElementById('video20').name) {
3259
- // 代表已经有了进行切流
3260
- publish_config.publish_device = 4
3261
- publish_config.media_type = 1
3262
- publish_config.sid = document.getElementById('video20').name
3263
- publish_config.part_of_screen_id = 'touBoxItem'
3264
- publish_config.video_profile_type = 5
3265
- this.test_controller.ChangeMediaStream(publish_config);
3266
- } else {
3267
-
3268
- publish_config.media_type = 1
3269
- publish_config.publish_device = 4
3270
- publish_config.need_volume_analyser = true
3271
- publish_config.video_profile_type = 5
3272
- publish_config.part_of_screen_id = 'touBoxItem';
3273
- publish_config.publish_video_id = 'video20'
3274
- publish_config.publish_streamId_id = 'subscribe_streamId10'
3275
- publish_config.publish_tag = 'projectionWhiteboard'
3276
- this.test_controller.Publish(publish_config)
3277
- }
3257
+ const width = this.state.whiteboardWidth;
3258
+ const height = this.state.whiteboardHeight;
3259
+ const canvas = document.createElement('canvas');
3260
+ const videoMedia = document.getElementById('manedvideo');
3261
+ const cobj = canvas.getContext('2d'); // 获取绘图环境
3262
+ const w = window.screen.width;
3263
+ const h = window.screen.height;
3264
+ canvas.width = width;
3265
+ canvas.height = height;
3266
+ videoMedia.addEventListener('play', (event) =>{
3267
+ var $this = this; //cache
3268
+ console.log('333111',!$this.paused,!$this.ended)
3269
+ loop()
3270
+ function loop() {
3271
+ if (!$this.paused && !$this.ended) {
3272
+ cobj.drawImage(videoMedia, 0, 0, width, height, 0, 0,width, height,);
3273
+ setTimeout(loop, 1000 / 10); // drawing at 30fps
3274
+ }
3275
+ }
3276
+
3277
+ if (document.getElementById('video20').name) {
3278
+ // 代表已经有了进行切流
3279
+ publish_config.publish_device = 5
3280
+ publish_config.media_type = 1
3281
+ publish_config.sid = document.getElementById('video20').name
3282
+ publish_config.stream = canvas.captureStream(10)
3283
+ publish_config.video_profile_type = 5
3284
+ this.test_controller.ChangeMediaStream(publish_config);
3285
+ } else {
3286
+
3287
+ publish_config.media_type = 1
3288
+ publish_config.publish_device = 5
3289
+ publish_config.need_volume_analyser = true
3290
+ publish_config.video_profile_type = 5
3291
+ publish_config.stream = canvas.captureStream(10)
3292
+ publish_config.publish_video_id = 'video20'
3293
+ publish_config.publish_streamId_id = 'subscribe_streamId10'
3294
+ publish_config.publish_tag = 'projectionWhiteboard'
3295
+ this.test_controller.Publish(publish_config)
3296
+ }
3297
+ }, 0);
3298
+ navigator.mediaDevices.getDisplayMedia({
3299
+ video: true
3300
+ })
3301
+ .then((stream) => {
3302
+ videoMedia.srcObject = stream;
3303
+ }, error => {
3304
+ console.log("Unable to acquire screen capture", error);
3305
+ });
3306
+ // if (document.getElementById('video20').name) {
3307
+ // // 代表已经有了进行切流
3308
+ // publish_config.publish_device = 4
3309
+ // publish_config.media_type = 1
3310
+ // publish_config.sid = document.getElementById('video20').name
3311
+ // publish_config.part_of_screen_id = 'touBoxItem'
3312
+ // publish_config.video_profile_type = 5
3313
+ // this.test_controller.ChangeMediaStream(publish_config);
3314
+ // } else {
3315
+
3316
+ // publish_config.media_type = 1
3317
+ // publish_config.publish_device = 4
3318
+ // publish_config.need_volume_analyser = true
3319
+ // publish_config.video_profile_type = 5
3320
+ // publish_config.part_of_screen_id = 'touBoxItem';
3321
+ // publish_config.publish_video_id = 'video20'
3322
+ // publish_config.publish_streamId_id = 'subscribe_streamId10'
3323
+ // publish_config.publish_tag = 'projectionWhiteboard'
3324
+ // this.test_controller.Publish(publish_config)
3325
+ // }
3278
3326
  } else {
3279
3327
  this.messageClick('当前已经切换RM白板','success')
3280
3328
 
@@ -3477,8 +3525,8 @@ class Video extends Component {
3477
3525
  </div>
3478
3526
 
3479
3527
  </div>
3480
- {/* <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMWhiteboard') ? '' : 'none', }}> */}
3481
- <div className="videoDiv">
3528
+ <div className="videoDiv" style={{ display: (this.state.isSelect == 'RMWhiteboard') ? '' : 'none', }}>
3529
+ {/* <div className="videoDiv"> */}
3482
3530
  <div id="touBoxItem">
3483
3531
  {pdfChildren}
3484
3532
  </div>
@@ -4035,6 +4083,8 @@ class Video extends Component {
4035
4083
  </div>
4036
4084
  </Modal>
4037
4085
  <video className="mixedvideo" id="mixedvideo" autoPlay muted={true} width="0" height="0"></video>
4086
+ <video className="mixedvideo" id="manedvideo" autoPlay width="0" height="0"></video>
4087
+
4038
4088
  </Spin>
4039
4089
  </div>);
4040
4090
  }