正在显示
3 个修改的文件
包含
10 行增加
和
18 行删除
| @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil'; | @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil'; | ||
| 26 | import UTF8 from 'utf-8'; | 26 | import UTF8 from 'utf-8'; |
| 27 | 27 | ||
| 28 | let loger = Loger.getLoger('MessageEntrance'); | 28 | let loger = Loger.getLoger('MessageEntrance'); |
| 29 | -let _sdkInfo = {"version": "v.1.9.0.20170411", "author": "www.3mang.com"}; | 29 | +let _sdkInfo = {"version": "v.1.9.1.20170411", "author": "www.3mang.com"}; |
| 30 | 30 | ||
| 31 | //APE | 31 | //APE |
| 32 | let _sass; | 32 | let _sass; |
| @@ -70,7 +70,6 @@ export default class MessageEntrance extends Emiter { | @@ -70,7 +70,6 @@ export default class MessageEntrance extends Emiter { | ||
| 70 | _serverCheck = ServerCheck; | 70 | _serverCheck = ServerCheck; |
| 71 | _serverCheck.on(_serverCheck.SEVER_CHECK_BEST_IP_SUCCESS, this._serverCheckBestIpSuccessHandler.bind(this));//ip选点,获取最佳ip完成 | 71 | _serverCheck.on(_serverCheck.SEVER_CHECK_BEST_IP_SUCCESS, this._serverCheckBestIpSuccessHandler.bind(this));//ip选点,获取最佳ip完成 |
| 72 | 72 | ||
| 73 | - | ||
| 74 | // 底层MCU消息层 | 73 | // 底层MCU消息层 |
| 75 | _mcu = Mcu; | 74 | _mcu = Mcu; |
| 76 | _mcu.on('*', (type, data) => this._emit(type, data)); | 75 | _mcu.on('*', (type, data) => this._emit(type, data)); |
| @@ -194,12 +193,7 @@ export default class MessageEntrance extends Emiter { | @@ -194,12 +193,7 @@ export default class MessageEntrance extends Emiter { | ||
| 194 | let option = _option || ""; | 193 | let option = _option || ""; |
| 195 | let errorMessage = {"code": _data, "reson": MessageTypes.ErrorReson[_data] + " " + option}; | 194 | let errorMessage = {"code": _data, "reson": MessageTypes.ErrorReson[_data] + " " + option}; |
| 196 | loger.error("MCU_ERROR", errorMessage); | 195 | loger.error("MCU_ERROR", errorMessage); |
| 197 | - | ||
| 198 | this._emit(MessageTypes.ERROR_EVENT, errorMessage); | 196 | this._emit(MessageTypes.ERROR_EVENT, errorMessage); |
| 199 | - | ||
| 200 | - /* if (_mcuErrorCallBackFun) { | ||
| 201 | - _mcuErrorCallBackFun(errorMessage); | ||
| 202 | - }*/ | ||
| 203 | } | 197 | } |
| 204 | 198 | ||
| 205 | //获取当前的状态 | 199 | //获取当前的状态 |
| @@ -813,7 +807,7 @@ export default class MessageEntrance extends Emiter { | @@ -813,7 +807,7 @@ export default class MessageEntrance extends Emiter { | ||
| 813 | _publishVideo(_param) { | 807 | _publishVideo(_param) { |
| 814 | if (!_mcu.connected) { | 808 | if (!_mcu.connected) { |
| 815 | loger.warn(GlobalConfig.getCurrentStatus()); | 809 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 816 | - return; | 810 | + return {"code":ApeConsts.RETURN_FAILED, "data":""}; |
| 817 | } | 811 | } |
| 818 | if (_video_ape) { | 812 | if (_video_ape) { |
| 819 | return _video_ape.publishVideo(_param); | 813 | return _video_ape.publishVideo(_param); |
| @@ -823,7 +817,7 @@ export default class MessageEntrance extends Emiter { | @@ -823,7 +817,7 @@ export default class MessageEntrance extends Emiter { | ||
| 823 | _stopPublishVideo(_param) { | 817 | _stopPublishVideo(_param) { |
| 824 | if (!_mcu.connected) { | 818 | if (!_mcu.connected) { |
| 825 | loger.warn(GlobalConfig.getCurrentStatus()); | 819 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 826 | - return; | 820 | + return {"code":ApeConsts.RETURN_FAILED, "data":""}; |
| 827 | } | 821 | } |
| 828 | if (_video_ape) { | 822 | if (_video_ape) { |
| 829 | return _video_ape.stopPublishVideo(_param); | 823 | return _video_ape.stopPublishVideo(_param); |
| @@ -841,7 +835,7 @@ export default class MessageEntrance extends Emiter { | @@ -841,7 +835,7 @@ export default class MessageEntrance extends Emiter { | ||
| 841 | sendAudioCommandMsg(_param) { | 835 | sendAudioCommandMsg(_param) { |
| 842 | if (!_mcu.connected) { | 836 | if (!_mcu.connected) { |
| 843 | loger.warn(GlobalConfig.getCurrentStatus()); | 837 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 844 | - return; | 838 | + return {"code":ApeConsts.RETURN_FAILED, "data":""}; |
| 845 | } | 839 | } |
| 846 | if (_audio_ape) { | 840 | if (_audio_ape) { |
| 847 | return _audio_ape.sendAudioBroadcastMsg(_param); | 841 | return _audio_ape.sendAudioBroadcastMsg(_param); |
| @@ -869,7 +863,7 @@ export default class MessageEntrance extends Emiter { | @@ -869,7 +863,7 @@ export default class MessageEntrance extends Emiter { | ||
| 869 | _publishAudio(_param) { | 863 | _publishAudio(_param) { |
| 870 | if (!_mcu.connected) { | 864 | if (!_mcu.connected) { |
| 871 | loger.warn(GlobalConfig.getCurrentStatus()); | 865 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 872 | - return; | 866 | + return {"code":ApeConsts.RETURN_FAILED, "data":""}; |
| 873 | } | 867 | } |
| 874 | if (_audio_ape) { | 868 | if (_audio_ape) { |
| 875 | return _audio_ape.publishAudio(_param); | 869 | return _audio_ape.publishAudio(_param); |
| @@ -879,7 +873,7 @@ export default class MessageEntrance extends Emiter { | @@ -879,7 +873,7 @@ export default class MessageEntrance extends Emiter { | ||
| 879 | _stopPublishAudio(_param) { | 873 | _stopPublishAudio(_param) { |
| 880 | if (!_mcu.connected) { | 874 | if (!_mcu.connected) { |
| 881 | loger.warn(GlobalConfig.getCurrentStatus()); | 875 | loger.warn(GlobalConfig.getCurrentStatus()); |
| 882 | - return; | 876 | + return {"code":ApeConsts.RETURN_FAILED, "data":""}; |
| 883 | } | 877 | } |
| 884 | if (_audio_ape) { | 878 | if (_audio_ape) { |
| 885 | return _audio_ape.stopPublishAudio(_param); | 879 | return _audio_ape.stopPublishAudio(_param); |
| 1 | //对外暴露的对象 | 1 | //对外暴露的对象 |
| 2 | - | ||
| 3 | - | ||
| 4 | import EngineEntrance from 'EngineEntrance'; | 2 | import EngineEntrance from 'EngineEntrance'; |
| 5 | -import MessageTypes from 'MessageTypes'; | 3 | +//import MessageTypes from 'MessageTypes'; |
| 6 | 4 | ||
| 7 | const MCU_CLIENT=new EngineEntrance();//入口文件 | 5 | const MCU_CLIENT=new EngineEntrance();//入口文件 |
| 8 | 6 | ||
| @@ -11,4 +9,4 @@ export function createMcuClient() { | @@ -11,4 +9,4 @@ export function createMcuClient() { | ||
| 11 | } | 9 | } |
| 12 | 10 | ||
| 13 | //监听是事件名和异常定义 | 11 | //监听是事件名和异常定义 |
| 14 | -export {MessageTypes}; | 12 | +//export {MessageTypes}; |
| @@ -596,7 +596,7 @@ class ConferApe extends Ape { | @@ -596,7 +596,7 @@ class ConferApe extends Ape { | ||
| 596 | //踢出用户 | 596 | //踢出用户 |
| 597 | kickOutRoster() { | 597 | kickOutRoster() { |
| 598 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_KICK_OUT); | 598 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_CLASS_KICK_OUT); |
| 599 | - this._emit(MessageTypes.CLASS_EXIT); | 599 | + this._emit(MessageTypes.CLASS_EXIT,{'type':1}); |
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | //视频模块发生更新,人员状态需要更新 | 602 | //视频模块发生更新,人员状态需要更新 |
| @@ -614,7 +614,7 @@ class ConferApe extends Ape { | @@ -614,7 +614,7 @@ class ConferApe extends Ape { | ||
| 614 | if (GlobalConfig.nodeId == nodeId) { | 614 | if (GlobalConfig.nodeId == nodeId) { |
| 615 | loger.log("自己离开课堂"); | 615 | loger.log("自己离开课堂"); |
| 616 | // 自己退出 | 616 | // 自己退出 |
| 617 | - this._emit(MessageTypes.CLASS_EXIT); | 617 | + this._emit(MessageTypes.CLASS_EXIT,{'type':0}); |
| 618 | } else { | 618 | } else { |
| 619 | let user=this.rosters[nodeId]; | 619 | let user=this.rosters[nodeId]; |
| 620 | if(user){ | 620 | if(user){ |
-
请 注册 或 登录 后发表评论