diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 07b9d9b6..4e947b33 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -45,6 +45,7 @@ import javax.sdp.*; import javax.sip.InvalidArgumentException; import javax.sip.ResponseEvent; import javax.sip.SipException; +import javax.sip.message.Response; import java.io.File; import java.math.BigDecimal; import java.math.RoundingMode; @@ -110,6 +111,11 @@ public class PlayServiceImpl implements IPlayService { @Override public SSRCInfo play(MediaServerItem mediaServerItem, String deviceId, String channelId, String ssrc, ErrorCallback callback) { + if(userSetting.getDisableRealtimePlay()){ + logger.info("[点播] 实时点播已禁用"); + callback.run(Response.FORBIDDEN, "实时点播已禁用", null); + throw new ControllerException(ErrorCode.ERROR100.getCode(), "实时点播已禁用"); + } if (mediaServerItem == null) { logger.warn("[点播] 未找到可用的zlm deviceId: {},channelId:{}", deviceId, channelId); throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的zlm"); @@ -176,7 +182,6 @@ public class PlayServiceImpl implements IPlayService { @Override public void play(MediaServerItem mediaServerItem, SSRCInfo ssrcInfo, Device device, String channelId, ErrorCallback callback) { - if (mediaServerItem == null || ssrcInfo == null) { callback.run(InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getCode(), InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getMsg(),