Commit 33b51c40ddd9750a19b2c6a6618fb22386f87cd7
1 parent
222d44bd
增加强制不查询编码信息配置
Showing
4 changed files
with
5 additions
and
7 deletions
pom.xml
| ... | ... | @@ -26,7 +26,6 @@ |
| 26 | 26 | <generated.asciidoc.directory>${project.build.directory}/asciidoc</generated.asciidoc.directory> |
| 27 | 27 | <asciidoctor.html.output.directory>${project.build.directory}/asciidoc/html</asciidoctor.html.output.directory> |
| 28 | 28 | <asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory> |
| 29 | - <gson.version>2.8.6</gson.version> | |
| 30 | 29 | </properties> |
| 31 | 30 | |
| 32 | 31 | <dependencies> |
| ... | ... | @@ -153,11 +152,6 @@ |
| 153 | 152 | <artifactId>fastjson</artifactId> |
| 154 | 153 | <version>1.2.73</version> |
| 155 | 154 | </dependency> |
| 156 | - <!-- google json库 --> | |
| 157 | - <dependency> | |
| 158 | - <groupId>com.google.code.gson</groupId> | |
| 159 | - <artifactId>gson</artifactId> | |
| 160 | - </dependency> | |
| 161 | 155 | |
| 162 | 156 | <!--Guava是一种基于开源的Java库--> |
| 163 | 157 | <dependency> | ... | ... |
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java
| ... | ... | @@ -38,11 +38,15 @@ public class PlayController { |
| 38 | 38 | @Autowired |
| 39 | 39 | private ZLMRESTfulUtils zlmresTfulUtils; |
| 40 | 40 | |
| 41 | + @Value("${media.closeWaitRTPInfo}") | |
| 42 | + private boolean closeWaitRTPInfo; | |
| 43 | + | |
| 41 | 44 | @GetMapping("/play/{deviceId}/{channelId}") |
| 42 | 45 | public ResponseEntity<String> play(@PathVariable String deviceId, @PathVariable String channelId, |
| 43 | 46 | Integer getEncoding) { |
| 44 | 47 | |
| 45 | 48 | if (getEncoding == null) getEncoding = 0; |
| 49 | + getEncoding = closeWaitRTPInfo ? 0: getEncoding; | |
| 46 | 50 | Device device = storager.queryVideoDevice(deviceId); |
| 47 | 51 | StreamInfo streamInfo = storager.queryPlayByDevice(deviceId, channelId); |
| 48 | 52 | ... | ... |
src/main/resources/application.yml
| ... | ... | @@ -45,6 +45,7 @@ media: #zlm服务器的ip与http端口, 重点: 这是http端口 |
| 45 | 45 | port: 80 |
| 46 | 46 | secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc |
| 47 | 47 | streamNoneReaderDelayMS: 1800000 # 无人观看多久自动关闭流 |
| 48 | + closeWaitRTPInfo: false # 强制关闭等待收到流编码信息后在返回, 设为true可以快速打开播放窗口, 设为false保证返回后流就可以播放 | |
| 48 | 49 | rtp: # 启用udp多端口模式 |
| 49 | 50 | enable: true |
| 50 | 51 | udpPortRange: 30000,30500 # 端口范围 | ... | ... |