From c6d0addb221153f902dfaa1d5350afd081c9274b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=8F=E6=A5=9A?= <771730766@qq.com> Date: Thu, 24 Aug 2023 17:06:41 +0800 Subject: [PATCH] add getMediaPlayerList --- MediaServer支持的HTTP-API.md | 40 +++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/MediaServer支持的HTTP-API.md b/MediaServer支持的HTTP-API.md index 0da4acd..402ee75 100644 --- a/MediaServer支持的HTTP-API.md +++ b/MediaServer支持的HTTP-API.md @@ -42,7 +42,8 @@ MediaServer是ZLMediaKit的主进程,目前支持以下http api接口,这些 "/index/api/getStatistic", "/index/api/addStreamPusherProxy", "/index/api/delStreamPusherProxy", - "/index/api/version" + "/index/api/version", + "/index/api/getMediaPlayerList" ``` 其中POST方式,参数既可以使用urlencoded方式也可以使用json方式。 @@ -1266,3 +1267,40 @@ typedef enum { } } ``` + +### 33、`/index/api/getMediaPlayerList` + + - 功能:获取某个流观看者列表 + + - 范例:[http://127.0.0.1:8080/index/api/getMediaPlayerList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=test'](http://127.0.0.1:8080/index/api/getMediaPlayerList?secret=035c73f7-bb6b-4889-a715-d9eb2d1925cc&schema=rtsp&vhost=__defaultVhost__&app=live&stream=test') + + - 参数: + + | 参数 | 是否必选 | 释意 | + | :----: | :------: | :----------------------------------------------------------: | + | secret | Y | api操作密钥(配置文件配置),如果操作ip是127.0.0.1,则不需要此参数 | + | schema | Y | 协议,例如 rtsp或rtmp | + | vhost | Y | 虚拟主机,例如`__defaultVhost__` | + | app | Y | 应用名,例如 live | + | stream | Y | 流id,例如 obs | + + - 响应: + + ```json + { + "code": 0, + "data": [ + { + "identifier": "3-309", + "local_ip": "::", + "local_port": 8000, + "peer_ip": "172.18.190.159", + "peer_port": 52996, + "typeid": "mediakit::WebRtcSession" + } + ] + } + ``` + + +