mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
C API和WebHook未找到流回调添加直接关闭机制 (#1948)
This commit is contained in:
@@ -505,8 +505,17 @@ void installWebHook(){
|
||||
body["ip"] = sender.get_peer_ip();
|
||||
body["port"] = sender.get_peer_port();
|
||||
body["id"] = sender.getIdentifier();
|
||||
|
||||
// Hook回复立即关闭流
|
||||
auto res_cb = [closePlayer](const Value &res, const string &err) {
|
||||
bool flag = res["close"].asBool();
|
||||
if (flag) {
|
||||
closePlayer();
|
||||
}
|
||||
};
|
||||
|
||||
//执行hook
|
||||
do_http_hook(hook_stream_not_found, body, nullptr);
|
||||
do_http_hook(hook_stream_not_found, body, res_cb);
|
||||
});
|
||||
|
||||
static auto getRecordInfo = [](const RecordInfo &info) {
|
||||
|
||||
Reference in New Issue
Block a user