| | |
| | | */ |
| | | @GetMapping("/getMonitorVideoUrl") |
| | | public ResponseVO<Object> getMonitorVideoUrl(@RequestBody MonitorParam monitorParam) { |
| | | String URL = monitorService.getMonitorVideoUrl(monitorParam.getAccessToken(), monitorParam.getDeviceSerial(), monitorParam.getProtocol()); |
| | | String URL = monitorService.getMonitorVideoUrl(monitorParam.getAccessToken(), |
| | | monitorParam.getDeviceSerial(), monitorParam.getProtocol(), monitorParam.getExpireTime()); |
| | | |
| | | return ResponseUtil.success(URL); |
| | | } |
| | |
| | | */ |
| | | //流播放协议,1-ezopen、2-hls、3-rtmp、4-flv,默认为1 |
| | | private int protocol; |
| | | //过期时长,单位秒;针对hls/rtmp设置有效期,相对时间;30秒-720天 |
| | | private int expireTime; |
| | | /** |
| | | * 结束萤石云摄像头播放地址相关参数 |
| | | */ |
| | |
| | | * @param deviceSerial |
| | | * @return |
| | | */ |
| | | public String getMonitorVideoUrl(String accessToken, String deviceSerial, int protocol) { |
| | | public String getMonitorVideoUrl(String accessToken, String deviceSerial, int protocol, int expireTime) { |
| | | if (expireTime < 30 || expireTime > 62208000) { |
| | | throw new BusinessException("设置的URL播放地址过期时长数据错误"); |
| | | } |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("accessToken", accessToken); |
| | | paramMap.put("deviceSerial", deviceSerial); |
| | | paramMap.put("protocol", protocol); |
| | | paramMap.put("expireTime", expireTime); |
| | | String s = HttpUtil.post(YSY_URL + GET_VEDIO_URL, paramMap); |
| | | System.out.println(s); |
| | | YSY_MonitorDto monitor = JSON.parseObject(s, YSY_MonitorDto.class); |