react_hsbc_teller 1.1.2 → 1.1.3
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/demo/demo.js +5 -5
- package/packages/pages/video/video.jsx +25 -39
package/package.json
CHANGED
package/packages/demo/demo.js
CHANGED
|
@@ -4,17 +4,17 @@ import Pdf from './pdf.js'
|
|
|
4
4
|
|
|
5
5
|
class Demo extends Component {
|
|
6
6
|
state = {
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// imRoomId: "9K9ea1vOM@conference.ls-im-xmpp.chinawp.dev.ali.cloud.cn.hsbc",
|
|
8
|
+
// sessionId: "9K9ea1vOM",
|
|
9
|
+
// mtoken: "d4e648858b03",
|
|
10
|
+
// roomId: "645110140224386",
|
|
11
11
|
roomId: '',
|
|
12
12
|
mtoken: '',
|
|
13
13
|
imRoomId: '',
|
|
14
14
|
sessionId: '',
|
|
15
15
|
isVideo: false,
|
|
16
16
|
tellerAccount: '00000000',
|
|
17
|
-
callbackUrl: 'http://
|
|
17
|
+
callbackUrl: 'http://47.102.126.132:8720/hsbc/callback',
|
|
18
18
|
businessNumber: '',
|
|
19
19
|
lang: 'zh',
|
|
20
20
|
roomServerUrl: 'wss://mrtc.mpaas.cn-hangzhou.aliyuncs.com/ws',
|
|
@@ -1533,7 +1533,7 @@ class Video extends Component {
|
|
|
1533
1533
|
// 音视频关闭通知
|
|
1534
1534
|
this.test_controller.OnMediaClose = (code, sid) => {
|
|
1535
1535
|
console.log(code, sid)
|
|
1536
|
-
if(
|
|
1536
|
+
if(code == 5004 || code == 5007) {
|
|
1537
1537
|
this.roomCallBack(2, '媒体链路连接异常/超时',8)
|
|
1538
1538
|
}
|
|
1539
1539
|
};
|
|
@@ -3287,23 +3287,25 @@ class Video extends Component {
|
|
|
3287
3287
|
}
|
|
3288
3288
|
|
|
3289
3289
|
const publish_config = {};
|
|
3290
|
-
const width = this.state.whiteboardWidth;
|
|
3291
|
-
const height = this.state.whiteboardHeight;
|
|
3292
3290
|
const canvas = document.createElement('canvas');
|
|
3293
3291
|
const videoMedia = document.getElementById('manedvideo');
|
|
3294
3292
|
const cobj = canvas.getContext('2d'); // 获取绘图环境
|
|
3295
|
-
const
|
|
3296
|
-
const
|
|
3293
|
+
const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
|
|
3294
|
+
const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
|
|
3295
|
+
const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
|
|
3296
|
+
const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
|
|
3297
|
+
const width = right - left + 10
|
|
3298
|
+
const height = bottom - top - 33
|
|
3297
3299
|
canvas.width = width;
|
|
3298
3300
|
canvas.height = height;
|
|
3299
|
-
|
|
3301
|
+
videoMedia.addEventListener('play', (event) =>{
|
|
3300
3302
|
var $this = this; //cache
|
|
3301
|
-
console.log('
|
|
3303
|
+
console.log('addEventListener',!$this.paused,!$this.ended)
|
|
3302
3304
|
loop()
|
|
3303
3305
|
function loop() {
|
|
3304
3306
|
if (!$this.paused && !$this.ended) {
|
|
3305
|
-
cobj.drawImage(videoMedia,
|
|
3306
|
-
|
|
3307
|
+
cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
|
|
3308
|
+
setTimeout(loop, 1000 / 10); // drawing at 30fps
|
|
3307
3309
|
}
|
|
3308
3310
|
}
|
|
3309
3311
|
|
|
@@ -3331,7 +3333,8 @@ class Video extends Component {
|
|
|
3331
3333
|
}
|
|
3332
3334
|
}, 0);
|
|
3333
3335
|
navigator.mediaDevices.getDisplayMedia({
|
|
3334
|
-
video: true
|
|
3336
|
+
video: true,
|
|
3337
|
+
preferCurrentTab:true,
|
|
3335
3338
|
})
|
|
3336
3339
|
.then((stream) => {
|
|
3337
3340
|
videoMedia.srcObject = stream;
|
|
@@ -3367,22 +3370,24 @@ class Video extends Component {
|
|
|
3367
3370
|
document.exitPictureInPicture()
|
|
3368
3371
|
}
|
|
3369
3372
|
}
|
|
3370
|
-
const width = this.state.whiteboardWidth;
|
|
3371
|
-
const height = this.state.whiteboardHeight;
|
|
3372
3373
|
const canvas = document.createElement('canvas');
|
|
3373
3374
|
const videoMedia = document.getElementById('manedvideo');
|
|
3374
3375
|
const cobj = canvas.getContext('2d'); // 获取绘图环境
|
|
3375
|
-
const
|
|
3376
|
-
const
|
|
3376
|
+
const left = document.getElementById("whiteboardDIV").getBoundingClientRect().left;
|
|
3377
|
+
const right = document.getElementById("whiteboardDIV").getBoundingClientRect().right
|
|
3378
|
+
const top = document.getElementById("whiteboardDIV").getBoundingClientRect().top
|
|
3379
|
+
const bottom = document.getElementById("whiteboardDIV").getBoundingClientRect().bottom
|
|
3380
|
+
const width = right - left + 10
|
|
3381
|
+
const height = bottom - top - 33
|
|
3377
3382
|
canvas.width = width;
|
|
3378
3383
|
canvas.height = height;
|
|
3379
3384
|
videoMedia.addEventListener('play', (event) =>{
|
|
3380
3385
|
var $this = this; //cache
|
|
3381
|
-
console.log('
|
|
3386
|
+
console.log('addEventListener',!$this.paused,!$this.ended)
|
|
3382
3387
|
loop()
|
|
3383
3388
|
function loop() {
|
|
3384
3389
|
if (!$this.paused && !$this.ended) {
|
|
3385
|
-
cobj.drawImage(videoMedia,
|
|
3390
|
+
cobj.drawImage(videoMedia, left-10, top, width, height, 0, 0,width, height,);
|
|
3386
3391
|
setTimeout(loop, 1000 / 10); // drawing at 30fps
|
|
3387
3392
|
}
|
|
3388
3393
|
}
|
|
@@ -3411,7 +3416,8 @@ class Video extends Component {
|
|
|
3411
3416
|
}
|
|
3412
3417
|
}, 0);
|
|
3413
3418
|
navigator.mediaDevices.getDisplayMedia({
|
|
3414
|
-
video: true
|
|
3419
|
+
video: true,
|
|
3420
|
+
preferCurrentTab:true,
|
|
3415
3421
|
})
|
|
3416
3422
|
.then((stream) => {
|
|
3417
3423
|
videoMedia.srcObject = stream;
|
|
@@ -3424,26 +3430,6 @@ class Video extends Component {
|
|
|
3424
3430
|
}, error => {
|
|
3425
3431
|
console.log("Unable to acquire screen capture", error);
|
|
3426
3432
|
});
|
|
3427
|
-
// if (document.getElementById('video20').name) {
|
|
3428
|
-
// // 代表已经有了进行切流
|
|
3429
|
-
// publish_config.publish_device = 4
|
|
3430
|
-
// publish_config.media_type = 1
|
|
3431
|
-
// publish_config.sid = document.getElementById('video20').name
|
|
3432
|
-
// publish_config.part_of_screen_id = 'touBoxItem'
|
|
3433
|
-
// publish_config.video_profile_type = 5
|
|
3434
|
-
// this.test_controller.ChangeMediaStream(publish_config);
|
|
3435
|
-
// } else {
|
|
3436
|
-
|
|
3437
|
-
// publish_config.media_type = 1
|
|
3438
|
-
// publish_config.publish_device = 4
|
|
3439
|
-
// publish_config.need_volume_analyser = true
|
|
3440
|
-
// publish_config.video_profile_type = 5
|
|
3441
|
-
// publish_config.part_of_screen_id = 'touBoxItem';
|
|
3442
|
-
// publish_config.publish_video_id = 'video20'
|
|
3443
|
-
// publish_config.publish_streamId_id = 'subscribe_streamId10'
|
|
3444
|
-
// publish_config.publish_tag = 'projectionWhiteboard'
|
|
3445
|
-
// this.test_controller.Publish(publish_config)
|
|
3446
|
-
// }
|
|
3447
3433
|
} else {
|
|
3448
3434
|
this.messageClick('当前已经切换RM白板','success')
|
|
3449
3435
|
|
|
@@ -3506,8 +3492,8 @@ class Video extends Component {
|
|
|
3506
3492
|
var box=document.getElementById("whiteboardDIV");
|
|
3507
3493
|
if(box){ //此处在加一层判断,更加严密,如果box存在的情况下获取
|
|
3508
3494
|
this.state.whiteboardWidth = box.offsetWidth,
|
|
3509
|
-
this.state.whiteboardHeight = box.offsetHeight,
|
|
3510
|
-
console.log('whiteboardDIV', this.state.whiteboardHeight,this.state.whiteboardWidth)
|
|
3495
|
+
this.state.whiteboardHeight = box.offsetHeight - 33,
|
|
3496
|
+
console.log('whiteboardDIV', this.state.whiteboardHeight,box.clientHeight,this.state.whiteboardWidth)
|
|
3511
3497
|
}
|
|
3512
3498
|
}
|
|
3513
3499
|
render() {
|