| | |
| | | subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey,
|
| | | (MediaServerItem mediaServerItemInUse, JSONObject json)->{
|
| | | if (userSetup.isWaitTrack() && json.getJSONArray("tracks") == null) return;
|
| | | event.response(mediaServerItemInUse, json);
|
| | | subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
|
| | | if (event != null) {
|
| | | event.response(mediaServerItemInUse, json);
|
| | | }
|
| | |
|
| | | // subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
|
| | | });
|
| | | //
|
| | | StringBuffer content = new StringBuffer(200);
|
| | |
| | | logger.debug("录像回放添加订阅,订阅内容:" + subscribeKey.toString());
|
| | | subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey,
|
| | | (MediaServerItem mediaServerItemInUse, JSONObject json)->{
|
| | | System.out.println(344444);
|
| | | if (userSetup.isWaitTrack() && json.getJSONArray("tracks") == null) return;
|
| | | event.response(mediaServerItemInUse, json);
|
| | | subscribe.removeSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey);
|
| | | if (event != null) {
|
| | | event.response(mediaServerItemInUse, json);
|
| | | }
|
| | | });
|
| | |
|
| | | StringBuffer content = new StringBuffer(200);
|
| | |
| | | content.append("c=IN IP4 "+mediaServerItem.getSdpIp()+"\r\n");
|
| | | content.append("t="+DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime)+" "
|
| | | +DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime) +"\r\n");
|
| | |
|
| | |
|
| | |
|
| | | String streamMode = device.getStreamMode().toUpperCase();
|
| | |
|
| | |
| | | if (type == null) {
|
| | | type = "all";
|
| | | }
|
| | |
|
| | | try {
|
| | | StringBuffer recordInfoXml = new StringBuffer(200);
|
| | | recordInfoXml.append("<?xml version=\"1.0\" encoding=\"GB2312\"?>\r\n");
|
| | |
| | | recordInfoXml.append("<CmdType>RecordInfo</CmdType>\r\n");
|
| | | recordInfoXml.append("<SN>" + sn + "</SN>\r\n");
|
| | | recordInfoXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n");
|
| | | recordInfoXml.append("<StartTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(startTime) + "</StartTime>\r\n");
|
| | | recordInfoXml.append("<EndTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(endTime) + "</EndTime>\r\n");
|
| | | recordInfoXml.append("<Secrecy> "+ secrecy + " </Secrecy>\r\n");
|
| | | // 大华NVR要求必须增加一个值为all的文本元素节点Type
|
| | | recordInfoXml.append("<Type>" + type+"</Type>\r\n");
|
| | | if (startTime != null) {
|
| | | recordInfoXml.append("<StartTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(startTime) + "</StartTime>\r\n");
|
| | | }
|
| | | if (endTime != null) {
|
| | | recordInfoXml.append("<EndTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(endTime) + "</EndTime>\r\n");
|
| | | }
|
| | | if (secrecy != null) {
|
| | | recordInfoXml.append("<Secrecy> "+ secrecy + " </Secrecy>\r\n");
|
| | | }
|
| | | if (type != null) {
|
| | | // 大华NVR要求必须增加一个值为all的文本元素节点Type
|
| | | recordInfoXml.append("<Type>" + type+"</Type>\r\n");
|
| | | }
|
| | | recordInfoXml.append("</Query>\r\n");
|
| | |
|
| | | String tm = Long.toString(System.currentTimeMillis());
|