1.修改MCU断线处理,断开连接之后,各个模块不处理应用层操作,只给提示
2.MCU 心跳修改,MUC服务端已经修改了心跳请求的逻辑,30秒没有请求按离开处理,客户端每次心跳的时间改为10秒,检查超时=心跳时长*2+1; 3.会议状态增加当前课堂进行时间的记录,每隔30秒同步当前课堂状态,并保存到Sass
正在显示
10 个修改的文件
包含
255 行增加
和
152 行删除
| @@ -121,11 +121,11 @@ export default class MessageEntrance extends Emiter { | @@ -121,11 +121,11 @@ export default class MessageEntrance extends Emiter { | ||
| 121 | this.sendChatMsg = this._sendChatMsg; | 121 | this.sendChatMsg = this._sendChatMsg; |
| 122 | 122 | ||
| 123 | //videoApe | 123 | //videoApe |
| 124 | - this.getVideoPlayPath = this._getPlayVideoPath; | ||
| 125 | - this.getVideoPublishPath = this._getPublishVideoPath; | 124 | + this.getVideoPlayPath = this._getVideoPlayPath; |
| 125 | + this.getVideoPublishPath = this._getVideoPublishPath; | ||
| 126 | this.publishVideo = this._publishVideo; | 126 | this.publishVideo = this._publishVideo; |
| 127 | this.stopPublishVideo = this._stopPublishVideo; | 127 | this.stopPublishVideo = this._stopPublishVideo; |
| 128 | - this.sendVideoBroadcastMsg=this.sendVideoCommandMsg; | 128 | + this.sendVideoBroadcastMsg=this._sendVideoBroadcastMsg; |
| 129 | 129 | ||
| 130 | 130 | ||
| 131 | //audioApe | 131 | //audioApe |
| @@ -446,7 +446,7 @@ export default class MessageEntrance extends Emiter { | @@ -446,7 +446,7 @@ export default class MessageEntrance extends Emiter { | ||
| 446 | //获取会议所有参数 api/meeting/detail.do? flash中的接口文件是 getClassParam.do | 446 | //获取会议所有参数 api/meeting/detail.do? flash中的接口文件是 getClassParam.do |
| 447 | _sassGetClassParamSuccessHandler(_data) { | 447 | _sassGetClassParamSuccessHandler(_data) { |
| 448 | //console.log(GlobalConfig.classStatusInfo) | 448 | //console.log(GlobalConfig.classStatusInfo) |
| 449 | - loger.log('获取api/meeting/detail.do完成.'); | 449 | + loger.log('获取课堂会议的完整信息完成.'); |
| 450 | // console.log(_data); | 450 | // console.log(_data); |
| 451 | //包含整个会议最全的信息,储存数据 | 451 | //包含整个会议最全的信息,储存数据 |
| 452 | if (_data) { | 452 | if (_data) { |
| @@ -585,13 +585,19 @@ export default class MessageEntrance extends Emiter { | @@ -585,13 +585,19 @@ export default class MessageEntrance extends Emiter { | ||
| 585 | initSuccessCallBackData.userId = GlobalConfig.userId; | 585 | initSuccessCallBackData.userId = GlobalConfig.userId; |
| 586 | initSuccessCallBackData.passwordRequired = GlobalConfig.passwordRequired; | 586 | initSuccessCallBackData.passwordRequired = GlobalConfig.passwordRequired; |
| 587 | initSuccessCallBackData.classType = GlobalConfig.classType || ApeConsts.CLASS_TYPE_INTERACT; | 587 | initSuccessCallBackData.classType = GlobalConfig.classType || ApeConsts.CLASS_TYPE_INTERACT; |
| 588 | - loger.log('加入会议成功', initSuccessCallBackData); | 588 | + loger.log('加入会议成功'); |
| 589 | + console.log(initSuccessCallBackData); | ||
| 589 | _joinClassSuccessCallBackFun(initSuccessCallBackData); | 590 | _joinClassSuccessCallBackFun(initSuccessCallBackData); |
| 590 | } | 591 | } |
| 591 | } | 592 | } |
| 592 | 593 | ||
| 593 | //Sass删除文档数据 | 594 | //Sass删除文档数据 |
| 594 | _sassDeleteDocument(_param) { | 595 | _sassDeleteDocument(_param) { |
| 596 | + if(!_mcu.connected){ | ||
| 597 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 598 | + return; | ||
| 599 | + } | ||
| 600 | + | ||
| 595 | //判断传入的参数是否存在 | 601 | //判断传入的参数是否存在 |
| 596 | if (_param == null || EngineUtils.isEmptyObject(_param)) { | 602 | if (_param == null || EngineUtils.isEmptyObject(_param)) { |
| 597 | loger.error('sassDeleteDocument失败,参数错误', _param); | 603 | loger.error('sassDeleteDocument失败,参数错误', _param); |
| @@ -620,24 +626,42 @@ export default class MessageEntrance extends Emiter { | @@ -620,24 +626,42 @@ export default class MessageEntrance extends Emiter { | ||
| 620 | //ConferApe | 626 | //ConferApe |
| 621 | //开始上课 | 627 | //开始上课 |
| 622 | _sendStartClass(_param){ | 628 | _sendStartClass(_param){ |
| 629 | + if(!_mcu.connected){ | ||
| 630 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 631 | + return; | ||
| 632 | + } | ||
| 633 | + | ||
| 623 | if(_confer_ape){ | 634 | if(_confer_ape){ |
| 624 | _confer_ape.startClass(_param); | 635 | _confer_ape.startClass(_param); |
| 625 | } | 636 | } |
| 626 | } | 637 | } |
| 627 | //暂停上课 | 638 | //暂停上课 |
| 628 | _sendPauseClass(_param){ | 639 | _sendPauseClass(_param){ |
| 640 | + if(!_mcu.connected){ | ||
| 641 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 642 | + return; | ||
| 643 | + } | ||
| 629 | if(_confer_ape){ | 644 | if(_confer_ape){ |
| 630 | _confer_ape.pauseClass(_param); | 645 | _confer_ape.pauseClass(_param); |
| 631 | } | 646 | } |
| 632 | } | 647 | } |
| 633 | //停止上课 | 648 | //停止上课 |
| 634 | _sendCloseClass(_param){ | 649 | _sendCloseClass(_param){ |
| 650 | + if(!_mcu.connected){ | ||
| 651 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 652 | + return; | ||
| 653 | + } | ||
| 635 | if(_confer_ape){ | 654 | if(_confer_ape){ |
| 636 | _confer_ape.closeClass(_param); | 655 | _confer_ape.closeClass(_param); |
| 637 | } | 656 | } |
| 638 | } | 657 | } |
| 639 | // 离开会议 | 658 | // 离开会议 |
| 640 | _leaveClass() { | 659 | _leaveClass() { |
| 660 | + if(!_mcu.connected){ | ||
| 661 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 662 | + return; | ||
| 663 | + } | ||
| 664 | + | ||
| 641 | //停止推流 | 665 | //停止推流 |
| 642 | if(_video_ape){ | 666 | if(_video_ape){ |
| 643 | _video_ape.stopPublishVideo(); | 667 | _video_ape.stopPublishVideo(); |
| @@ -659,6 +683,10 @@ export default class MessageEntrance extends Emiter { | @@ -659,6 +683,10 @@ export default class MessageEntrance extends Emiter { | ||
| 659 | //ChatApe | 683 | //ChatApe |
| 660 | // 发送聊天消息 | 684 | // 发送聊天消息 |
| 661 | _sendChatMsg(_messageInfo) { | 685 | _sendChatMsg(_messageInfo) { |
| 686 | + if(!_mcu.connected){ | ||
| 687 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 688 | + return; | ||
| 689 | + } | ||
| 662 | if(_messageInfo===null||EngineUtils.isEmptyObject(_messageInfo)){ | 690 | if(_messageInfo===null||EngineUtils.isEmptyObject(_messageInfo)){ |
| 663 | loger.log('sendChatMsg 传递的参数不对',_messageInfo); | 691 | loger.log('sendChatMsg 传递的参数不对',_messageInfo); |
| 664 | return ; | 692 | return ; |
| @@ -676,31 +704,43 @@ export default class MessageEntrance extends Emiter { | @@ -676,31 +704,43 @@ export default class MessageEntrance extends Emiter { | ||
| 676 | } | 704 | } |
| 677 | } | 705 | } |
| 678 | 706 | ||
| 679 | - sendVideoCommandMsg(_param){ | 707 | + _sendVideoBroadcastMsg(_param){ |
| 708 | + if(!_mcu.connected){ | ||
| 709 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 710 | + return; | ||
| 711 | + } | ||
| 680 | if(_video_ape){ | 712 | if(_video_ape){ |
| 681 | - return _video_ape.sendVideoCommandMsg(_param); | 713 | + return _video_ape.sendVideoBroadcastMsg(_param); |
| 682 | } | 714 | } |
| 683 | } | 715 | } |
| 684 | 716 | ||
| 685 | - _getPlayVideoPath(_param){ | 717 | + _getVideoPlayPath(_param){ |
| 686 | if(_video_ape){ | 718 | if(_video_ape){ |
| 687 | return _video_ape.getPlayVideoPath(_param); | 719 | return _video_ape.getPlayVideoPath(_param); |
| 688 | } | 720 | } |
| 689 | } | 721 | } |
| 690 | 722 | ||
| 691 | - _getPublishVideoPath(_param){ | 723 | + _getVideoPublishPath(_param){ |
| 692 | if(_video_ape){ | 724 | if(_video_ape){ |
| 693 | return _video_ape.getPublishVideoPath(_param); | 725 | return _video_ape.getPublishVideoPath(_param); |
| 694 | } | 726 | } |
| 695 | } | 727 | } |
| 696 | 728 | ||
| 697 | _publishVideo(_param){ | 729 | _publishVideo(_param){ |
| 730 | + if(!_mcu.connected){ | ||
| 731 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 732 | + return; | ||
| 733 | + } | ||
| 698 | if(_video_ape){ | 734 | if(_video_ape){ |
| 699 | return _video_ape.publishVideo(_param); | 735 | return _video_ape.publishVideo(_param); |
| 700 | } | 736 | } |
| 701 | } | 737 | } |
| 702 | 738 | ||
| 703 | _stopPublishVideo(_param){ | 739 | _stopPublishVideo(_param){ |
| 740 | + if(!_mcu.connected){ | ||
| 741 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 742 | + return; | ||
| 743 | + } | ||
| 704 | if(_video_ape){ | 744 | if(_video_ape){ |
| 705 | return _video_ape.stopPublishVideo(_param); | 745 | return _video_ape.stopPublishVideo(_param); |
| 706 | } | 746 | } |
| @@ -715,6 +755,10 @@ export default class MessageEntrance extends Emiter { | @@ -715,6 +755,10 @@ export default class MessageEntrance extends Emiter { | ||
| 715 | } | 755 | } |
| 716 | 756 | ||
| 717 | sendAudioCommandMsg(_param){ | 757 | sendAudioCommandMsg(_param){ |
| 758 | + if(!_mcu.connected){ | ||
| 759 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 760 | + return; | ||
| 761 | + } | ||
| 718 | if(_audio_ape){ | 762 | if(_audio_ape){ |
| 719 | return _audio_ape.sendAudioBroadcastMsg(_param); | 763 | return _audio_ape.sendAudioBroadcastMsg(_param); |
| 720 | } | 764 | } |
| @@ -733,12 +777,20 @@ export default class MessageEntrance extends Emiter { | @@ -733,12 +777,20 @@ export default class MessageEntrance extends Emiter { | ||
| 733 | } | 777 | } |
| 734 | 778 | ||
| 735 | _publishAudio(_param){ | 779 | _publishAudio(_param){ |
| 780 | + if(!_mcu.connected){ | ||
| 781 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 782 | + return; | ||
| 783 | + } | ||
| 736 | if(_audio_ape){ | 784 | if(_audio_ape){ |
| 737 | return _audio_ape.publishAudio(_param); | 785 | return _audio_ape.publishAudio(_param); |
| 738 | } | 786 | } |
| 739 | } | 787 | } |
| 740 | 788 | ||
| 741 | _stopPublishAudio(_param){ | 789 | _stopPublishAudio(_param){ |
| 790 | + if(!_mcu.connected){ | ||
| 791 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 792 | + return; | ||
| 793 | + } | ||
| 742 | if(_audio_ape){ | 794 | if(_audio_ape){ |
| 743 | return _audio_ape.stopPublishAudio(_param); | 795 | return _audio_ape.stopPublishAudio(_param); |
| 744 | } | 796 | } |
| @@ -748,6 +800,10 @@ export default class MessageEntrance extends Emiter { | @@ -748,6 +800,10 @@ export default class MessageEntrance extends Emiter { | ||
| 748 | //WhiteBoardApe | 800 | //WhiteBoardApe |
| 749 | // 添加标注,发送信息 | 801 | // 添加标注,发送信息 |
| 750 | _sendInsertAnnotaion(_param){ | 802 | _sendInsertAnnotaion(_param){ |
| 803 | + if(!_mcu.connected){ | ||
| 804 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 805 | + return; | ||
| 806 | + } | ||
| 751 | if(_whiteboard_ape){ | 807 | if(_whiteboard_ape){ |
| 752 | _whiteboard_ape.sendInsetAnnotaion(_param); | 808 | _whiteboard_ape.sendInsetAnnotaion(_param); |
| 753 | } | 809 | } |
| @@ -755,18 +811,30 @@ export default class MessageEntrance extends Emiter { | @@ -755,18 +811,30 @@ export default class MessageEntrance extends Emiter { | ||
| 755 | 811 | ||
| 756 | //删除标注,发送信息 | 812 | //删除标注,发送信息 |
| 757 | _sendDeleteAnnotaion(_param){ | 813 | _sendDeleteAnnotaion(_param){ |
| 814 | + if(!_mcu.connected){ | ||
| 815 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 816 | + return; | ||
| 817 | + } | ||
| 758 | if(_whiteboard_ape){ | 818 | if(_whiteboard_ape){ |
| 759 | _whiteboard_ape.sendDeleteAnnotaion(_param); | 819 | _whiteboard_ape.sendDeleteAnnotaion(_param); |
| 760 | } | 820 | } |
| 761 | } | 821 | } |
| 762 | //删除当前页面上的所有标注 | 822 | //删除当前页面上的所有标注 |
| 763 | _sendDeleteCurPageAnnotation(_param){ | 823 | _sendDeleteCurPageAnnotation(_param){ |
| 824 | + if(!_mcu.connected){ | ||
| 825 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 826 | + return; | ||
| 827 | + } | ||
| 764 | if(_whiteboard_ape){ | 828 | if(_whiteboard_ape){ |
| 765 | _whiteboard_ape.sendDeleteCurPageAnnotation(_param); | 829 | _whiteboard_ape.sendDeleteCurPageAnnotation(_param); |
| 766 | } | 830 | } |
| 767 | } | 831 | } |
| 768 | //删除所有标注 | 832 | //删除所有标注 |
| 769 | _sendDeleteAllAnnotation(_param){ | 833 | _sendDeleteAllAnnotation(_param){ |
| 834 | + if(!_mcu.connected){ | ||
| 835 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 836 | + return; | ||
| 837 | + } | ||
| 770 | if(_whiteboard_ape){ | 838 | if(_whiteboard_ape){ |
| 771 | _whiteboard_ape.sendDeleteAllAnnotation(_param); | 839 | _whiteboard_ape.sendDeleteAllAnnotation(_param); |
| 772 | } | 840 | } |
| @@ -791,36 +859,60 @@ export default class MessageEntrance extends Emiter { | @@ -791,36 +859,60 @@ export default class MessageEntrance extends Emiter { | ||
| 791 | } | 859 | } |
| 792 | //上传文档 | 860 | //上传文档 |
| 793 | _sendDocumentUpload(_param){ | 861 | _sendDocumentUpload(_param){ |
| 862 | + if(!_mcu.connected){ | ||
| 863 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 864 | + return; | ||
| 865 | + } | ||
| 794 | if(_doc_ape){ | 866 | if(_doc_ape){ |
| 795 | _doc_ape.documentUpload(_param); | 867 | _doc_ape.documentUpload(_param); |
| 796 | } | 868 | } |
| 797 | } | 869 | } |
| 798 | //切换文档 | 870 | //切换文档 |
| 799 | _sendDocumentSwitchDoc(_param){ | 871 | _sendDocumentSwitchDoc(_param){ |
| 872 | + if(!_mcu.connected){ | ||
| 873 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 874 | + return; | ||
| 875 | + } | ||
| 800 | if(_doc_ape){ | 876 | if(_doc_ape){ |
| 801 | _doc_ape.documentSwitchDoc(_param); | 877 | _doc_ape.documentSwitchDoc(_param); |
| 802 | } | 878 | } |
| 803 | } | 879 | } |
| 804 | //操作文档(翻页) | 880 | //操作文档(翻页) |
| 805 | _sendDocumentSwitchPage(_param){ | 881 | _sendDocumentSwitchPage(_param){ |
| 882 | + if(!_mcu.connected){ | ||
| 883 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 884 | + return; | ||
| 885 | + } | ||
| 806 | if(_doc_ape){ | 886 | if(_doc_ape){ |
| 807 | _doc_ape.documentSwitchPage(_param); | 887 | _doc_ape.documentSwitchPage(_param); |
| 808 | } | 888 | } |
| 809 | } | 889 | } |
| 810 | //操作文档(缩放、滚动...) | 890 | //操作文档(缩放、滚动...) |
| 811 | _sendDocumentCommand(_param){ | 891 | _sendDocumentCommand(_param){ |
| 892 | + if(!_mcu.connected){ | ||
| 893 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 894 | + return; | ||
| 895 | + } | ||
| 812 | if(_doc_ape){ | 896 | if(_doc_ape){ |
| 813 | _doc_ape.documentCommand(_param); | 897 | _doc_ape.documentCommand(_param); |
| 814 | } | 898 | } |
| 815 | } | 899 | } |
| 816 | //删除文档 | 900 | //删除文档 |
| 817 | _sendDocumentDelete(_param){ | 901 | _sendDocumentDelete(_param){ |
| 902 | + if(!_mcu.connected){ | ||
| 903 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 904 | + return; | ||
| 905 | + } | ||
| 818 | if(_doc_ape){ | 906 | if(_doc_ape){ |
| 819 | _doc_ape.documentDelete(_param); | 907 | _doc_ape.documentDelete(_param); |
| 820 | } | 908 | } |
| 821 | } | 909 | } |
| 822 | //删除所有文档 | 910 | //删除所有文档 |
| 823 | _documentDeleteAll(_param){ | 911 | _documentDeleteAll(_param){ |
| 912 | + if(!_mcu.connected){ | ||
| 913 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 914 | + return; | ||
| 915 | + } | ||
| 824 | if(_doc_ape){ | 916 | if(_doc_ape){ |
| 825 | _doc_ape.documentDeleteAll(_param); | 917 | _doc_ape.documentDeleteAll(_param); |
| 826 | } | 918 | } |
| @@ -828,6 +920,10 @@ export default class MessageEntrance extends Emiter { | @@ -828,6 +920,10 @@ export default class MessageEntrance extends Emiter { | ||
| 828 | 920 | ||
| 829 | //// 文档变更,白板也需要做处理 | 921 | //// 文档变更,白板也需要做处理 |
| 830 | docUpdateHandler(_data) { | 922 | docUpdateHandler(_data) { |
| 923 | + if(!_mcu.connected){ | ||
| 924 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 925 | + return; | ||
| 926 | + } | ||
| 831 | loger.log('Doc UpdateId ->'); | 927 | loger.log('Doc UpdateId ->'); |
| 832 | console.log(_data); | 928 | console.log(_data); |
| 833 | if(_whiteboard_ape){ | 929 | if(_whiteboard_ape){ |
| @@ -20,7 +20,7 @@ class EverSocket extends Emiter { | @@ -20,7 +20,7 @@ class EverSocket extends Emiter { | ||
| 20 | constructor() { | 20 | constructor() { |
| 21 | super(); | 21 | super(); |
| 22 | this._connected = false; | 22 | this._connected = false; |
| 23 | - this._lastActiveTime = 0; | 23 | + this._lastActiveTime = 0;//最后一次收到消息的时间 |
| 24 | this._enableEverSocket = false; | 24 | this._enableEverSocket = false; |
| 25 | } | 25 | } |
| 26 | 26 | ||
| @@ -77,6 +77,7 @@ class EverSocket extends Emiter { | @@ -77,6 +77,7 @@ class EverSocket extends Emiter { | ||
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | _clear() { | 79 | _clear() { |
| 80 | + this._emit(EverSocket.CLOSED); | ||
| 80 | loger.log('WebSocket,Timers销毁'); | 81 | loger.log('WebSocket,Timers销毁'); |
| 81 | window.clearInterval(this.pingTimer); | 82 | window.clearInterval(this.pingTimer); |
| 82 | window.clearInterval(this.pongTimer); | 83 | window.clearInterval(this.pongTimer); |
| @@ -150,9 +151,19 @@ class EverSocket extends Emiter { | @@ -150,9 +151,19 @@ class EverSocket extends Emiter { | ||
| 150 | } | 151 | } |
| 151 | } | 152 | } |
| 152 | 153 | ||
| 154 | + | ||
| 155 | +/*//修改之前的 | ||
| 153 | EverSocket.prototype.PONG_INTERVAL = EverSocket.PONG_INTERVAL = 5000; | 156 | EverSocket.prototype.PONG_INTERVAL = EverSocket.PONG_INTERVAL = 5000; |
| 154 | EverSocket.prototype.PING_INTERVAL = EverSocket.PING_INTERVAL = 3000; | 157 | EverSocket.prototype.PING_INTERVAL = EverSocket.PING_INTERVAL = 3000; |
| 155 | -EverSocket.prototype.RECONN_INTERVAL = EverSocket.RECONN_INTERVAL = 2000; | 158 | +EverSocket.prototype.RECONN_INTERVAL = EverSocket.RECONN_INTERVAL = 2000;*/ |
| 159 | + | ||
| 160 | + | ||
| 161 | +//20170223-mcu服务端修改了心跳的逻辑,如果客户端30秒没有请求,就会按离开的处理 | ||
| 162 | +//目前客户端发送心跳请求的空数据,服务端不会每次都回,暂定为10秒心跳一次 | ||
| 163 | +EverSocket.prototype.PONG_INTERVAL = EverSocket.PONG_INTERVAL = 21000;// | ||
| 164 | +EverSocket.prototype.PING_INTERVAL = EverSocket.PING_INTERVAL = 10000;//心跳间隔 | ||
| 165 | +EverSocket.prototype.RECONN_INTERVAL = EverSocket.RECONN_INTERVAL = 3000;//重连的间隔 | ||
| 166 | + | ||
| 156 | EverSocket.prototype.CONNECTING = EverSocket.CONNECTING = 0; | 167 | EverSocket.prototype.CONNECTING = EverSocket.CONNECTING = 0; |
| 157 | EverSocket.prototype.OPEN = EverSocket.OPEN = 1; | 168 | EverSocket.prototype.OPEN = EverSocket.OPEN = 1; |
| 158 | EverSocket.prototype.CLOSING = EverSocket.CLOSING = 2; | 169 | EverSocket.prototype.CLOSING = EverSocket.CLOSING = 2; |
| @@ -311,6 +311,7 @@ GlobalConfig.recordFileName="";//录制的文件名 | @@ -311,6 +311,7 @@ GlobalConfig.recordFileName="";//录制的文件名 | ||
| 311 | GlobalConfig.recordDownloadUrl="";//下载地址 | 311 | GlobalConfig.recordDownloadUrl="";//下载地址 |
| 312 | GlobalConfig.recordReplaytickValues={}; // 滚动条关键点,用于快进快退 | 312 | GlobalConfig.recordReplaytickValues={}; // 滚动条关键点,用于快进快退 |
| 313 | 313 | ||
| 314 | +GlobalConfig.updateClassInfoDelay=30;//(秒),每隔30秒同步一次会议状态的并保存到Sass | ||
| 314 | //GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取 | 315 | //GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取 |
| 315 | 316 | ||
| 316 | 317 |
| @@ -24,6 +24,11 @@ MessageTypes.CLASS_EXIT = 'class.exit';//退出 关闭会议 | @@ -24,6 +24,11 @@ MessageTypes.CLASS_EXIT = 'class.exit';//退出 关闭会议 | ||
| 24 | MessageTypes.CLASS_UPTATE_STATUS = 'class.update.status';//更新会议状态信息 | 24 | MessageTypes.CLASS_UPTATE_STATUS = 'class.update.status';//更新会议状态信息 |
| 25 | MessageTypes.CLASS_STATUS_INFO_CHANGE= 'class.status.info.change';//会议状态信息发生改变,需要保存数据到sass和同步MCU | 25 | MessageTypes.CLASS_STATUS_INFO_CHANGE= 'class.status.info.change';//会议状态信息发生改变,需要保存数据到sass和同步MCU |
| 26 | 26 | ||
| 27 | +MessageTypes.CLASS_UPDATE_TIMER='class.update.timer';//更新当前上课的时间 | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + | ||
| 27 | //聊天模块事件定义 | 32 | //聊天模块事件定义 |
| 28 | MessageTypes.CHAT_RECEIVE = 'chat.receive'; | 33 | MessageTypes.CHAT_RECEIVE = 'chat.receive'; |
| 29 | 34 |
| @@ -17,7 +17,6 @@ class Sass extends Emiter { | @@ -17,7 +17,6 @@ class Sass extends Emiter { | ||
| 17 | ///////////////////////////////////////Sass 接口/////////////////////////////////////////////////// | 17 | ///////////////////////////////////////Sass 接口/////////////////////////////////////////////////// |
| 18 | //Sass init初始化获取课堂校验信息----------------------------------------------------------------- | 18 | //Sass init初始化获取课堂校验信息----------------------------------------------------------------- |
| 19 | getJoinParams(_initInfo) { | 19 | getJoinParams(_initInfo) { |
| 20 | - loger.log('初始化init获取课堂校验信息', _initInfo); | ||
| 21 | /* 获取用于加入课堂的参数 | 20 | /* 获取用于加入课堂的参数 |
| 22 | /3m/api/meeting/joinParams.do | 21 | /3m/api/meeting/joinParams.do |
| 23 | 参数 (application/x-www-form-urlencoded): | 22 | 参数 (application/x-www-form-urlencoded): |
| @@ -37,7 +36,9 @@ class Sass extends Emiter { | @@ -37,7 +36,9 @@ class Sass extends Emiter { | ||
| 37 | classType 课堂类型 | 36 | classType 课堂类型 |
| 38 | */ | 37 | */ |
| 39 | let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.classId}&userID=${_initInfo.userId}`; | 38 | let url = `http://${_initInfo.portal}/3m/api/meeting/joinParams.do?meetingNumber=${_initInfo.classId}&userID=${_initInfo.userId}`; |
| 40 | - loger.log('初始化init获取课堂校验信息.', url); | 39 | + loger.log('1.初始化init获取课堂校验信息.'); |
| 40 | + console.log(url); | ||
| 41 | + console.log(_initInfo); | ||
| 41 | fetch(url, { | 42 | fetch(url, { |
| 42 | timeout: 5000 | 43 | timeout: 5000 |
| 43 | }) | 44 | }) |
| @@ -83,7 +84,8 @@ class Sass extends Emiter { | @@ -83,7 +84,8 @@ class Sass extends Emiter { | ||
| 83 | 84 | ||
| 84 | // Sass校验开始-->密码校验(如果需要密码)--->MD5校验---------------------------------------------------- | 85 | // Sass校验开始-->密码校验(如果需要密码)--->MD5校验---------------------------------------------------- |
| 85 | passwordAndMd5Checking(_param) { | 86 | passwordAndMd5Checking(_param) { |
| 86 | - loger.log('开始Sass校验', _param); | 87 | + loger.log('2.开始Sass校验'); |
| 88 | + console.log(_param); | ||
| 87 | confInfo = _param; | 89 | confInfo = _param; |
| 88 | // 密码校验 | 90 | // 密码校验 |
| 89 | if (confInfo.passwordRequired === 'true'||confInfo.passwordRequired === true) { | 91 | if (confInfo.passwordRequired === 'true'||confInfo.passwordRequired === true) { |
| @@ -112,7 +114,7 @@ class Sass extends Emiter { | @@ -112,7 +114,7 @@ class Sass extends Emiter { | ||
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | let url = `http://${confInfo.portal}/3m/api/meeting/signIn.do?siteId=${confInfo.siteId}&classId=${confInfo.classId}&isTeacher=${isTeacher}&password=${confInfo.password}`; | 116 | let url = `http://${confInfo.portal}/3m/api/meeting/signIn.do?siteId=${confInfo.siteId}&classId=${confInfo.classId}&isTeacher=${isTeacher}&password=${confInfo.password}`; |
| 115 | - loger.log('会议密码校验', url); | 117 | + loger.log('3.会议密码校验', url); |
| 116 | fetch(url, { | 118 | fetch(url, { |
| 117 | timeout: 5000 | 119 | timeout: 5000 |
| 118 | }) | 120 | }) |
| @@ -149,7 +151,7 @@ class Sass extends Emiter { | @@ -149,7 +151,7 @@ class Sass extends Emiter { | ||
| 149 | //MD5校验----------------------------------------------------------------------------------------- | 151 | //MD5校验----------------------------------------------------------------------------------------- |
| 150 | sendMD5Checking() { | 152 | sendMD5Checking() { |
| 151 | let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.classId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.passwordRequired}&md5=${confInfo.md5}`; | 153 | let url = `http://${confInfo.portal}/3m/meeting/md5CheckMeeting.do?siteId=${confInfo.siteId}&meetingNumber=${confInfo.classId}&userId=${confInfo.userId}&userName=${confInfo.userName}&userType=${confInfo.userType}&nopassword=${confInfo.passwordRequired}&md5=${confInfo.md5}`; |
| 152 | - loger.log('MD5校验', url); | 154 | + loger.log('4.MD5校验', url); |
| 153 | fetch(url, { | 155 | fetch(url, { |
| 154 | timeout: 5000 | 156 | timeout: 5000 |
| 155 | }) | 157 | }) |
| @@ -179,7 +181,8 @@ class Sass extends Emiter { | @@ -179,7 +181,8 @@ class Sass extends Emiter { | ||
| 179 | GlobalConfig.maxVideoChannels=confInfo.maxVideoChannels; | 181 | GlobalConfig.maxVideoChannels=confInfo.maxVideoChannels; |
| 180 | GlobalConfig.maxAudioChannels=confInfo.maxAudioChannels; | 182 | GlobalConfig.maxAudioChannels=confInfo.maxAudioChannels; |
| 181 | GlobalConfig.maxMediaChannels=confInfo.maxMediaChannels;*/ | 183 | GlobalConfig.maxMediaChannels=confInfo.maxMediaChannels;*/ |
| 182 | - loger.log('MD5校验完成',ret); | 184 | + loger.log('MD5校验完成'); |
| 185 | + console.log(ret); | ||
| 183 | this._emit(Sass.SUCCESS,ret); | 186 | this._emit(Sass.SUCCESS,ret); |
| 184 | } else { | 187 | } else { |
| 185 | loger.log('MD5校验-失败.'); | 188 | loger.log('MD5校验-失败.'); |
| @@ -245,7 +248,8 @@ class Sass extends Emiter { | @@ -245,7 +248,8 @@ class Sass extends Emiter { | ||
| 245 | var timestamp=new Date().getTime(); | 248 | var timestamp=new Date().getTime(); |
| 246 | var authId=MD5(confInfo.classId+""+timestamp);//课堂号+时间戳 的字符串,转成MD5 | 249 | var authId=MD5(confInfo.classId+""+timestamp);//课堂号+时间戳 的字符串,转成MD5 |
| 247 | let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.classId}×tamp=${timestamp}&authId=${authId}`; | 250 | let url = `http://${confInfo.portal}/3m/api/meeting/detail.do?meetingNumber=${confInfo.classId}×tamp=${timestamp}&authId=${authId}`; |
| 248 | - loger.log('Sass getClassParam ', url); | 251 | + loger.log('5.获取课堂会议的完整信息 '); |
| 252 | + console.log(url); | ||
| 249 | fetch(url, { | 253 | fetch(url, { |
| 250 | timeout: 5000 | 254 | timeout: 5000 |
| 251 | }) | 255 | }) |
| @@ -253,7 +257,7 @@ class Sass extends Emiter { | @@ -253,7 +257,7 @@ class Sass extends Emiter { | ||
| 253 | if (ret.ok) { | 257 | if (ret.ok) { |
| 254 | return ret.json(); | 258 | return ret.json(); |
| 255 | } else { | 259 | } else { |
| 256 | - loger.error(`getClassParam-网络异常.状态码:${ret.status}`); | 260 | + loger.error(`获取课堂会议的完整信息-网络异常.状态码:${ret.status}`); |
| 257 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); | 261 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); |
| 258 | 262 | ||
| 259 | throw ''; | 263 | throw ''; |
| @@ -261,15 +265,15 @@ class Sass extends Emiter { | @@ -261,15 +265,15 @@ class Sass extends Emiter { | ||
| 261 | }) | 265 | }) |
| 262 | .then(ret => { | 266 | .then(ret => { |
| 263 | if (ret.code === 0) { | 267 | if (ret.code === 0) { |
| 264 | - loger.log('getClassParam 完成'); | 268 | + loger.log('获取课堂会议的完整信息完成'); |
| 265 | this._emit(Sass.CLASS_GET_CLASS_PARAM, ret); | 269 | this._emit(Sass.CLASS_GET_CLASS_PARAM, ret); |
| 266 | } else { | 270 | } else { |
| 267 | - loger.warn('getClassParam 失败.'); | 271 | + loger.warn('获取课堂会议的完整信息 失败.'); |
| 268 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); | 272 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); |
| 269 | } | 273 | } |
| 270 | }) | 274 | }) |
| 271 | .catch(err => { | 275 | .catch(err => { |
| 272 | - loger.error(`getClassParam异常.状态码:${err}`); | 276 | + loger.error(`获取课堂会议的完整信息异常.状态码:${err}`); |
| 273 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); | 277 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_GET_CLASS_PARAML); |
| 274 | }); | 278 | }); |
| 275 | } | 279 | } |
| @@ -300,7 +300,8 @@ export default class Ape extends Emiter { | @@ -300,7 +300,8 @@ export default class Ape extends Emiter { | ||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | send(appPdu) { | 302 | send(appPdu) { |
| 303 | - loger.log('Ape发送数据NORMAL PDU', appPdu); | 303 | + loger.log('Ape发送数据NORMAL PDU'); |
| 304 | + console.log(appPdu); | ||
| 304 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | 305 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); |
| 305 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ | 306 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ |
| 306 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); | 307 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); |
| @@ -325,7 +326,8 @@ export default class Ape extends Emiter { | @@ -325,7 +326,8 @@ export default class Ape extends Emiter { | ||
| 325 | 326 | ||
| 326 | // 发送当前APE(session uniform包) | 327 | // 发送当前APE(session uniform包) |
| 327 | sendUniform(appPdu, top) { | 328 | sendUniform(appPdu, top) { |
| 328 | - loger.log('Ape发送数据UNIFORM PDU', appPdu); | 329 | + loger.log('Ape发送数据UNIFORM PDU'); |
| 330 | + console.log(appPdu); | ||
| 329 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | 331 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); |
| 330 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ | 332 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ |
| 331 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); | 333 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); |
| @@ -349,7 +351,8 @@ export default class Ape extends Emiter { | @@ -349,7 +351,8 @@ export default class Ape extends Emiter { | ||
| 349 | } | 351 | } |
| 350 | 352 | ||
| 351 | sendChatUniform(appPdu, top) { | 353 | sendChatUniform(appPdu, top) { |
| 352 | - loger.log('Ape发送数据UNIFORM PDU', appPdu); | 354 | + loger.log('Ape发送数据UNIFORM PDU'); |
| 355 | + console.log(appPdu); | ||
| 353 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); | 356 | //loger.log('当前的状态============',GlobalConfig.getCurrentStatus().code); |
| 354 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ | 357 | if(GlobalConfig.getCurrentStatus().code==0||GlobalConfig.getCurrentStatus().code==1){ |
| 355 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); | 358 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_SEND_FAILED_NO_JOIN); |
| @@ -52,6 +52,11 @@ class AudioApe extends Ape { | @@ -52,6 +52,11 @@ class AudioApe extends Ape { | ||
| 52 | 52 | ||
| 53 | //推流 | 53 | //推流 |
| 54 | publishAudio(_param) { | 54 | publishAudio(_param) { |
| 55 | + if(!this.mcu.connected){ | ||
| 56 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 57 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 58 | + } | ||
| 59 | + | ||
| 55 | if (_param == null||_param.channelId == null|| | 60 | if (_param == null||_param.channelId == null|| |
| 56 | _param.classId == null||_param.userId == null|| | 61 | _param.classId == null||_param.userId == null|| |
| 57 | _param.siteId == null|| _param.timestamp==null) | 62 | _param.siteId == null|| _param.timestamp==null) |
| @@ -96,6 +101,10 @@ class AudioApe extends Ape { | @@ -96,6 +101,10 @@ class AudioApe extends Ape { | ||
| 96 | //停止推流, | 101 | //停止推流, |
| 97 | stopPublishAudio(_param) { | 102 | stopPublishAudio(_param) { |
| 98 | loger.log('stopPublishAudio'); | 103 | loger.log('stopPublishAudio'); |
| 104 | + if(!this.mcu.connected){ | ||
| 105 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 106 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 107 | + } | ||
| 99 | //_param如果为空,那么默认就是当前自己的nodeId,否则用_param | 108 | //_param如果为空,那么默认就是当前自己的nodeId,否则用_param |
| 100 | let nodeId; | 109 | let nodeId; |
| 101 | if(_param&&parseInt(_param.nodeId)>=0){ | 110 | if(_param&&parseInt(_param.nodeId)>=0){ |
| @@ -122,6 +131,10 @@ class AudioApe extends Ape { | @@ -122,6 +131,10 @@ class AudioApe extends Ape { | ||
| 122 | } | 131 | } |
| 123 | 132 | ||
| 124 | sendAudioBroadcastMsg(_param) { | 133 | sendAudioBroadcastMsg(_param) { |
| 134 | + if(!this.mcu.connected){ | ||
| 135 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 136 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 137 | + } | ||
| 125 | if (this._classInfo === null || EngineUtils.isEmptyObject(this._classInfo)) { | 138 | if (this._classInfo === null || EngineUtils.isEmptyObject(this._classInfo)) { |
| 126 | loger.log('sendAudioBroadcastMsg.McuClient还未初始化数据!'); | 139 | loger.log('sendAudioBroadcastMsg.McuClient还未初始化数据!'); |
| 127 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { | 140 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { |
| @@ -11,6 +11,7 @@ import UTF8 from 'utf-8'; | @@ -11,6 +11,7 @@ import UTF8 from 'utf-8'; | ||
| 11 | import Loger from 'Loger'; | 11 | import Loger from 'Loger'; |
| 12 | import GlobalConfig from 'GlobalConfig'; | 12 | import GlobalConfig from 'GlobalConfig'; |
| 13 | import EngineUtils from 'EngineUtils'; | 13 | import EngineUtils from 'EngineUtils'; |
| 14 | +import TimerCounter from "TimerCounter"; | ||
| 14 | 15 | ||
| 15 | let loger = Loger.getLoger('ConferApe'); | 16 | let loger = Loger.getLoger('ConferApe'); |
| 16 | let itemIdx=0;//table插入新数据的计数id,目前用时间戳 | 17 | let itemIdx=0;//table插入新数据的计数id,目前用时间戳 |
| @@ -34,6 +35,7 @@ class ConferApe extends Ape { | @@ -34,6 +35,7 @@ class ConferApe extends Ape { | ||
| 34 | // 默认值: normal | 35 | // 默认值: normal |
| 35 | this.hostUserId = '';//主持人的 第三方userId | 36 | this.hostUserId = '';//主持人的 第三方userId |
| 36 | this.rosters = {};//用户列表 | 37 | this.rosters = {};//用户列表 |
| 38 | + this.timerCounter=new TimerCounter();//计时器 | ||
| 37 | 39 | ||
| 38 | // Ape Models | 40 | // Ape Models |
| 39 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); | 41 | this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); |
| @@ -55,11 +57,11 @@ class ConferApe extends Ape { | @@ -55,11 +57,11 @@ class ConferApe extends Ape { | ||
| 55 | this.on(pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理 | 57 | this.on(pdu.RCPDU_CONFERENCE_SEND_DATA_REQUEST, this.conferMsgComingHandler.bind(this));//这个是会议消息类型,flash里在使用这里不再使用,各个模块的消息由模块自己来处理 |
| 56 | } | 58 | } |
| 57 | 59 | ||
| 58 | - | ||
| 59 | //加入会议 | 60 | //加入会议 |
| 60 | _joinSessionHandler(_data) { | 61 | _joinSessionHandler(_data) { |
| 61 | let nodeInfoRecordPdu = this.mcu.mcuClassInfo.self; | 62 | let nodeInfoRecordPdu = this.mcu.mcuClassInfo.self; |
| 62 | - loger.log("_joinSessionHandler nodeInfoRecordPdu=",nodeInfoRecordPdu); | 63 | + loger.log("_joinSessionHandler nodeInfoRecordPdu="); |
| 64 | + console.log(nodeInfoRecordPdu); | ||
| 63 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; | 65 | let userDataPdu = new pdu['RCNodeInfoUserDataPdu']; |
| 64 | userDataPdu.qq = ''; | 66 | userDataPdu.qq = ''; |
| 65 | userDataPdu.skype = ''; | 67 | userDataPdu.skype = ''; |
| @@ -104,7 +106,7 @@ class ConferApe extends Ape { | @@ -104,7 +106,7 @@ class ConferApe extends Ape { | ||
| 104 | // to, message | 106 | // to, message |
| 105 | loger.log('发送会议消息.', _messageInfo); | 107 | loger.log('发送会议消息.', _messageInfo); |
| 106 | 108 | ||
| 107 | -/* message RCConferenceSendDataRequestPdu { | 109 | + /* message RCConferenceSendDataRequestPdu { |
| 108 | optional uint32 initiator = 1; | 110 | optional uint32 initiator = 1; |
| 109 | optional uint32 peer = 2; | 111 | optional uint32 peer = 2; |
| 110 | required bool is_public = 3; | 112 | required bool is_public = 3; |
| @@ -170,6 +172,7 @@ class ConferApe extends Ape { | @@ -170,6 +172,7 @@ class ConferApe extends Ape { | ||
| 170 | 172 | ||
| 171 | //还原课堂状态 | 173 | //还原课堂状态 |
| 172 | restorClass(){ | 174 | restorClass(){ |
| 175 | + GlobalConfig.classTimestamp=0; | ||
| 173 | GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_WAIT; | 176 | GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_WAIT; |
| 174 | GlobalConfig.classStopTime=EngineUtils.creatTimestampStr(); | 177 | GlobalConfig.classStopTime=EngineUtils.creatTimestampStr(); |
| 175 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); | 178 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); |
| @@ -189,6 +192,9 @@ class ConferApe extends Ape { | @@ -189,6 +192,9 @@ class ConferApe extends Ape { | ||
| 189 | //_param.actionType=ACTION_TYPE_1; | 192 | //_param.actionType=ACTION_TYPE_1; |
| 190 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); | 193 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); |
| 191 | this.sendUpdaterClassStatusInfo({"actionType":1}); | 194 | this.sendUpdaterClassStatusInfo({"actionType":1}); |
| 195 | + | ||
| 196 | + //开始计时 | ||
| 197 | + this.startTimerCounter(); | ||
| 192 | } | 198 | } |
| 193 | //暂停上课 | 199 | //暂停上课 |
| 194 | pauseClass(_param){ | 200 | pauseClass(_param){ |
| @@ -202,6 +208,7 @@ class ConferApe extends Ape { | @@ -202,6 +208,7 @@ class ConferApe extends Ape { | ||
| 202 | //_param.actionType=ACTION_TYPE_2; | 208 | //_param.actionType=ACTION_TYPE_2; |
| 203 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); | 209 | this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); |
| 204 | this.sendUpdaterClassStatusInfo({"actionType":2}); | 210 | this.sendUpdaterClassStatusInfo({"actionType":2}); |
| 211 | + this.stopTimerCounter(); | ||
| 205 | } | 212 | } |
| 206 | //关闭课堂 | 213 | //关闭课堂 |
| 207 | closeClass(_param){ | 214 | closeClass(_param){ |
| @@ -210,8 +217,8 @@ class ConferApe extends Ape { | @@ -210,8 +217,8 @@ class ConferApe extends Ape { | ||
| 210 | return; | 217 | return; |
| 211 | } | 218 | } |
| 212 | 219 | ||
| 220 | + this.stopTimerCounter(); | ||
| 213 | this.restorClass(); | 221 | this.restorClass(); |
| 214 | - | ||
| 215 | //把所有人都踢出课堂 | 222 | //把所有人都踢出课堂 |
| 216 | this.sendConferMsg({"to":0,"message":"所有人退出会议","actionType":ApeConsts.CLASS_ACTION_CLOSE_ALL}); | 223 | this.sendConferMsg({"to":0,"message":"所有人退出会议","actionType":ApeConsts.CLASS_ACTION_CLOSE_ALL}); |
| 217 | } | 224 | } |
| @@ -219,7 +226,7 @@ class ConferApe extends Ape { | @@ -219,7 +226,7 @@ class ConferApe extends Ape { | ||
| 219 | 226 | ||
| 220 | //更新会议信息 | 227 | //更新会议信息 |
| 221 | sendUpdaterClassStatusInfo(_param){ | 228 | sendUpdaterClassStatusInfo(_param){ |
| 222 | - loger.log('sendUpdaterClassStatusInfo---1-------'); | 229 | + loger.log('sendUpdaterClassStatusInfo'); |
| 223 | if(_param==null||EngineUtils.isEmptyObject(_param)){ | 230 | if(_param==null||EngineUtils.isEmptyObject(_param)){ |
| 224 | loger.log('sendUpdaterClassStatusInfo,参数错误'); | 231 | loger.log('sendUpdaterClassStatusInfo,参数错误'); |
| 225 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 232 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -227,7 +234,7 @@ class ConferApe extends Ape { | @@ -227,7 +234,7 @@ class ConferApe extends Ape { | ||
| 227 | } | 234 | } |
| 228 | itemIdx=ApeConsts.CONFERENCE_OBJ_TABLE_ID;// itemIdx=_param.itemIdx; | 235 | itemIdx=ApeConsts.CONFERENCE_OBJ_TABLE_ID;// itemIdx=_param.itemIdx; |
| 229 | let modelPdu = this.packPdu(_param,itemIdx); | 236 | let modelPdu = this.packPdu(_param,itemIdx); |
| 230 | - loger.log('sendUpdaterClassStatusInfo----2------'); | 237 | + //loger.log('sendUpdaterClassStatusInfo----2------'); |
| 231 | console.log(modelPdu); | 238 | console.log(modelPdu); |
| 232 | 239 | ||
| 233 | if(modelPdu==null){ | 240 | if(modelPdu==null){ |
| @@ -269,80 +276,57 @@ class ConferApe extends Ape { | @@ -269,80 +276,57 @@ class ConferApe extends Ape { | ||
| 269 | this.sendUniform(adapterPdu,true); | 276 | this.sendUniform(adapterPdu,true); |
| 270 | } | 277 | } |
| 271 | 278 | ||
| 272 | - /* //更新会议状态 | ||
| 273 | - sendUpdaterClassStatus(_param){ | ||
| 274 | - loger.log('sendUpdaterClassStatus----------'); | ||
| 275 | - if(_param==null||EngineUtils.isEmptyObject(_param)){ | ||
| 276 | - loger.log('sendUpdaterClassStatusInfo,参数错误'); | ||
| 277 | - this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | ||
| 278 | - return ; | ||
| 279 | - } | ||
| 280 | - itemIdx=_param.itemIdx; | ||
| 281 | - let modelPdu = this.packPdu(_param,itemIdx); | ||
| 282 | - console.log(modelPdu); | ||
| 283 | - | ||
| 284 | - if(modelPdu==null){ | ||
| 285 | - loger.log('sendUpdaterClassStatusInfo,参数错误'); | ||
| 286 | - this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | ||
| 287 | - return ; | ||
| 288 | - } | ||
| 289 | - | ||
| 290 | - let tableItemPdu = new pdu['RCRegistryTableItemPdu']; | ||
| 291 | - tableItemPdu.itemIdx=itemIdx; | ||
| 292 | - tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定 | ||
| 293 | - tableItemPdu.registerObjId=ApeConsts.CONFERENCE_OBJ_TABLE_ID; | ||
| 294 | - tableItemPdu.itemData =modelPdu.toArrayBuffer(); | ||
| 295 | - | ||
| 296 | - | ||
| 297 | - //updater | ||
| 298 | - let tableUpdateItem = new pdu['RCRegistryTableUpdateItemPdu']; | ||
| 299 | - //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU]; | ||
| 300 | - //repeated RCRegistryTableItemPdu items = 2; | ||
| 301 | - tableUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;// | ||
| 302 | - tableUpdateItem.items.push(tableItemPdu); | ||
| 303 | - | ||
| 304 | - | ||
| 305 | - let updateObjPdu = new pdu['RCRegistryUpdateObjPdu']; | ||
| 306 | - updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_TABLE_ID; | ||
| 307 | - updateObjPdu.subType = tableUpdateItem.type; | ||
| 308 | - updateObjPdu.userData = tableUpdateItem.toArrayBuffer(); | ||
| 309 | - | ||
| 310 | - //同步 | ||
| 311 | - let adapterItemPdu = new pdu['RCAdapterItemPdu']; | ||
| 312 | - adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ; | ||
| 313 | - adapterItemPdu.itemData = updateObjPdu.toArrayBuffer(); | ||
| 314 | - | ||
| 315 | - let adapterPdu = new pdu['RCAdapterPdu']; | ||
| 316 | - adapterPdu.type = pdu.RCPDU_REG_ADAPTER; | ||
| 317 | - adapterPdu.item.push(adapterItemPdu); | ||
| 318 | - | ||
| 319 | - console.log("会议发送更新数据111============"); | ||
| 320 | - this.sendUniform(adapterPdu,true); | ||
| 321 | - }*/ | ||
| 322 | - | ||
| 323 | 279 | ||
| 324 | /////收到消息处理///////////////////////////////////////////////////////////////////////////////// | 280 | /////收到消息处理///////////////////////////////////////////////////////////////////////////////// |
| 281 | + //加入channel成功 | ||
| 325 | onJoinChannelHandlerSuccess(){ | 282 | onJoinChannelHandlerSuccess(){ |
| 326 | loger.log('ConferApe onJoinChannelHandlerSuccess'); | 283 | loger.log('ConferApe onJoinChannelHandlerSuccess'); |
| 327 | - //if(GlobalConfig.isHost){ | ||
| 328 | - // if(GlobalConfig.classStatus==ApeConsts.CLASS_STATUS_WAIT){ | ||
| 329 | - // GlobalConfig.classStartTime=EngineUtils.creatTimestampStr(); | ||
| 330 | - // GlobalConfig.classStopTime=GlobalConfig.classStartTime; | ||
| 331 | - // }else{ | ||
| 332 | - // GlobalConfig.classStopTime=GlobalConfig.creatTimestampStr; | ||
| 333 | - // } | ||
| 334 | - // | ||
| 335 | - // GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_STARTED; | ||
| 336 | - // //_param.actionType=ACTION_TYPE_1; | ||
| 337 | - // this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); | ||
| 338 | - // this.sendUpdaterClassStatusInfo(_param); | ||
| 339 | - //} | 284 | + this.timerCounter.addTimerCallBack(this.timerCounterUptate.bind(this),1); |
| 285 | + //如果当前会议正在进行中,开启计时器 | ||
| 286 | + if(GlobalConfig.classStatus==ApeConsts.CLASS_STATUS_STARTED){ | ||
| 287 | + //开始计时 | ||
| 288 | + this.startTimerCounter(); | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + //开启计时器 | ||
| 292 | + startTimerCounter(){ | ||
| 293 | + this.timerCounter.startTimer(); | ||
| 294 | + } | ||
| 295 | + //停止计时器 | ||
| 296 | + stopTimerCounter(){ | ||
| 297 | + this.timerCounter.stopTimer(); | ||
| 298 | + } | ||
| 299 | + timerCounterUptate(){ | ||
| 300 | + if(!this.mcu.connected){ | ||
| 301 | + loger.warn('MCU 连接已经断开'); | ||
| 302 | + this.stopTimerCounter(); | ||
| 303 | + } | ||
| 304 | + //如果还没开始或已经暂停、关闭,不做计时处理 | ||
| 305 | + if(GlobalConfig.classStatus!=ApeConsts.CLASS_STATUS_STARTED){ | ||
| 306 | + loger.warn('当前课堂已经暂停或者未开始,不计时',"classStatus-->",GlobalConfig.classStatus); | ||
| 307 | + return; | ||
| 308 | + } | ||
| 309 | + GlobalConfig.classTimestamp=GlobalConfig.classTimestamp+1;//计时 | ||
| 310 | + loger.log('课堂进行时间',GlobalConfig.classTimestamp); | ||
| 311 | + this._emit(MessageTypes.CLASS_UPDATE_TIMER,{"classTimestamp":GlobalConfig.classTimestamp}); | ||
| 312 | + | ||
| 313 | + if(GlobalConfig.classTimestamp%GlobalConfig.updateClassInfoDelay==0){ | ||
| 314 | + //如果是host身份,需要同步时间给其他人,同时把当前的状态上传到服务器 | ||
| 315 | + if(GlobalConfig.isHost){ | ||
| 316 | + //保存数据到Sass | ||
| 317 | + this._emit(MessageTypes.CLASS_STATUS_INFO_CHANGE); | ||
| 318 | + | ||
| 319 | + //同步消息给其他人 | ||
| 320 | + this.sendUpdaterClassStatusInfo({"actionType":1}); | ||
| 321 | + } | ||
| 322 | + } | ||
| 340 | } | 323 | } |
| 341 | 324 | ||
| 342 | tableUpdateHandler(owner, itemIdx, itemData) { | 325 | tableUpdateHandler(owner, itemIdx, itemData) { |
| 343 | try { | 326 | try { |
| 344 | let model=this.unPackPdu(owner, itemIdx,itemData); | 327 | let model=this.unPackPdu(owner, itemIdx,itemData); |
| 345 | - loger.log('tableUpdateHandler',model); | 328 | + loger.log('tableUpdateHandler'); |
| 329 | + console.log(model); | ||
| 346 | 330 | ||
| 347 | //处理会议更新的信息 | 331 | //处理会议更新的信息 |
| 348 | if(model&&model.classStatusInfo){ | 332 | if(model&&model.classStatusInfo){ |
| @@ -351,36 +335,20 @@ class ConferApe extends Ape { | @@ -351,36 +335,20 @@ class ConferApe extends Ape { | ||
| 351 | //通知应用层更新会议状态 | 335 | //通知应用层更新会议状态 |
| 352 | this._emit(MessageTypes.CLASS_UPTATE_STATUS,GlobalConfig.classStatusInfo); | 336 | this._emit(MessageTypes.CLASS_UPTATE_STATUS,GlobalConfig.classStatusInfo); |
| 353 | 337 | ||
| 354 | - //_confer_ape.on(MessageTypes.CLASS_CLOSE, this._doClassClose.bind(this));//会议关闭,所有人都退出 | ||
| 355 | - /*{ | ||
| 356 | - "itemIdx": 720899, | ||
| 357 | - "from": 161770995, | ||
| 358 | - "owner": 161770995, | ||
| 359 | - "actionType": null, | ||
| 360 | - "classStatusInfo": { | ||
| 361 | - "nodeId": 161770995, | ||
| 362 | - "userId": "0", | ||
| 363 | - "userName": "mcuTest1487161768", | ||
| 364 | - "siteId": "h5test", | ||
| 365 | - "classId": 1730033559, | ||
| 366 | - "className": "mcuClient", | ||
| 367 | - "classType": 1, | ||
| 368 | - "classStatus": 0, | ||
| 369 | - "classStartTime": "2017-2-15-20-30-11", | ||
| 370 | - "classStopTime": "2017-2-15-20-30-28", | ||
| 371 | - "classTimestamp": 0, | ||
| 372 | - "classBeginTime": "2017-02-13 10:00:00", | ||
| 373 | - "classEndTime": "2017-02-22 12:00:00", | ||
| 374 | - "recordStatus": false, | ||
| 375 | - "recordTimestamp": 0, | ||
| 376 | - "recordFileName": "", | ||
| 377 | - "recordDownloadUrl": "xxxxxxxxxxxxxxxxxxxxx", | ||
| 378 | - "serverTimestamp": 161828290, | ||
| 379 | - "activeDocId": 0, | ||
| 380 | - "activeDocCurPage": 1 | 338 | + //如果MCU已经断开连接,停止计时器 |
| 339 | + if(!this.mcu.connected){ | ||
| 340 | + //停止计时 | ||
| 341 | + this.stopTimerCounter(); | ||
| 342 | + return; | ||
| 381 | } | 343 | } |
| 382 | - }*/ | ||
| 383 | 344 | ||
| 345 | + if(GlobalConfig.classStatus==ApeConsts.CLASS_STATUS_STARTED){ | ||
| 346 | + //如果会议在进行中,开始计时器 | ||
| 347 | + this.startTimerCounter(); | ||
| 348 | + }else { | ||
| 349 | + //停止计时 | ||
| 350 | + this.stopTimerCounter(); | ||
| 351 | + } | ||
| 384 | } catch (e) { | 352 | } catch (e) { |
| 385 | loger.warn('ConferApe table update got exception. itemIdx',itemIdx); | 353 | loger.warn('ConferApe table update got exception. itemIdx',itemIdx); |
| 386 | } | 354 | } |
| @@ -499,28 +467,6 @@ class ConferApe extends Ape { | @@ -499,28 +467,6 @@ class ConferApe extends Ape { | ||
| 499 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 467 | this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 500 | return null; | 468 | return null; |
| 501 | } | 469 | } |
| 502 | - | ||
| 503 | - /* message RCClassStatusInfoPdu { | ||
| 504 | - optional uint32 node_id=1;//mcu中的唯一ID | ||
| 505 | - optional uint32 user_id=2; | ||
| 506 | - optional uint32 user_name=3; | ||
| 507 | - optional uint32 site_id=4;//站点号 | ||
| 508 | - optional uint32 class_id=5; | ||
| 509 | - optional uint32 class_name=6; | ||
| 510 | - required uint32 class_type=7;//课堂类型 | ||
| 511 | - required uint32 class_status=9;//课堂的状态 | ||
| 512 | - optional uint32 class_startTime=10;//课堂点击开始时间 | ||
| 513 | - optional uint32 class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳 | ||
| 514 | - optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳 | ||
| 515 | - optional uint32 class_beginTime=13;//课堂创建的时间,这个是Sass返回的 | ||
| 516 | - optional uint32 class_endTime=14;//课堂结束的时间,这个是Sass返回的 | ||
| 517 | - optional uint32 record_status=15;//当前录制状态 | ||
| 518 | - optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳 | ||
| 519 | - optional uint32 record_fileName=17;//录制的文件名 | ||
| 520 | - optional uint32 record_downloadUrl=18;//下载地址 | ||
| 521 | - optional uint32 server_timestamp=19;//当前的系统时间戳 | ||
| 522 | - }*/ | ||
| 523 | - | ||
| 524 | let classStatusInfo=new pdu['RCClassStatusInfoPdu']; | 470 | let classStatusInfo=new pdu['RCClassStatusInfoPdu']; |
| 525 | classStatusInfo.nodeId=GlobalConfig.nodeId;//mcu中的唯一ID | 471 | classStatusInfo.nodeId=GlobalConfig.nodeId;//mcu中的唯一ID |
| 526 | classStatusInfo.userId=GlobalConfig.userId; | 472 | classStatusInfo.userId=GlobalConfig.userId; |
| @@ -53,6 +53,11 @@ class VideoApe extends Ape { | @@ -53,6 +53,11 @@ class VideoApe extends Ape { | ||
| 53 | 53 | ||
| 54 | //推流 | 54 | //推流 |
| 55 | publishVideo(_param) { | 55 | publishVideo(_param) { |
| 56 | + if(!this.mcu.connected){ | ||
| 57 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 58 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 59 | + } | ||
| 60 | + | ||
| 56 | if (_param == null||_param.channelId == null|| | 61 | if (_param == null||_param.channelId == null|| |
| 57 | _param.classId == null||_param.userId == null|| | 62 | _param.classId == null||_param.userId == null|| |
| 58 | _param.siteId == null|| _param.timestamp==null) | 63 | _param.siteId == null|| _param.timestamp==null) |
| @@ -98,6 +103,11 @@ class VideoApe extends Ape { | @@ -98,6 +103,11 @@ class VideoApe extends Ape { | ||
| 98 | 103 | ||
| 99 | //停止推流, | 104 | //停止推流, |
| 100 | stopPublishVideo(_param) { | 105 | stopPublishVideo(_param) { |
| 106 | + if(!this.mcu.connected){ | ||
| 107 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 108 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 109 | + } | ||
| 110 | + | ||
| 101 | loger.log('stopPublishVideo -> maxVideoChannels', GlobalConfig.maxVideoChannels); | 111 | loger.log('stopPublishVideo -> maxVideoChannels', GlobalConfig.maxVideoChannels); |
| 102 | //_param如果为空,那么默认就是当前自己的nodeId,否则用_param | 112 | //_param如果为空,那么默认就是当前自己的nodeId,否则用_param |
| 103 | let nodeId; | 113 | let nodeId; |
| @@ -124,7 +134,12 @@ class VideoApe extends Ape { | @@ -124,7 +134,12 @@ class VideoApe extends Ape { | ||
| 124 | this.sendTableUpdateHandler(channelInfo); | 134 | this.sendTableUpdateHandler(channelInfo); |
| 125 | } | 135 | } |
| 126 | 136 | ||
| 127 | - sendVideoCommandMsg(_param) { | 137 | + sendVideoBroadcastMsg(_param) { |
| 138 | + if(!this.mcu.connected){ | ||
| 139 | + loger.warn(GlobalConfig.getCurrentStatus()); | ||
| 140 | + return {"code": ApeConsts.RETURN_FAILED, "data": "已经断开连接"}; | ||
| 141 | + } | ||
| 142 | + | ||
| 128 | if (this._classInfo === null || EngineUtils.isEmptyObject(this._classInfo)) { | 143 | if (this._classInfo === null || EngineUtils.isEmptyObject(this._classInfo)) { |
| 129 | loger.log('不能发送Video消息.McuClient还未初始化数据!'); | 144 | loger.log('不能发送Video消息.McuClient还未初始化数据!'); |
| 130 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { | 145 | if (GlobalConfig.getCurrentStatus().code == 0 || GlobalConfig.getCurrentStatus().code == 1) { |
| @@ -237,7 +252,8 @@ class VideoApe extends Ape { | @@ -237,7 +252,8 @@ class VideoApe extends Ape { | ||
| 237 | return; | 252 | return; |
| 238 | } | 253 | } |
| 239 | videoReceivePdu.data = this._rCArrayBufferUtil.uint8ArrayToStr(videoReceivePdu.data, 2);//开头两个字会乱码 | 254 | videoReceivePdu.data = this._rCArrayBufferUtil.uint8ArrayToStr(videoReceivePdu.data, 2);//开头两个字会乱码 |
| 240 | - loger.log('视频消息处理 receiveVideoCommandHandler.', videoReceivePdu); | 255 | + loger.log('视频消息处理 receiveVideoCommandHandler.'); |
| 256 | + console.log(videoReceivePdu); | ||
| 241 | 257 | ||
| 242 | //判断接收者的id,如果不是0,并且也不是自己的nodeId,那么消息不做处理 | 258 | //判断接收者的id,如果不是0,并且也不是自己的nodeId,那么消息不做处理 |
| 243 | if (videoReceivePdu.toNodeId != 0 && videoReceivePdu.toNodeId != GlobalConfig.nodeId) { | 259 | if (videoReceivePdu.toNodeId != 0 && videoReceivePdu.toNodeId != GlobalConfig.nodeId) { |
| @@ -23,6 +23,7 @@ class MCU extends Emiter { | @@ -23,6 +23,7 @@ class MCU extends Emiter { | ||
| 23 | this._everSocket = everSocket; | 23 | this._everSocket = everSocket; |
| 24 | this._everSocket.on(everSocket.OPEN, this._everSocketOpenHandler.bind(this)); | 24 | this._everSocket.on(everSocket.OPEN, this._everSocketOpenHandler.bind(this)); |
| 25 | this._everSocket.on(everSocket.MESSAGE, this._everSocketMsgReceivedHandler.bind(this)); | 25 | this._everSocket.on(everSocket.MESSAGE, this._everSocketMsgReceivedHandler.bind(this)); |
| 26 | + this._everSocket.on(everSocket.CLOSED, this._everSocketCloseHandler.bind(this)); | ||
| 26 | } | 27 | } |
| 27 | 28 | ||
| 28 | // 注册Ape | 29 | // 注册Ape |
| @@ -34,12 +35,18 @@ class MCU extends Emiter { | @@ -34,12 +35,18 @@ class MCU extends Emiter { | ||
| 34 | _everSocketOpenHandler() { | 35 | _everSocketOpenHandler() { |
| 35 | this._sendJoinClassRequest(); | 36 | this._sendJoinClassRequest(); |
| 36 | } | 37 | } |
| 38 | + // EverSocket连接断开 | ||
| 39 | + _everSocketCloseHandler() { | ||
| 40 | + GlobalConfig.setCurrentStatus(GlobalConfig.statusCode_3); | ||
| 41 | + this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_SOCKET_DISCONNECT); | ||
| 42 | + } | ||
| 43 | + | ||
| 37 | 44 | ||
| 38 | //MCU-发送加入会议请求 | 45 | //MCU-发送加入会议请求 |
| 39 | _sendJoinClassRequest(){ | 46 | _sendJoinClassRequest(){ |
| 40 | //const classInfo = this.classInfo; | 47 | //const classInfo = this.classInfo; |
| 41 | - loger.log('MCU-发送加入会议请求.',this.classInfo); | ||
| 42 | - | 48 | + loger.log('MCU-发送加入会议请求.'); |
| 49 | + console.log(this.classInfo); | ||
| 43 | var descriptorPdu = new pdu['RCConferenceDescriptorPdu']; | 50 | var descriptorPdu = new pdu['RCConferenceDescriptorPdu']; |
| 44 | descriptorPdu.id = this.classInfo.classId; | 51 | descriptorPdu.id = this.classInfo.classId; |
| 45 | descriptorPdu.name = this.classInfo.className||""; | 52 | descriptorPdu.name = this.classInfo.className||""; |
| @@ -123,7 +130,7 @@ class MCU extends Emiter { | @@ -123,7 +130,7 @@ class MCU extends Emiter { | ||
| 123 | 130 | ||
| 124 | _updateMCUConfInfoDescription(_data) { | 131 | _updateMCUConfInfoDescription(_data) { |
| 125 | // let _mcuConfDesc=new pdu['RCConferenceDescriptorPdu'].decode(mcuConfDesc); | 132 | // let _mcuConfDesc=new pdu['RCConferenceDescriptorPdu'].decode(mcuConfDesc); |
| 126 | - loger.log('_updateMCUConfInfoDescription.', _data); | 133 | + loger.log('_updateMCUConfInfoDescription.'); |
| 127 | //let classDescription=new pdu['RCConferenceDescriptorPdu'].decode(_data); | 134 | //let classDescription=new pdu['RCConferenceDescriptorPdu'].decode(_data); |
| 128 | console.log(_data); | 135 | console.log(_data); |
| 129 | //let info = this.mcuClassInfo.info; | 136 | //let info = this.mcuClassInfo.info; |
| @@ -162,7 +169,8 @@ class MCU extends Emiter { | @@ -162,7 +169,8 @@ class MCU extends Emiter { | ||
| 162 | 169 | ||
| 163 | // 主动建立MCU连接 | 170 | // 主动建立MCU连接 |
| 164 | joinMCU(_classInfo) { | 171 | joinMCU(_classInfo) { |
| 165 | - loger.log('开始建立EverSocket通道.', _classInfo); | 172 | + loger.log('开始建立EverSocket通道.'); |
| 173 | + console.log(_classInfo); | ||
| 166 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 | 174 | _classInfo.classId = parseInt(_classInfo.classId); // classId 必须整形 |
| 167 | this.classInfo = _classInfo; | 175 | this.classInfo = _classInfo; |
| 168 | // 创建刷新nodeId | 176 | // 创建刷新nodeId |
-
请 注册 或 登录 后发表评论