From aef8fb8849d1416395761ebf2bec28254f1c32c7 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Wed, 13 Nov 2019 14:26:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0isMediaOnline=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E5=AA=92=E4=BD=93?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 587697a8..0f53cd7c 100644 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -418,6 +418,13 @@ void installWebApi() { }); }); + //测试url http://127.0.0.1/index/api/isMediaOnline?schema=rtsp&vhost=__defaultVhost__&app=live&stream=obs + API_REGIST(api,isMediaOnline,{ + CHECK_SECRET(); + CHECK_ARGS("schema","vhost","app","stream"); + val["online"] = (bool) (MediaSource::find(allArgs["schema"],allArgs["vhost"],allArgs["app"],allArgs["stream"],false)); + }); + //主动关断流,包括关断拉流、推流 //测试url http://127.0.0.1/index/api/close_stream?schema=rtsp&vhost=__defaultVhost__&app=live&stream=obs&force=1 API_REGIST(api,close_stream,{