添加获取直播流的api

This commit is contained in:
panlinlin
2021-03-26 18:32:36 +08:00
parent 9a4b0de1af
commit edb033ccd7
14 changed files with 1039 additions and 15 deletions

View File

@@ -0,0 +1,45 @@
package com.genersoft.iot.vmp.web;
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.common.RealVideo;
import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
/**
* 兼容LiveGBS的API系统接口
*/
@Controller
@CrossOrigin
@RequestMapping(value = "/api/v1/media")
public class ApiMediaController {
private final static Logger logger = LoggerFactory.getLogger(ApiMediaController.class);
@Autowired
private IRedisCatchStorage redisCatchStorage;
@RequestMapping(value = "/list")
@ResponseBody
public JSONObject list( @RequestParam(required = false)Integer start,
@RequestParam(required = false)Integer limit,
@RequestParam(required = false)String q,
@RequestParam(required = false)Boolean online ){
List<Object> mediaList = redisCatchStorage.getMediaList(start - 1, start - 1 + limit);
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", 0);
jsonObject.put("data", mediaList);
return jsonObject;
}
}