| | |
| | | private static final String DELETE_DEVICE_URL = "/device/delete"; |
| | | //获取萤石云单个设备信息 |
| | | private static final String GET_DEVICE_URL = "/device/info"; |
| | | //获取萤石云摄像头播放地址URL |
| | | private static final String GET_VEDIO_URL = "/v2/live/address/get"; |
| | | |
| | | /** |
| | | * 查询全部摄像头 |
| | |
| | | return updateById(monitor); |
| | | } |
| | | |
| | | /** |
| | | * 返回摄像头实时画面播放地址 |
| | | * |
| | | * @param accessToken |
| | | * @param deviceSerial |
| | | * @return |
| | | */ |
| | | public String getMonitorVideoUrl(String accessToken, String deviceSerial, int protocol) { |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("accessToken", accessToken); |
| | | paramMap.put("deviceSerial", deviceSerial); |
| | | paramMap.put("protocol", protocol); |
| | | String s = HttpUtil.post(YSY_URL + GET_VEDIO_URL, paramMap); |
| | | System.out.println(s); |
| | | YSY_MonitorDto monitor = JSON.parseObject(s, YSY_MonitorDto.class); |
| | | if ("200".equals(monitor.getCode())) { |
| | | return monitor.getData().getUrl(); |
| | | } else { |
| | | throw new BusinessException(monitor.getMsg()); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |