Merge pull request #1931 from custompal/cus_pr

补充getMediaPlayerList接口注释及postman示例
This commit is contained in:
夏楚 2022-09-02 18:10:11 +08:00 committed by GitHub
commit aa6581c253
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 0 deletions

View File

@ -848,6 +848,52 @@
}, },
"response": [] "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)", "name": "获取流信息(getMediaInfo)",
"request": { "request": {

View File

@ -741,6 +741,8 @@ void installWebApi() {
val["online"] = (bool) (MediaSource::find(allArgs["schema"],allArgs["vhost"],allArgs["app"],allArgs["stream"])); 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){ api_regist("/index/api/getMediaPlayerList",[](API_ARGS_MAP_ASYNC){
CHECK_SECRET(); CHECK_SECRET();
CHECK_ARGS("schema", "vhost", "app", "stream"); CHECK_ARGS("schema", "vhost", "app", "stream");