C API和WebHook未找到流回调添加直接关闭机制 (#1948)

This commit is contained in:
huangxiuqi
2022-09-09 10:55:35 +08:00
committed by GitHub
parent 7f86299c80
commit 258a4dd166
4 changed files with 22 additions and 7 deletions

View File

@@ -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) {