react_hsbc_teller 0.8.7 → 0.9.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": "0.8.7",
3
+ "version": "0.9.9",
4
4
  "description": "React",
5
5
  "private": false,
6
6
  "main": "lib/hsbc.js",
@@ -250,5 +250,6 @@ function joinRoom(from, to) {
250
250
  export {
251
251
  initWebSocket,
252
252
  sendMessage,
253
+ disconnect,
253
254
  joinRoom
254
255
  }
@@ -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.isSharedScreen) {
2474
+ this.sharedScreen()
2475
+ }
2476
+ // }
2477
+
2459
2478
  }
2460
2479
  }
2461
2480
  enterRoom = async () =>{
@@ -2502,6 +2521,7 @@ class Video extends Component {
2502
2521
  }
2503
2522
  };
2504
2523
  componentWillUnmount() {
2524
+
2505
2525
  if (this.state.roomCustomerList.length == 0 && this.state.sessionType) {
2506
2526
  this.finishSessionClick()
2507
2527
  }
@@ -2512,19 +2532,13 @@ class Video extends Component {
2512
2532
  if(this.state.imStatus) {
2513
2533
  disconnect();
2514
2534
  }
2515
- this.setState({
2516
- isCustomer: false,
2517
- isWhiteboard: false,
2518
- isPictureInPicture: false,
2519
- imStatus: false,
2520
- imJoinRoom: false,
2521
- sessionType: false
2522
- });
2535
+
2536
+ }
2537
+ clearData=()=>{
2523
2538
  this.setState = (state, callback) => {
2524
2539
  return
2525
2540
  }
2526
2541
  this.cancel = ''
2527
- this.timer && clearInterval(this.timer);
2528
2542
  }
2529
2543
  finishSessionClick= async () => {
2530
2544
  try {
@@ -2536,20 +2550,19 @@ class Video extends Component {
2536
2550
  }
2537
2551
  }
2538
2552
  finishSession = () => {
2539
-
2540
-
2553
+ this.timer && clearInterval(this.timer);
2541
2554
  if(this.state.isSharedScreen) {
2542
- this.test_controller.UnPublish(document.getElementById('video20').name)
2543
- this.setState({
2544
- publishDevic: 1,
2545
- isSharedScreen: false,
2546
- screenName: '投屏'
2547
- });
2548
- console.log(pictureInPictureVideo)
2549
- this.tabTitlesClick('RMScreen', 'delect')
2555
+ this.setState({
2556
+ publishDevic: 1,
2557
+ isSharedScreen: false,
2558
+ screenName: '投屏',
2559
+ laveRoomSharedScreen: true
2560
+ });
2561
+ // this.test_controller.UnPublish(document.getElementById('video20').name)
2550
2562
  if (this.state.isPictureInPicture) {
2551
2563
  document.exitPictureInPicture()
2552
2564
  }
2565
+ console.log('isSharedScreen', this.state.isSharedScreen)
2553
2566
  this.props.onLeaveRoom({
2554
2567
  code: LEAVE_TYPE.TELLER_EXIT,
2555
2568
  errMsg: '坐席退出'
@@ -2559,7 +2572,9 @@ class Video extends Component {
2559
2572
  code: LEAVE_TYPE.TELLER_EXIT,
2560
2573
  errMsg: '坐席退出'
2561
2574
  })
2575
+
2562
2576
  }
2577
+
2563
2578
 
2564
2579
  }
2565
2580
  getRoomStatus = async data => {
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>,