支持 禁用实时点播

This commit is contained in:
zxb 2023-10-26 11:23:17 +08:00
parent 0f58a59fbb
commit 792b636898

View File

@ -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<Object> 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<Object> callback) {
if (mediaServerItem == null || ssrcInfo == null) {
callback.run(InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getCode(),
InviteErrorCode.ERROR_FOR_PARAMETER_ERROR.getMsg(),