李勇

1。音视频模块增加获取当前频道占用情况的接口,获取当前所有频道的信息

... ... @@ -116,16 +116,18 @@ export default class MessageEntrance extends Emiter {
this.sendChatMsg = this._sendChatMsg.bind(this);
//videoApe
this.getVideoPlayPath = this._getVideoPlayPath.bind(this);
//this.getVideoPlayPath = this._getVideoPlayPath.bind(this);
this.getVideoPublishPath = this._getVideoPublishPath.bind(this);
this.getVideoAllChannelInfo = this._getVideoAllChannelInfo.bind(this);
this.publishVideo = this._publishVideo.bind(this);
this.stopPublishVideo = this._stopPublishVideo.bind(this);
this.sendVideoBroadcastMsg=this._sendVideoBroadcastMsg.bind(this);
//audioApe
this.getAudioPlayPath = this._getPlayAudioPath.bind(this);
//this.getAudioPlayPath = this._getPlayAudioPath.bind(this);
this.getAudioPublishPath = this._getPublishAudioPath.bind(this);
this.getAudioAllChannelInfo = this._getAudioAllChannelInfo.bind(this);
this.publishAudio = this._publishAudio.bind(this);
this.stopPublishAudio = this._stopPublishAudio.bind(this);
this.sendAudioBroadcastMsg=this.sendAudioCommandMsg.bind(this);
... ... @@ -138,9 +140,9 @@ export default class MessageEntrance extends Emiter {
this.sendGotoPrev = this._sendGotoPrev.bind(this);
//DocApe
this.sendDocumentUpload = this._sendDocumentUpload.bind(this);;//上传文档
this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this);; //切换文档
this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);;//翻页
this.sendDocumentUpload = this._sendDocumentUpload.bind(this);//上传文档
this.sendDocumentSwitchDoc = this._sendDocumentSwitchDoc.bind(this); //切换文档
this.sendDocumentSwitchPage = this._sendDocumentSwitchPage.bind(this);//翻页
this.sendDocumentDelete = this._sassDeleteDocument.bind(this);;//删除文档,先通过Sass删除,sass删除成功之后再同步mcu
//this.sendDocumentDeleteAll= this._documentDeleteAll;//删除所有文档
this.sendDocumentCommand = this._sendDocumentCommand.bind(this);;//操作文档(翻页、缩放、滚动...)
... ... @@ -747,6 +749,11 @@ export default class MessageEntrance extends Emiter {
return _video_ape.getPublishVideoPath(_param);
}
}
_getVideoAllChannelInfo(_param){
if(_video_ape){
return _video_ape.getAllChannelInfo(_param);
}
}
_publishVideo(_param){
if(!_mcu.connected){
... ... @@ -797,7 +804,11 @@ export default class MessageEntrance extends Emiter {
return _audio_ape.getAudioPublishPath(_param);
}
}
_getAudioAllChannelInfo(_param){
if(_audio_ape){
return _audio_ape.getAllChannelInfo(_param);
}
}
_publishAudio(_param){
if(!_mcu.connected){
loger.warn(GlobalConfig.getCurrentStatus());
... ...
... ... @@ -50,6 +50,12 @@ class AudioApe extends Ape {
return this.mediaModule.getMediaPublishPath(_param);
}
//获取当前所有频道信息
getAllChannelInfo(_param){
loger.log('getAllChannelInfo');
return this.mediaModule.getAllMediaChannelInfo();
}
//推流
publishAudio(_param) {
if(!this.mcu.connected){
... ... @@ -296,6 +302,7 @@ class AudioApe extends Ape {
if(owner==0){
loger.log("释放占用的频道,channel",itemIdx);
unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED;
unpackChannelInfo.streamId="";
}
this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo;
... ...
... ... @@ -138,6 +138,23 @@ class MediaModule {
return true;
}
//获取当前所有频道的信息
getAllMediaChannelInfo(){
let channels=[];
for (let key in this.mediaChannels){
let channel=this.mediaChannels[key];
if(channel){
channels.push({"mediaId":channel.channelId,"status":channel.status,"fromNodeId":channel.fromNodeId});
}
}
if(channels.length<this.maxMediaChannel){
for (let i=channels.length;i<this.maxMediaChannel;i++){
let channelId=this.MEDIA_OBJ_TABLE_ID + (i);
channels.push({"mediaId":channelId,"status":ApeConsts.CHANNEL_STATUS_RELEASED,"fromNodeId":0});
}
}
return channels;
}
//获取默认的频道信息
getDefaultChannelInfo(){
let channelInfo={};
... ...
... ... @@ -51,6 +51,12 @@ class VideoApe extends Ape {
return this.mediaModule.getMediaPublishPath(_param);
}
//获取当前所有频道信息
getAllChannelInfo(_param){
loger.log('getAllChannelInfo');
return this.mediaModule.getAllMediaChannelInfo();
}
//推流
publishVideo(_param) {
if(!this.mcu.connected){
... ... @@ -300,6 +306,7 @@ class VideoApe extends Ape {
if(owner==0){
loger.log("释放占用的频道,channel",itemIdx);
unpackChannelInfo.status=ApeConsts.CHANNEL_STATUS_RELEASED;
unpackChannelInfo.streamId="";
}
this.mediaModule.mediaChannels[itemIdx] = unpackChannelInfo;
... ...