react_hsbc_teller 0.8.9 → 1.0.1

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": "0.8.9",
3
+ "version": "1.0.1",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -41,6 +41,7 @@ class Video extends Component {
41
41
  cancel = axios.CancelToken.source()
42
42
  signCanvas = React.createRef();
43
43
  state = {
44
+ laveRoomSharedScreen: false,
44
45
  isJoinRoom: false,
45
46
  sessionType: false,
46
47
  isWhiteboard: false,
@@ -137,12 +138,6 @@ class Video extends Component {
137
138
  // eslint-disable-next-line no-undef
138
139
  test_controller = '';
139
140
 
140
- componentDidMount() {
141
- window.onbeforeunload = () => {
142
- this.finishSession()
143
- }
144
- };
145
-
146
141
  /**
147
142
  * 创建房间成功后回调后台
148
143
  * @param {JSON} data 数据类型
@@ -1540,6 +1535,15 @@ class Video extends Component {
1540
1535
  // 加入房间成功
1541
1536
  this.test_controller.OnJoinRoomSucc = () => {
1542
1537
  console.log('加入房间成功')
1538
+ let publish_config = {}
1539
+ publish_config.media_type = 1
1540
+ publish_config.publish_device = 1
1541
+ publish_config.need_volume_analyser = true
1542
+ publish_config.video_profile_type = 3
1543
+ publish_config.publish_video_id = 'publish_video1'
1544
+ publish_config.publish_streamId_id = 'publish_streamId1'
1545
+ publish_config.publish_tag = 'tag1'
1546
+ this.test_controller.Publish(publish_config)
1543
1547
  this.roomCallBack(1, '',0)
1544
1548
  };
1545
1549
  // 加入房间失败
@@ -2453,9 +2457,24 @@ class Video extends Component {
2453
2457
  }
2454
2458
  // 停止共享
2455
2459
  this.test_controller.OnDesktopDisplayClosed = () => {
2456
- if (this.state.isSharedScreen) {
2457
- this.sharedScreen()
2458
- }
2460
+ console.log('OnDesktopDisplayClosed', this.state.isSharedScreen ,this.state.laveRoomSharedScreen)
2461
+ // if(this.state.laveRoomSharedScreen) {
2462
+ // if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
2463
+ // this.finishSessionClick()
2464
+ // }
2465
+ // if (this.test_controller&&this.state.sessionType) {
2466
+ // this.test_controller.LeaveRoom()
2467
+ // this.test_controller.Disconnect()
2468
+ // }
2469
+ // if(this.state.imStatus) {
2470
+ // disconnect();
2471
+ // }
2472
+ // } else {
2473
+ if (!this.state.laveRoomSharedScreen && this.state.isSharedScreen) {
2474
+ this.sharedScreen()
2475
+ }
2476
+ // }
2477
+
2459
2478
  }
2460
2479
  }
2461
2480
  enterRoom = async () =>{
@@ -2502,11 +2521,7 @@ class Video extends Component {
2502
2521
  }
2503
2522
  };
2504
2523
  componentWillUnmount() {
2505
- this.clearData()
2506
2524
 
2507
-
2508
- }
2509
- clearData=()=>{
2510
2525
  if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
2511
2526
  this.finishSessionClick()
2512
2527
  }
@@ -2517,15 +2532,9 @@ class Video extends Component {
2517
2532
  if(this.state.imStatus) {
2518
2533
  disconnect();
2519
2534
  }
2520
- this.setState({
2521
- isCustomer: false,
2522
- isWhiteboard: false,
2523
- isPictureInPicture: false,
2524
- imStatus: false,
2525
- imJoinRoom: false,
2526
- sessionType: false
2527
- });
2528
- this.timer && clearInterval(this.timer);
2535
+
2536
+ }
2537
+ clearData=()=>{
2529
2538
  this.setState = (state, callback) => {
2530
2539
  return
2531
2540
  }
@@ -2541,28 +2550,37 @@ class Video extends Component {
2541
2550
  }
2542
2551
  }
2543
2552
  finishSession = () => {
2553
+ this.timer && clearInterval(this.timer);
2544
2554
  if(this.state.isSharedScreen) {
2545
- this.test_controller.UnPublish(document.getElementById('video20').name)
2546
- this.setState({
2547
- publishDevic: 1,
2548
- isSharedScreen: false,
2549
- screenName: '投屏'
2550
- });
2551
- console.log(pictureInPictureVideo)
2552
- this.tabTitlesClick('RMScreen', 'delect')
2555
+ this.setState({
2556
+ publishDevic: 1,
2557
+ isSharedScreen: false,
2558
+ screenName: '投屏',
2559
+ })
2560
+ this.state.laveRoomSharedScreen = true
2561
+ // this.test_controller.UnPublish(document.getElementById('video20').name)
2553
2562
  if (this.state.isPictureInPicture) {
2554
2563
  document.exitPictureInPicture()
2555
2564
  }
2565
+
2556
2566
  this.props.onLeaveRoom({
2557
2567
  code: LEAVE_TYPE.TELLER_EXIT,
2558
2568
  errMsg: '坐席退出'
2559
2569
  })
2560
2570
  } else {
2571
+ this.setState({
2572
+ publishDevic: 1,
2573
+ isSharedScreen: false,
2574
+ screenName: '投屏',
2575
+ });
2576
+ this.state.laveRoomSharedScreen = true
2561
2577
  this.props.onLeaveRoom({
2562
2578
  code: LEAVE_TYPE.TELLER_EXIT,
2563
2579
  errMsg: '坐席退出'
2564
2580
  })
2581
+
2565
2582
  }
2583
+ console.log('isSharedScreen', this.state.isSharedScreen,this.state.laveRoomSharedScreen)
2566
2584
 
2567
2585
  }
2568
2586
  getRoomStatus = async data => {
@@ -2813,6 +2831,7 @@ class Video extends Component {
2813
2831
  }
2814
2832
  };
2815
2833
  sharedScreen = () => {
2834
+ console.log('投屏')
2816
2835
  if (this.isFileSuccuse()) {
2817
2836
  const publish_config = {};
2818
2837
  if (this.state.isSharedScreen) {
package/src/index.js CHANGED
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import ReactDOM from "react-dom";
3
3
  import "./index.less";
4
4
  import '@babel/polyfill';
5
- // import { HSBC } from "../lib/hsbc";
6
- import {HSBC} from "../packages";
5
+ import { HSBC } from "../lib/hsbc";
6
+ // import {HSBC} from "../packages";
7
7
 
8
8
  ReactDOM.render(
9
9
  <div className="hsbc"><HSBC></HSBC></div>,