支持 禁用实时点播

This commit is contained in:
zxb 2023-10-26 10:22:13 +08:00
parent 133afc655a
commit 0f58a59fbb
4 changed files with 23 additions and 5 deletions

View File

@ -1,5 +1,7 @@
package com.genersoft.iot.vmp.conf; package com.genersoft.iot.vmp.conf;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -14,6 +16,9 @@ import java.util.List;
@ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true) @ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true)
@Order(0) @Order(0)
public class UserSetting { public class UserSetting {
@Getter
@Setter
private Boolean disableRealtimePlay = Boolean.FALSE;
private Boolean savePositionHistory = Boolean.FALSE; private Boolean savePositionHistory = Boolean.FALSE;

View File

@ -94,6 +94,15 @@ public class PlayController {
public DeferredResult<WVPResult<StreamContent>> play(HttpServletRequest request, @PathVariable String deviceId, public DeferredResult<WVPResult<StreamContent>> play(HttpServletRequest request, @PathVariable String deviceId,
@PathVariable String channelId) { @PathVariable String channelId) {
if(userSetting.getDisableRealtimePlay()){
DeferredResult<WVPResult<StreamContent>> resultDeferredResult = new DeferredResult<>();
WVPResult<StreamContent> result = new WVPResult<>();
result.setCode(500);
result.setMsg("实时点播已禁用");
resultDeferredResult.setResult(result);
return resultDeferredResult;
}
logger.info("[开始点播] deviceId{}, channelId{}, ", deviceId, channelId); logger.info("[开始点播] deviceId{}, channelId{}, ", deviceId, channelId);
// 获取可用的zlm // 获取可用的zlm
Device device = storager.queryVideoDevice(deviceId); Device device = storager.queryVideoDevice(deviceId);

View File

@ -110,6 +110,8 @@ user-settings:
allowed-origins: allowed-origins:
- http://localhost:8080 - http://localhost:8080
- http://127.0.0.1:8080 - http://127.0.0.1:8080
# 是否禁用实时点播
disable-realtime-play: false
# [可选] 日志配置, 一般不需要改 # [可选] 日志配置, 一般不需要改
logging: logging:
config: classpath:logback-spring-local.xml config: classpath:logback-spring-local.xml

View File

@ -59,7 +59,7 @@ sip:
# 如果要监听多张网卡可以使用逗号分隔多个IP 例如: 192.168.1.4,10.0.0.4 # 如果要监听多张网卡可以使用逗号分隔多个IP 例如: 192.168.1.4,10.0.0.4
# 如果不明白就使用0.0.0.0,大部分情况都是可以的 # 如果不明白就使用0.0.0.0,大部分情况都是可以的
# 请不要使用127.0.0.1任何包括localhost在内的域名都是不可以的。 # 请不要使用127.0.0.1任何包括localhost在内的域名都是不可以的。
ip: 192.168.3.12 ip: 192.168.10.195
# [可选] 28181服务监听的端口 # [可选] 28181服务监听的端口
port: 5060 port: 5060
# 根据国标6.1.2中规定domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码由省级、市级、区级、基层编号组成参照GB/T 2260-2007 # 根据国标6.1.2中规定domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码由省级、市级、区级、基层编号组成参照GB/T 2260-2007
@ -79,7 +79,7 @@ media:
# id: your_server_id # id: your_server_id
id: amrWMKmbKqoBjRQ9 id: amrWMKmbKqoBjRQ9
# [必须修改] zlm服务器的内网IP # [必须修改] zlm服务器的内网IP
ip: 192.168.3.14 ip: 192.168.10.34
# [必须修改] zlm服务器的http.port # [必须修改] zlm服务器的http.port
http-port: 5081 http-port: 5081
# [可选] 返回流地址时的ip置空使用 media.ip # [可选] 返回流地址时的ip置空使用 media.ip
@ -99,12 +99,12 @@ media:
enable: true enable: true
# [可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性不然自动配置此属性可能不成功 # [可选] 在此范围内选择端口用于媒体流传输, 必须提前在zlm上配置该属性不然自动配置此属性可能不成功
#port-range: 51000,51300 # 端口范围 #port-range: 51000,51300 # 端口范围
port-range: 62200,62250 port-range: 52200,62250
# [可选] 国标级联在此范围内选择端口发送媒体流, # [可选] 国标级联在此范围内选择端口发送媒体流,
#send-port-range: 51000,51300 # 端口范围 #send-port-range: 51000,51300 # 端口范围
send-port-range: 62200,62250 send-port-range: 52200,62250
# 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载 0 表示不使用 # 录像辅助服务, 部署此服务可以实现zlm录像的管理与下载 0 表示不使用
record-assist-port: 18979 record-assist-port: 0
# [根据业务需求配置] # [根据业务需求配置]
user-settings: user-settings:
# 点播/录像回放 等待超时时间,单位:毫秒 # 点播/录像回放 等待超时时间,单位:毫秒
@ -117,6 +117,8 @@ user-settings:
allowed-origins: allowed-origins:
- http://localhost:8080 - http://localhost:8080
- http://127.0.0.1:8080 - http://127.0.0.1:8080
# 是否禁用实时点播
disable-realtime-play: false
# [可选] 日志配置, 一般不需要改 # [可选] 日志配置, 一般不需要改
logging: logging:
config: classpath:logback-spring-local.xml config: classpath:logback-spring-local.xml