| | |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private ICloudRecordService cloudRecordService; |
| | | |
| | | @Autowired |
| | | private VideoStreamSessionManager sessionManager; |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | // 推流鉴权的处理 |
| | | if (!"rtp".equals(param.getApp())) { |
| | | StreamProxyItem stream = streamProxyService.getStreamProxyByAppAndStream(param.getApp(), param.getStream()); |
| | | if (stream != null) { |
| | | HookResultForOnPublish result = HookResultForOnPublish.SUCCESS(); |
| | | result.setEnable_audio(stream.isEnableAudio()); |
| | | result.setEnable_mp4(stream.isEnableMp4()); |
| | | return result; |
| | | } |
| | | if (userSetting.getPushAuthority()) { |
| | | // 推流鉴权 |
| | | if (param.getParams() == null) { |
| | |
| | | result.onTimeout(() -> { |
| | | logger.info("[ZLM HOOK] 预览流自动点播, 等待超时"); |
| | | msg.setData(new HookResult(ErrorCode.ERROR100.getCode(), "点播超时")); |
| | | resultHolder.invokeResult(msg); |
| | | resultHolder.invokeAllResult(msg); |
| | | inviteStreamService.removeInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, deviceId, channelId); |
| | | storager.stopPlay(deviceId, channelId); |
| | | }); |
| | | |
| | | resultHolder.put(key, uuid, result); |
| | |
| | | return HookResult.SUCCESS(); |
| | | } |
| | | |
| | | /** |
| | | * 录像完成事件 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/on_record_mp4", produces = "application/json;charset=UTF-8") |
| | | public HookResult onRecordMp4(HttpServletRequest request, @RequestBody OnRecordMp4HookParam param) { |
| | | logger.info("[ZLM HOOK] 录像完成事件:{}->{}", param.getMediaServerId(), param.getFile_path()); |
| | | |
| | | taskExecutor.execute(() -> { |
| | | cloudRecordService.addRecord(param); |
| | | }); |
| | | |
| | | return HookResult.SUCCESS(); |
| | | } |
| | | |
| | | private Map<String, String> urlParamToMap(String params) { |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | if (ObjectUtils.isEmpty(params)) { |