From 33b51c40ddd9750a19b2c6a6618fb22386f87cd7 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 13 Nov 2020 18:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=BA=E5=88=B6=E4=B8=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BC=96=E7=A0=81=E4=BF=A1=E6=81=AF=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 6 ------ src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java | 1 - .../com/genersoft/iot/vmp/vmanager/play/PlayController.java | 4 ++++ src/main/resources/application.yml | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 8367e701..dba80cf3 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,6 @@ ${project.build.directory}/asciidoc ${project.build.directory}/asciidoc/html ${project.build.directory}/asciidoc/pdf - 2.8.6 @@ -153,11 +152,6 @@ fastjson 1.2.73 - - - com.google.code.gson - gson - diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java index a102fe56..990f003b 100644 --- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java +++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java @@ -11,5 +11,4 @@ public class VManageBootstrap extends LogManager { public static void main(String[] args) { SpringApplication.run(VManageBootstrap.class, args); } - } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java index feb96df3..c9b2d34d 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java @@ -38,11 +38,15 @@ public class PlayController { @Autowired private ZLMRESTfulUtils zlmresTfulUtils; + @Value("${media.closeWaitRTPInfo}") + private boolean closeWaitRTPInfo; + @GetMapping("/play/{deviceId}/{channelId}") public ResponseEntity play(@PathVariable String deviceId, @PathVariable String channelId, Integer getEncoding) { if (getEncoding == null) getEncoding = 0; + getEncoding = closeWaitRTPInfo ? 0: getEncoding; Device device = storager.queryVideoDevice(deviceId); StreamInfo streamInfo = storager.queryPlayByDevice(deviceId, channelId); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9d5e39cc..5a752e5c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -45,6 +45,7 @@ media: #zlm服务器的ip与http端口, 重点: 这是http端口 port: 80 secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc streamNoneReaderDelayMS: 1800000 # 无人观看多久自动关闭流 + closeWaitRTPInfo: false # 强制关闭等待收到流编码信息后在返回, 设为true可以快速打开播放窗口, 设为false保证返回后流就可以播放 rtp: # 启用udp多端口模式 enable: true udpPortRange: 30000,30500 # 端口范围