mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 14:45:55 +08:00
修复协议转换配置开关不生效的bug
This commit is contained in:
parent
09a2623e1b
commit
5258169a07
@ -211,10 +211,10 @@ void installWebHook(){
|
|||||||
GET_CONFIG(string,hook_http_access,Hook::kOnHttpAccess);
|
GET_CONFIG(string,hook_http_access,Hook::kOnHttpAccess);
|
||||||
|
|
||||||
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastMediaPublish,[](BroadcastMediaPublishArgs){
|
NoticeCenter::Instance().addListener(nullptr,Broadcast::kBroadcastMediaPublish,[](BroadcastMediaPublishArgs){
|
||||||
|
GET_CONFIG(bool,toRtxp,General::kPublishToRtxp);
|
||||||
|
GET_CONFIG(bool,toHls,General::kPublishToHls);
|
||||||
|
GET_CONFIG(bool,toMP4,General::kPublishToMP4);
|
||||||
if(!hook_enable || args._param_strs == hook_adminparams || hook_publish.empty() || sender.get_peer_ip() == "127.0.0.1"){
|
if(!hook_enable || args._param_strs == hook_adminparams || hook_publish.empty() || sender.get_peer_ip() == "127.0.0.1"){
|
||||||
GET_CONFIG(bool,toRtxp,General::kPublishToRtxp);
|
|
||||||
GET_CONFIG(bool,toHls,General::kPublishToHls);
|
|
||||||
GET_CONFIG(bool,toMP4,General::kPublishToMP4);
|
|
||||||
invoker("",toRtxp,toHls,toMP4);
|
invoker("",toRtxp,toHls,toMP4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -227,24 +227,20 @@ void installWebHook(){
|
|||||||
do_http_hook(hook_publish,body,[invoker](const Value &obj,const string &err){
|
do_http_hook(hook_publish,body,[invoker](const Value &obj,const string &err){
|
||||||
if(err.empty()){
|
if(err.empty()){
|
||||||
//推流鉴权成功
|
//推流鉴权成功
|
||||||
bool enableRtxp = true;
|
|
||||||
bool enableHls = true;
|
|
||||||
bool enableMP4 = false;
|
|
||||||
|
|
||||||
//兼容用户不传递enableRtxp、enableHls、enableMP4参数
|
//兼容用户不传递enableRtxp、enableHls、enableMP4参数
|
||||||
if(obj.isMember("enableRtxp")){
|
if(obj.isMember("enableRtxp")){
|
||||||
enableRtxp = obj["enableRtxp"].asBool();
|
toRtxp = obj["enableRtxp"].asBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(obj.isMember("enableHls")){
|
if(obj.isMember("enableHls")){
|
||||||
enableHls = obj["enableHls"].asBool();
|
toHls = obj["enableHls"].asBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(obj.isMember("enableMP4")){
|
if(obj.isMember("enableMP4")){
|
||||||
enableMP4 = obj["enableMP4"].asBool();
|
toMP4 = obj["enableMP4"].asBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
invoker(err,enableRtxp,enableHls,enableMP4);
|
invoker(err,toRtxp,toHls,toMP4);
|
||||||
}else{
|
}else{
|
||||||
//推流鉴权失败
|
//推流鉴权失败
|
||||||
invoker(err,false, false, false);
|
invoker(err,false, false, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user