正在显示
4 个修改的文件
包含
48 行增加
和
6 行删除
| @@ -116,16 +116,18 @@ export default class MessageEntrance extends Emiter { | @@ -116,16 +116,18 @@ export default class MessageEntrance extends Emiter { | ||
| 116 | this.sendChatMsg = this._sendChatMsg.bind(this); | 116 | this.sendChatMsg = this._sendChatMsg.bind(this); |
| 117 | 117 | ||
| 118 | //videoApe | 118 | //videoApe |
| 119 | - this.getVideoPlayPath = this._getVideoPlayPath.bind(this); | 119 | + //this.getVideoPlayPath = this._getVideoPlayPath.bind(this); |
| 120 | this.getVideoPublishPath = this._getVideoPublishPath.bind(this); | 120 | this.getVideoPublishPath = this._getVideoPublishPath.bind(this); |
| 121 | + this.getVideoAllChannelInfo = this._getVideoAllChannelInfo.bind(this); | ||
| 121 | this.publishVideo = this._publishVideo.bind(this); | 122 | this.publishVideo = this._publishVideo.bind(this); |
| 122 | this.stopPublishVideo = this._stopPublishVideo.bind(this); | 123 | this.stopPublishVideo = this._stopPublishVideo.bind(this); |
| 123 | this.sendVideoBroadcastMsg=this._sendVideoBroadcastMsg.bind(this); | 124 | this.sendVideoBroadcastMsg=this._sendVideoBroadcastMsg.bind(this); |
| 124 | 125 | ||
| 125 | 126 | ||
| 126 | //audioApe | 127 | //audioApe |
| 127 | - this.getAudioPlayPath = this._getPlayAudioPath.bind(this); | 128 | + //this.getAudioPlayPath = this._getPlayAudioPath.bind(this); |
| 128 | this.getAudioPublishPath = this._getPublishAudioPath.bind(this); | 129 | this.getAudioPublishPath = this._getPublishAudioPath.bind(this); |
| 130 | + this.getAudioAllChannelInfo = this._getAudioAllChannelInfo.bind(this); | ||
| 129 | this.publishAudio = this._publishAudio.bind(this); | 131 | this.publishAudio = this._publishAudio.bind(this); |
| 130 | this.stopPublishAudio = this._stopPublishAudio.bind(this); | 132 | this.stopPublishAudio = this._stopPublishAudio.bind(this); |
| 131 | this.sendAudioBroadcastMsg=this.sendAudioCommandMsg.bind(this); | 133 | this.sendAudioBroadcastMsg=this.sendAudioCommandMsg.bind(this); |
| @@ -138,9 +140,9 @@ export default class MessageEntrance extends Emiter { | @@ -138,9 +140,9 @@ export default class MessageEntrance extends Emiter { | ||
| 138 | this.sendGotoPrev = this._sendGotoPrev.bind(this); | 140 | this.sendGotoPrev = this._sendGotoPrev.bind(this); |
| 139 | 141 | ||
| 140 | //DocApe | 142 | //DocApe |
| 141 | - this.sendDocumentUpload = this._sendDocumentUpload.bind(this);;//上传文档 | ||
| 142 | - this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this);; //切换文档 | ||
| 143 | - this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);;//翻页 | 143 | + this.sendDocumentUpload = this._sendDocumentUpload.bind(this);//上传文档 |
| 144 | + this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this); //切换文档 | ||
| 145 | + this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);//翻页 | ||
| 144 | this.sendDocumentDelete = this._sassDeleteDocument.bind(this);;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu | 146 | this.sendDocumentDelete = this._sassDeleteDocument.bind(this);;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu |
| 145 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 | 147 | //this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档 |
| 146 | this.sendDocumentCommand = this._sendDocumentCommand.bind(this);;//操作文档(翻页、缩放、滚动...) | 148 | this.sendDocumentCommand = this._sendDocumentCommand.bind(this);;//操作文档(翻页、缩放、滚动...) |
| @@ -747,6 +749,11 @@ export default class MessageEntrance extends Emiter { | @@ -747,6 +749,11 @@ export default class MessageEntrance extends Emiter { | ||
| 747 | return _video_ape.getPublishVideoPath(_param); | 749 | return _video_ape.getPublishVideoPath(_param); |
| 748 | } | 750 | } |
| 749 | } | 751 | } |
| 752 | + _getVideoAllChannelInfo(_param){ | ||
| 753 | + if(_video_ape){ | ||
| 754 | + return _video_ape.getAllChannelInfo(_param); | ||
| 755 | + } | ||
| 756 | + } | ||
| 750 | 757 | ||
| 751 | _publishVideo(_param){ | 758 | _publishVideo(_param){ |
| 752 | if(!_mcu.connected){ | 759 | if(!_mcu.connected){ |
| @@ -797,7 +804,11 @@ export default class MessageEntrance extends Emiter { | @@ -797,7 +804,11 @@ export default class MessageEntrance extends Emiter { | ||
| 797 | return _audio_ape.getAudioPublishPath(_param); | 804 | return _audio_ape.getAudioPublishPath(_param); |
| 798 | } | 805 | } |
| 799 | } | 806 | } |
| 800 | - | 807 | + _getAudioAllChannelInfo(_param){ |
| 808 | + if(_audio_ape){ | ||
| 809 | + return _audio_ape.getAllChannelInfo(_param); | ||
| 810 | + } | ||
| 811 | + } | ||
| 801 | _publishAudio(_param){ | 812 | _publishAudio(_param){ |
| 802 | if(!_mcu.connected){ | 813 | if(!_mcu.connected){ |
| 803 | loger.warn(GlobalConfig.getCurrentStatus()); | 814 | loger.warn(GlobalConfig.getCurrentStatus()); |
| @@ -50,6 +50,12 @@ class AudioApe extends Ape { | @@ -50,6 +50,12 @@ class AudioApe extends Ape { | ||
| 50 | return this.mediaModule.getMediaPublishPath(_param); | 50 | return this.mediaModule.getMediaPublishPath(_param); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | + //获取当前所有频道信息 | ||
| 54 | + getAllChannelInfo(_param){ | ||
| 55 | + loger.log('getAllChannelInfo'); | ||
| 56 | + return this.mediaModule.getAllMediaChannelInfo(); | ||
| 57 | + } | ||
| 58 | + | ||
| 53 | //推流 | 59 | //推流 |
| 54 | publishAudio(_param) { | 60 | publishAudio(_param) { |
| 55 | if(!this.mcu.connected){ | 61 | if(!this.mcu.connected){ |
| @@ -296,6 +302,7 @@ class AudioApe extends Ape { | @@ -296,6 +302,7 @@ class AudioApe extends Ape { | ||
| 296 | if(owner==0){ | 302 | if(owner==0){ |
| 297 | loger.log("释放占用的频道,channel",itemIdx); | 303 | loger.log("释放占用的频道,channel",itemIdx); |
| 298 | unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; | 304 | unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; |
| 305 | + unpackChannelInfo.streamId=""; | ||
| 299 | } | 306 | } |
| 300 | 307 | ||
| 301 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; | 308 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; |
| @@ -138,6 +138,23 @@ class MediaModule { | @@ -138,6 +138,23 @@ class MediaModule { | ||
| 138 | return true; | 138 | return true; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | + //获取当前所有频道的信息 | ||
| 142 | + getAllMediaChannelInfo(){ | ||
| 143 | + let channels=[]; | ||
| 144 | + for (let key in this.mediaChannels){ | ||
| 145 | + let channel=this.mediaChannels[key]; | ||
| 146 | + if(channel){ | ||
| 147 | + channels.push({"mediaId":channel.channelId,"status":channel.status,"fromNodeId":channel.fromNodeId}); | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + if(channels.length<this.maxMediaChannel){ | ||
| 151 | + for (let i=channels.length;i<this.maxMediaChannel;i++){ | ||
| 152 | + let channelId=this.MEDIA_OBJ_TABLE_ID + (i); | ||
| 153 | + channels.push({"mediaId":channelId,"status":ApeConsts.CHANNEL_STATUS_RELEASED,"fromNodeId":0}); | ||
| 154 | + } | ||
| 155 | + } | ||
| 156 | + return channels; | ||
| 157 | + } | ||
| 141 | //获取默认的频道信息 | 158 | //获取默认的频道信息 |
| 142 | getDefaultChannelInfo(){ | 159 | getDefaultChannelInfo(){ |
| 143 | let channelInfo={}; | 160 | let channelInfo={}; |
| @@ -51,6 +51,12 @@ class VideoApe extends Ape { | @@ -51,6 +51,12 @@ class VideoApe extends Ape { | ||
| 51 | return this.mediaModule.getMediaPublishPath(_param); | 51 | return this.mediaModule.getMediaPublishPath(_param); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | + //获取当前所有频道信息 | ||
| 55 | + getAllChannelInfo(_param){ | ||
| 56 | + loger.log('getAllChannelInfo'); | ||
| 57 | + return this.mediaModule.getAllMediaChannelInfo(); | ||
| 58 | + } | ||
| 59 | + | ||
| 54 | //推流 | 60 | //推流 |
| 55 | publishVideo(_param) { | 61 | publishVideo(_param) { |
| 56 | if(!this.mcu.connected){ | 62 | if(!this.mcu.connected){ |
| @@ -300,6 +306,7 @@ class VideoApe extends Ape { | @@ -300,6 +306,7 @@ class VideoApe extends Ape { | ||
| 300 | if(owner==0){ | 306 | if(owner==0){ |
| 301 | loger.log("释放占用的频道,channel",itemIdx); | 307 | loger.log("释放占用的频道,channel",itemIdx); |
| 302 | unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; | 308 | unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED; |
| 309 | + unpackChannelInfo.streamId=""; | ||
| 303 | } | 310 | } |
| 304 | 311 | ||
| 305 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; | 312 | this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo; |
-
请 注册 或 登录 后发表评论