| | |
| | |
|
| | |
|
| | | HookResultForOnPublish result = HookResultForOnPublish.SUCCESS();
|
| | | if (!"rtp".equals(param.getApp())) {
|
| | | result.setEnable_audio(true);
|
| | | }
|
| | |
|
| | | result.setEnable_audio(true);
|
| | | taskExecutor.execute(() -> {
|
| | | ZlmHttpHookSubscribe.Event subscribe = this.subscribe.sendNotify(HookType.on_publish, json);
|
| | | if (subscribe != null) {
|
| | |
| | | // 如果是录像下载就设置视频间隔十秒
|
| | | if (ssrcTransactionForAll.get(0).getType() == InviteSessionType.DOWNLOAD) {
|
| | | result.setMp4_max_second(10);
|
| | | result.setEnable_audio(true);
|
| | | result.setEnable_mp4(true);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (param.getApp().equalsIgnoreCase("rtp")) {
|
| | | String receiveKey = VideoManagerConstants.WVP_OTHER_RECEIVE_RTP_INFO + userSetting.getServerId() + "_" + param.getStream();
|
| | | OtherRtpSendInfo otherRtpSendInfo = (OtherRtpSendInfo)redisTemplate.opsForValue().get(receiveKey);
|
| | | if (otherRtpSendInfo != null) {
|
| | | result.setEnable_mp4(true);
|
| | | }
|
| | | }
|
| | | logger.info("[ZLM HOOK]推流鉴权 响应:{}->{}->>>>{}", param.getMediaServerId(), param, result);
|
| | | return result;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | GbStream gbStream = storager.getGbStream(param.getApp(), param.getStream());
|
| | | if (gbStream != null) {
|
| | | eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF);
|
| | | if (userSetting.isUsePushingAsStatus()) {
|
| | | eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF);
|
| | | }
|
| | | }
|
| | | if (type != null) {
|
| | | // 发送流变化redis消息
|
| | |
| | | if ("rtp".equals(param.getApp())) {
|
| | | ret.put("close", userSetting.getStreamOnDemand());
|
| | | // 国标流, 点播/录像回放/录像下载
|
| | | // StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(param.getStream());
|
| | |
|
| | | InviteInfo inviteInfo = inviteStreamService.getInviteInfoByStream(null, param.getStream());
|
| | | // 点播
|
| | | if (inviteInfo != null) {
|
| | |
| | | // 拉流代理
|
| | | StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(param.getApp(), param.getStream());
|
| | | if (streamProxyItem != null) {
|
| | | if (streamProxyItem.isEnableDisableNoneReader()) {
|
| | | if (streamProxyItem.isEnableRemoveNoneReader()) {
|
| | | // 无人观看自动移除
|
| | | ret.put("close", true);
|
| | | streamProxyService.del(param.getApp(), param.getStream());
|
| | |
| | | resultHolder.put(key, uuid, result);
|
| | |
|
| | | if (!exist) {
|
| | | playService.play(mediaInfo, deviceId, channelId, (code, message, data) -> {
|
| | | playService.play(mediaInfo, deviceId, channelId, null, (code, message, data) -> {
|
| | | msg.setData(new HookResult(code, message));
|
| | | resultHolder.invokeResult(msg);
|
| | | });
|