bug修改
This commit is contained in:
parent
df5e5a5aef
commit
13be0e7452
@ -150,6 +150,8 @@ public class VideoItemController {
|
|||||||
@ApiOperation(value = "根据itemId视频Id查询视频播放url", notes = "根据itemId视频Id查询视频播放url", httpMethod = "POST")
|
@ApiOperation(value = "根据itemId视频Id查询视频播放url", notes = "根据itemId视频Id查询视频播放url", httpMethod = "POST")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "itemId", value = "视频记录ID", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "itemId", value = "视频记录ID", paramType = "body", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "streamType", value = "2主码流,不传子码流", paramType = "body", required = false, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "type", value = "取流协议 rtsp、rtmp、hls,不传默认hls", paramType = "body", required = false, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping("/getVideoItemInfo")
|
@PostMapping("/getVideoItemInfo")
|
||||||
public Result<Map<String, Object>> getVideoItemInfo(@RequestBody Map<String, Object> map) {
|
public Result<Map<String, Object>> getVideoItemInfo(@RequestBody Map<String, Object> map) {
|
||||||
|
|||||||
@ -51,8 +51,11 @@ public class HikVideoUtil {
|
|||||||
}
|
}
|
||||||
paramMap.put("streamType", streamType);
|
paramMap.put("streamType", streamType);
|
||||||
paramMap.put("protocol", StringUtils.isNotEmpty(type) ? type : "hls");
|
paramMap.put("protocol", StringUtils.isNotEmpty(type) ? type : "hls");
|
||||||
paramMap.put("expand", "streamform=rtp");
|
paramMap.put("expand", "transcode=0");
|
||||||
|
paramMap.put("transmode", 1);
|
||||||
|
paramMap.put("streamform", "rtp");
|
||||||
String body = JSON.toJSON(paramMap).toString();
|
String body = JSON.toJSON(paramMap).toString();
|
||||||
|
log.info("callPostApiGetPreviewURL body:{}", body);
|
||||||
Map<String, String> path = new HashMap<String, String>(2) {
|
Map<String, String> path = new HashMap<String, String>(2) {
|
||||||
{
|
{
|
||||||
put("https://", getCamsApi);
|
put("https://", getCamsApi);
|
||||||
@ -60,7 +63,7 @@ public class HikVideoUtil {
|
|||||||
};
|
};
|
||||||
String host = Ip + ":" + port;
|
String host = Ip + ":" + port;
|
||||||
String result = doPostStringArtemis(host, path, body, null, null, "application/json", appke, appSecret);
|
String result = doPostStringArtemis(host, path, body, null, null, "application/json", appke, appSecret);
|
||||||
log.info(result);
|
log.info("callPostApiGetPreviewURL result:{}", result);
|
||||||
if (result != null && result.length() > 0) {
|
if (result != null && result.length() > 0) {
|
||||||
JSONObject json = JSONObject.parseObject(result);
|
JSONObject json = JSONObject.parseObject(result);
|
||||||
if ("0".equals((String) json.get("code"))) {
|
if ("0".equals((String) json.get("code"))) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user