| | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | // 批量截屏 |
| | | public Map<String, String> getScreenShotUrl(List<String> playerIds) { |
| | | Map<String, String> map = new HashMap(); |
| | | |
| | | playerIds.forEach( |
| | | playId->{ |
| | | try { |
| | | redisUtils.delete(VnnoxConstant.REDIS_SCREEN_SHOT + playId); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | ); |
| | | |
| | | VnnoxResult vnnoxResult = vnnoxAPIUtil.screenShot(playerIds); |
| | | |
| | | if (null == vnnoxResult) { |
| | | map.put("code", "500"); |
| | | map.put("msg", "设备已下线"); |
| | | return map; |
| | | } |
| | | |
| | | if (vnnoxResult.getSuccess().size() == 0) { |
| | | map.put("code", "500"); |
| | | map.put("msg", "获取缩略图失败!"); |
| | | return map; |
| | | } |
| | | String url = null; |
| | | Integer checkCount = 0; |
| | | while (checkCount < 10) { |
| | | url = redisUtils.get(VnnoxConstant.REDIS_SCREEN_SHOT + playerIds.get(0)); |
| | | if (null != url) { |
| | | break; |
| | | } |
| | | try { |
| | | Thread.sleep(2000); |
| | | checkCount = checkCount + 1; |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | map.put("url", url); |
| | | map.put("code", "200"); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | // //重启 |
| | | // public VnnoxResult reboot(List<LedPlayerEntity> playerList) { |
| | | // return vnnoxAPIUtil.reboot( |