| | |
| | | JSONObject ret = new JSONObject();
|
| | | ret.put("code", 0);
|
| | | ret.put("msg", "success");
|
| | | ret.put("enableHls", true);
|
| | | ret.put("enable_hls", true);
|
| | | String mediaServerId = json.getString("mediaServerId");
|
| | | ZLMHttpHookSubscribe.Event subscribe = this.subscribe.getSubscribe(ZLMHttpHookSubscribe.HookType.on_publish, json);
|
| | | if (subscribe != null) {
|
| | |
| | | String app = json.getString("app");
|
| | | String stream = json.getString("stream");
|
| | | if ("rtp".equals(app)) {
|
| | | ret.put("enableMP4", userSetup.getRecordSip());
|
| | | ret.put("enable_mp4", userSetup.getRecordSip());
|
| | | }else {
|
| | | ret.put("enableMP4", userSetup.isRecordPushLive());
|
| | | ret.put("enable_mp4", userSetup.isRecordPushLive());
|
| | | }
|
| | | List<SsrcTransaction> ssrcTransactionForAll = sessionManager.getSsrcTransactionForAll(null, null, null, stream);
|
| | | if (ssrcTransactionForAll != null && ssrcTransactionForAll.size() == 1) {
|
| | |
| | | if (deviceChannel != null) {
|
| | | ret.put("enable_audio", deviceChannel.isHasAudio());
|
| | | }
|
| | | // 如果是录像下载就设置视频间隔十秒
|
| | | if (ssrcTransactionForAll.get(0).getType() == VideoStreamSessionManager.SessionType.download) {
|
| | | ret.put("mp4_max_second", 10);
|
| | | ret.put("enable_mp4", true);
|
| | | ret.put("enable_audio", true);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | return new ResponseEntity<String>(ret.toString(), HttpStatus.OK);
|
| | | }
|
| | |
|
| | |
| | | if (mediaInfo != null) {
|
| | | subscribe.response(mediaInfo, json);
|
| | | }
|
| | |
|
| | | }
|
| | | // 流消失移除redis play
|
| | | String app = item.getApp();
|
| | |
| | | if ("rtp".equals(app)){
|
| | | ret.put("close", true);
|
| | | StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId);
|
| | | SsrcTransaction ssrcTransaction = sessionManager.getSsrcTransaction(null, null, null, streamId);
|
| | | if (streamInfoForPlayCatch != null) {
|
| | | // 如果在给上级推流,也不停止。
|
| | | if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) {
|