From dd6495cc078e21837b27a1288b7de1c7fa11d293 Mon Sep 17 00:00:00 2001 From: custompal <1040801756@qq.com> Date: Fri, 2 Sep 2022 17:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85getMediaPlayerList=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=B3=A8=E9=87=8A=E5=8F=8Apostman=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postman/ZLMediaKit.postman_collection.json | 46 ++++++++++++++++++++++ server/WebApi.cpp | 2 + 2 files changed, 48 insertions(+) diff --git a/postman/ZLMediaKit.postman_collection.json b/postman/ZLMediaKit.postman_collection.json index fd98c490..19e7b183 100644 --- a/postman/ZLMediaKit.postman_collection.json +++ b/postman/ZLMediaKit.postman_collection.json @@ -848,6 +848,52 @@ }, "response": [] }, + { + "name": "获取媒体流播放器列表(getMediaPlayerList)", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{ZLMediaKit_URL}}/index/api/getMediaPlayerList?secret={{ZLMediaKit_secret}}&schema=rtsp&vhost={{defaultVhost}}&app=proxy&stream=1", + "host": [ + "{{ZLMediaKit_URL}}" + ], + "path": [ + "index", + "api", + "getMediaPlayerList" + ], + "query": [ + { + "key": "secret", + "value": "{{ZLMediaKit_secret}}", + "description": "api操作密钥(配置文件配置),如果操作ip是127.0.0.1,则不需要此参数" + }, + { + "key": "schema", + "value": "rtsp", + "description": "协议,例如 rtsp或rtmp" + }, + { + "key": "vhost", + "value": "{{defaultVhost}}", + "description": "虚拟主机,例如__defaultVhost__" + }, + { + "key": "app", + "value": "proxy", + "description": "应用名,例如 live" + }, + { + "key": "stream", + "value": "1", + "description": "流id,例如 test" + } + ] + } + }, + "response": [] + }, { "name": "获取流信息(getMediaInfo)", "request": { diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 49f04537..83089bc6 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -741,6 +741,8 @@ void installWebApi() { val["online"] = (bool) (MediaSource::find(allArgs["schema"],allArgs["vhost"],allArgs["app"],allArgs["stream"])); }); + //获取媒体流播放器列表 + //测试url http://127.0.0.1/index/api/getMediaPlayerList?schema=rtsp&vhost=__defaultVhost__&app=live&stream=obs api_regist("/index/api/getMediaPlayerList",[](API_ARGS_MAP_ASYNC){ CHECK_SECRET(); CHECK_ARGS("schema", "vhost", "app", "stream");