| | |
| | | |
| | | import java.net.URISyntaxException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Component("VnnoxAPIUtil") |
| | | @AllArgsConstructor |
| | |
| | | return response.getData(); |
| | | } |
| | | |
| | | /** |
| | | * 同步播放 |
| | | * |
| | | */ |
| | | public VnnoxResult syncPlay(List<String> playerId, Integer option) { |
| | | VnnoxBaseRequest request = new VnnoxBaseRequest(); |
| | | request.setPlayerIds(playerId); |
| | | request.setOption(option); |
| | | request.setNoticeUrl(VnnoxConstant.SCREEN_SHOT_NOTIFY_URL); |
| | | |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.SIMU_LCAST), |
| | | request.toJson(), |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | VnnoxResultResponse response = JSON.parseObject(result, VnnoxResultResponse.class); |
| | | |
| | | return response.getData(); |
| | | } |
| | | |
| | | /** |
| | | * NTP_SYNC |
| | | */ |
| | | public VnnoxResult ntpSync(List<String> playerId, boolean enable) { |
| | | // VnnoxBaseRequest request = new VnnoxBaseRequest(); |
| | | // request.setPlayerIds(playerId); |
| | | // request.setEnable(enable); |
| | | // request.setServer("ntp1.aliyun.com"); |
| | | // request.setNoticeUrl(VnnoxConstant.SCREEN_SHOT_NOTIFY_URL); |
| | | Map map = new HashMap(); |
| | | map.put("server", "ntp1.aliyun.com"); |
| | | map.put("enable", enable); |
| | | map.put("noticeUrl", VnnoxConstant.SCREEN_SHOT_NOTIFY_URL); |
| | | map.put("playerIds", playerId); |
| | | String s = JSON.toJSONString(map); |
| | | String result = VnnoxRequestUtil.PostWithHeader( |
| | | VnnoxUrl.getUrl(VnnoxUrl.NTP_SYNC), |
| | | s, |
| | | new CommonHeader(CommonHeader.JSON, true) |
| | | ); |
| | | VnnoxResultResponse response = JSON.parseObject(result, VnnoxResultResponse.class); |
| | | |
| | | return response.getData(); |
| | | } |
| | | |
| | | } |