Commit 131ea7766924113f6d0b8d8d4c288084ae635a31
1 parent
850260ec
接口使用旧的stream信息,支持使用远程ip端口做为回复的地址而不是使用sip中的地址
Showing
15 changed files
with
503 additions
and
127 deletions
src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
| @@ -35,6 +35,8 @@ public class UserSetting { | @@ -35,6 +35,8 @@ public class UserSetting { | ||
| 35 | 35 | ||
| 36 | private Boolean useSourceIpAsStreamIp = Boolean.FALSE; | 36 | private Boolean useSourceIpAsStreamIp = Boolean.FALSE; |
| 37 | 37 | ||
| 38 | + private Boolean sipUseSourceIpAsRemoteAddress = Boolean.TRUE; | ||
| 39 | + | ||
| 38 | private Boolean streamOnDemand = Boolean.TRUE; | 40 | private Boolean streamOnDemand = Boolean.TRUE; |
| 39 | 41 | ||
| 40 | private Boolean pushAuthority = Boolean.TRUE; | 42 | private Boolean pushAuthority = Boolean.TRUE; |
| @@ -196,4 +198,12 @@ public class UserSetting { | @@ -196,4 +198,12 @@ public class UserSetting { | ||
| 196 | public void setSyncChannelOnDeviceOnline(Boolean syncChannelOnDeviceOnline) { | 198 | public void setSyncChannelOnDeviceOnline(Boolean syncChannelOnDeviceOnline) { |
| 197 | this.syncChannelOnDeviceOnline = syncChannelOnDeviceOnline; | 199 | this.syncChannelOnDeviceOnline = syncChannelOnDeviceOnline; |
| 198 | } | 200 | } |
| 201 | + | ||
| 202 | + public Boolean getSipUseSourceIpAsRemoteAddress() { | ||
| 203 | + return sipUseSourceIpAsRemoteAddress; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public void setSipUseSourceIpAsRemoteAddress(Boolean sipUseSourceIpAsRemoteAddress) { | ||
| 207 | + this.sipUseSourceIpAsRemoteAddress = sipUseSourceIpAsRemoteAddress; | ||
| 208 | + } | ||
| 199 | } | 209 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/bean/RemoteAddressInfo.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.gb28181.bean; | ||
| 2 | + | ||
| 3 | +public class RemoteAddressInfo { | ||
| 4 | + private String ip; | ||
| 5 | + private int port; | ||
| 6 | + | ||
| 7 | + public RemoteAddressInfo(String ip, int port) { | ||
| 8 | + this.ip = ip; | ||
| 9 | + this.port = port; | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + public String getIp() { | ||
| 13 | + return ip; | ||
| 14 | + } | ||
| 15 | + | ||
| 16 | + public void setIp(String ip) { | ||
| 17 | + this.ip = ip; | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public int getPort() { | ||
| 21 | + return port; | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + public void setPort(int port) { | ||
| 25 | + this.port = port; | ||
| 26 | + } | ||
| 27 | +} |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.SipConfig; | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | +import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; | 5 | import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; |
| 5 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 6 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 7 | +import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; | 8 | import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; |
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; | 10 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| 9 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; | 11 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| 10 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; | 12 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 13 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | ||
| 11 | import com.genersoft.iot.vmp.service.IDeviceService; | 14 | import com.genersoft.iot.vmp.service.IDeviceService; |
| 12 | import com.genersoft.iot.vmp.utils.DateUtil; | 15 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 13 | import gov.nist.javax.sip.RequestEventExt; | 16 | import gov.nist.javax.sip.RequestEventExt; |
| @@ -56,6 +59,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -56,6 +59,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 56 | @Autowired | 59 | @Autowired |
| 57 | private SIPSender sipSender; | 60 | private SIPSender sipSender; |
| 58 | 61 | ||
| 62 | + @Autowired | ||
| 63 | + private UserSetting userSetting; | ||
| 64 | + | ||
| 59 | @Override | 65 | @Override |
| 60 | public void afterPropertiesSet() throws Exception { | 66 | public void afterPropertiesSet() throws Exception { |
| 61 | // 添加消息处理的订阅 | 67 | // 添加消息处理的订阅 |
| @@ -125,15 +131,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -125,15 +131,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 125 | // 添加Expires头 | 131 | // 添加Expires头 |
| 126 | response.addHeader(request.getExpires()); | 132 | response.addHeader(request.getExpires()); |
| 127 | 133 | ||
| 128 | - // 获取到通信地址等信息 | ||
| 129 | - ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); | ||
| 130 | - String received = viaHeader.getReceived(); | ||
| 131 | - int rPort = viaHeader.getRPort(); | ||
| 132 | - // 解析本地地址替代 | ||
| 133 | - if (ObjectUtils.isEmpty(received) || rPort == -1) { | ||
| 134 | - received = viaHeader.getHost(); | ||
| 135 | - rPort = viaHeader.getPort(); | ||
| 136 | - } | 134 | + RemoteAddressInfo remoteAddressInfo = SipUtils.getRemoteAddressFromRequest(request, |
| 135 | + userSetting.getSipUseSourceIpAsRemoteAddress()); | ||
| 136 | + | ||
| 137 | if (device == null) { | 137 | if (device == null) { |
| 138 | device = new Device(); | 138 | device = new Device(); |
| 139 | device.setStreamMode("UDP"); | 139 | device.setStreamMode("UDP"); |
| @@ -143,9 +143,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -143,9 +143,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 143 | device.setDeviceId(deviceId); | 143 | device.setDeviceId(deviceId); |
| 144 | device.setOnline(0); | 144 | device.setOnline(0); |
| 145 | } | 145 | } |
| 146 | - device.setIp(received); | ||
| 147 | - device.setPort(rPort); | ||
| 148 | - device.setHostAddress(received.concat(":").concat(String.valueOf(rPort))); | 146 | + device.setIp(remoteAddressInfo.getIp()); |
| 147 | + device.setPort(remoteAddressInfo.getPort()); | ||
| 148 | + device.setHostAddress(remoteAddressInfo.getIp().concat(":").concat(String.valueOf(remoteAddressInfo.getPort()))); | ||
| 149 | device.setLocalIp(request.getLocalAddress().getHostAddress()); | 149 | device.setLocalIp(request.getLocalAddress().getHostAddress()); |
| 150 | if (request.getExpires().getExpires() == 0) { | 150 | if (request.getExpires().getExpires() == 0) { |
| 151 | // 注销成功 | 151 | // 注销成功 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.cmd; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.conf.UserSetting; | ||
| 3 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 5 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 5 | -import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | 6 | +import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; | 8 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.NotifyMessageHandler; | 9 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.NotifyMessageHandler; |
| 10 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | ||
| 9 | import com.genersoft.iot.vmp.service.IDeviceService; | 11 | import com.genersoft.iot.vmp.service.IDeviceService; |
| 10 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 11 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 12 | import com.genersoft.iot.vmp.utils.DateUtil; | 12 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 13 | import gov.nist.javax.sip.message.SIPRequest; | 13 | import gov.nist.javax.sip.message.SIPRequest; |
| 14 | import org.dom4j.Element; | 14 | import org.dom4j.Element; |
| @@ -17,13 +17,10 @@ import org.slf4j.LoggerFactory; | @@ -17,13 +17,10 @@ import org.slf4j.LoggerFactory; | ||
| 17 | import org.springframework.beans.factory.InitializingBean; | 17 | import org.springframework.beans.factory.InitializingBean; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 18 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.stereotype.Component; | 19 | import org.springframework.stereotype.Component; |
| 20 | -import org.springframework.util.ObjectUtils; | ||
| 21 | -import org.springframework.util.StringUtils; | ||
| 22 | 20 | ||
| 23 | import javax.sip.InvalidArgumentException; | 21 | import javax.sip.InvalidArgumentException; |
| 24 | import javax.sip.RequestEvent; | 22 | import javax.sip.RequestEvent; |
| 25 | import javax.sip.SipException; | 23 | import javax.sip.SipException; |
| 26 | -import javax.sip.header.ViaHeader; | ||
| 27 | import javax.sip.message.Response; | 24 | import javax.sip.message.Response; |
| 28 | import java.text.ParseException; | 25 | import java.text.ParseException; |
| 29 | 26 | ||
| @@ -33,6 +30,7 @@ import java.text.ParseException; | @@ -33,6 +30,7 @@ import java.text.ParseException; | ||
| 33 | @Component | 30 | @Component |
| 34 | public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { | 31 | public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent implements InitializingBean, IMessageHandler { |
| 35 | 32 | ||
| 33 | + | ||
| 36 | private Logger logger = LoggerFactory.getLogger(KeepaliveNotifyMessageHandler.class); | 34 | private Logger logger = LoggerFactory.getLogger(KeepaliveNotifyMessageHandler.class); |
| 37 | private final static String cmdType = "Keepalive"; | 35 | private final static String cmdType = "Keepalive"; |
| 38 | 36 | ||
| @@ -42,6 +40,9 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | @@ -42,6 +40,9 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | ||
| 42 | @Autowired | 40 | @Autowired |
| 43 | private IDeviceService deviceService; | 41 | private IDeviceService deviceService; |
| 44 | 42 | ||
| 43 | + @Autowired | ||
| 44 | + private UserSetting userSetting; | ||
| 45 | + | ||
| 45 | @Override | 46 | @Override |
| 46 | public void afterPropertiesSet() throws Exception { | 47 | public void afterPropertiesSet() throws Exception { |
| 47 | notifyMessageHandler.addHandler(cmdType, this); | 48 | notifyMessageHandler.addHandler(cmdType, this); |
| @@ -53,25 +54,19 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | @@ -53,25 +54,19 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | ||
| 53 | // 未注册的设备不做处理 | 54 | // 未注册的设备不做处理 |
| 54 | return; | 55 | return; |
| 55 | } | 56 | } |
| 57 | + SIPRequest request = (SIPRequest) evt.getRequest(); | ||
| 56 | // 回复200 OK | 58 | // 回复200 OK |
| 57 | try { | 59 | try { |
| 58 | - responseAck((SIPRequest) evt.getRequest(), Response.OK); | 60 | + responseAck(request, Response.OK); |
| 59 | } catch (SipException | InvalidArgumentException | ParseException e) { | 61 | } catch (SipException | InvalidArgumentException | ParseException e) { |
| 60 | - logger.error("[命令发送失败] 国标级联 心跳回复: {}", e.getMessage()); | 62 | + logger.error("[命令发送失败] 心跳回复: {}", e.getMessage()); |
| 61 | } | 63 | } |
| 62 | - // 判断RPort是否改变,改变则说明路由nat信息变化,修改设备信息 | ||
| 63 | - // 获取到通信地址等信息 | ||
| 64 | - ViaHeader viaHeader = (ViaHeader) evt.getRequest().getHeader(ViaHeader.NAME); | ||
| 65 | - String received = viaHeader.getReceived(); | ||
| 66 | - int rPort = viaHeader.getRPort(); | ||
| 67 | - // 解析本地地址替代 | ||
| 68 | - if (ObjectUtils.isEmpty(received) || rPort == -1) { | ||
| 69 | - received = viaHeader.getHost(); | ||
| 70 | - rPort = viaHeader.getPort(); | ||
| 71 | - } | ||
| 72 | - if (device.getPort() != rPort) { | ||
| 73 | - device.setPort(rPort); | ||
| 74 | - device.setHostAddress(received.concat(":").concat(String.valueOf(rPort))); | 64 | + |
| 65 | + RemoteAddressInfo remoteAddressInfo = SipUtils.getRemoteAddressFromRequest(request, userSetting.getSipUseSourceIpAsRemoteAddress()); | ||
| 66 | + if (!device.getIp().equalsIgnoreCase(remoteAddressInfo.getIp()) || device.getPort() != remoteAddressInfo.getPort()) { | ||
| 67 | + device.setPort(remoteAddressInfo.getPort()); | ||
| 68 | + device.setHostAddress(remoteAddressInfo.getIp().concat(":").concat(String.valueOf(remoteAddressInfo.getPort()))); | ||
| 69 | + device.setIp(remoteAddressInfo.getIp()); | ||
| 75 | } | 70 | } |
| 76 | device.setKeepaliveTime(DateUtil.getNow()); | 71 | device.setKeepaliveTime(DateUtil.getNow()); |
| 77 | 72 |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java
| 1 | package com.genersoft.iot.vmp.gb28181.utils; | 1 | package com.genersoft.iot.vmp.gb28181.utils; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.gb28181.bean.RemoteAddressInfo; | ||
| 3 | import com.genersoft.iot.vmp.utils.GitUtil; | 4 | import com.genersoft.iot.vmp.utils.GitUtil; |
| 4 | import gov.nist.javax.sip.address.AddressImpl; | 5 | import gov.nist.javax.sip.address.AddressImpl; |
| 5 | import gov.nist.javax.sip.address.SipUri; | 6 | import gov.nist.javax.sip.address.SipUri; |
| 6 | import gov.nist.javax.sip.header.Subject; | 7 | import gov.nist.javax.sip.header.Subject; |
| 8 | +import gov.nist.javax.sip.message.SIPRequest; | ||
| 7 | import org.springframework.util.ObjectUtils; | 9 | import org.springframework.util.ObjectUtils; |
| 8 | 10 | ||
| 9 | import javax.sip.PeerUnavailableException; | 11 | import javax.sip.PeerUnavailableException; |
| @@ -119,4 +121,25 @@ public class SipUtils { | @@ -119,4 +121,25 @@ public class SipUtils { | ||
| 119 | return builder.toString(); | 121 | return builder.toString(); |
| 120 | } | 122 | } |
| 121 | 123 | ||
| 124 | + public static RemoteAddressInfo getRemoteAddressFromRequest(SIPRequest request, boolean sipUseSourceIpAsRemoteAddress) { | ||
| 125 | + | ||
| 126 | + String remoteAddress; | ||
| 127 | + int remotePort; | ||
| 128 | + if (sipUseSourceIpAsRemoteAddress) { | ||
| 129 | + remoteAddress = request.getRemoteAddress().getHostAddress(); | ||
| 130 | + remotePort = request.getRemotePort(); | ||
| 131 | + }else { | ||
| 132 | + // 判断RPort是否改变,改变则说明路由nat信息变化,修改设备信息 | ||
| 133 | + // 获取到通信地址等信息 | ||
| 134 | + remoteAddress = request.getTopmostViaHeader().getReceived(); | ||
| 135 | + remotePort = request.getTopmostViaHeader().getPort(); | ||
| 136 | + // 解析本地地址替代 | ||
| 137 | + if (ObjectUtils.isEmpty(remoteAddress) || remotePort == -1) { | ||
| 138 | + remoteAddress = request.getViaHost(); | ||
| 139 | + remotePort = request.getViaPort(); | ||
| 140 | + } | ||
| 141 | + } | ||
| 142 | + | ||
| 143 | + return new RemoteAddressInfo(remoteAddress, remotePort); | ||
| 144 | + } | ||
| 122 | } | 145 | } |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| @@ -18,6 +18,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.hook.*; | @@ -18,6 +18,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.hook.*; | ||
| 18 | import com.genersoft.iot.vmp.service.*; | 18 | import com.genersoft.iot.vmp.service.*; |
| 19 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 19 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 20 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 20 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 21 | +import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 21 | import org.slf4j.Logger; | 22 | import org.slf4j.Logger; |
| 22 | import org.slf4j.LoggerFactory; | 23 | import org.slf4j.LoggerFactory; |
| 23 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -347,7 +348,7 @@ public class ZLMHttpHookListener { | @@ -347,7 +348,7 @@ public class ZLMHttpHookListener { | ||
| 347 | } | 348 | } |
| 348 | StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, | 349 | StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, |
| 349 | param.getApp(), param.getStream(), tracks, callId); | 350 | param.getApp(), param.getStream(), tracks, callId); |
| 350 | - param.setStreamInfo(streamInfoByAppAndStream); | 351 | + param.setStreamInfo(new StreamContent(streamInfoByAppAndStream)); |
| 351 | redisCatchStorage.addStream(mediaServerItem, type, param.getApp(), param.getStream(), param); | 352 | redisCatchStorage.addStream(mediaServerItem, type, param.getApp(), param.getStream(), param); |
| 352 | if (param.getOriginType() == OriginType.RTSP_PUSH.ordinal() | 353 | if (param.getOriginType() == OriginType.RTSP_PUSH.ordinal() |
| 353 | || param.getOriginType() == OriginType.RTMP_PUSH.ordinal() | 354 | || param.getOriginType() == OriginType.RTMP_PUSH.ordinal() |
| @@ -364,7 +365,7 @@ public class ZLMHttpHookListener { | @@ -364,7 +365,7 @@ public class ZLMHttpHookListener { | ||
| 364 | } | 365 | } |
| 365 | GbStream gbStream = storager.getGbStream(param.getApp(), param.getStream()); | 366 | GbStream gbStream = storager.getGbStream(param.getApp(), param.getStream()); |
| 366 | if (gbStream != null) { | 367 | if (gbStream != null) { |
| 367 | -// eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF); | 368 | +// eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF); |
| 368 | } | 369 | } |
| 369 | zlmMediaListManager.removeMedia(param.getApp(), param.getStream()); | 370 | zlmMediaListManager.removeMedia(param.getApp(), param.getStream()); |
| 370 | } | 371 | } |
| @@ -527,7 +528,7 @@ public class ZLMHttpHookListener { | @@ -527,7 +528,7 @@ public class ZLMHttpHookListener { | ||
| 527 | @ResponseBody | 528 | @ResponseBody |
| 528 | @PostMapping(value = "/on_stream_not_found", produces = "application/json;charset=UTF-8") | 529 | @PostMapping(value = "/on_stream_not_found", produces = "application/json;charset=UTF-8") |
| 529 | public JSONObject onStreamNotFound(@RequestBody OnStreamNotFoundHookParam param){ | 530 | public JSONObject onStreamNotFound(@RequestBody OnStreamNotFoundHookParam param){ |
| 530 | - logger.info("[ZLM HOOK] 流未找到:{}->{}->{}/{}" + param.getMediaServerId(), param.getSchema(), param.getApp(), param.getStream()); | 531 | + logger.info("[ZLM HOOK] 流未找到:{}->{}->{}/{}", param.getMediaServerId(), param.getSchema(), param.getApp(), param.getStream()); |
| 531 | taskExecutor.execute(()->{ | 532 | taskExecutor.execute(()->{ |
| 532 | MediaServerItem mediaInfo = mediaServerService.getOne(param.getMediaServerId()); | 533 | MediaServerItem mediaInfo = mediaServerService.getOne(param.getMediaServerId()); |
| 533 | if (userSetting.isAutoApplyPlay() && mediaInfo != null) { | 534 | if (userSetting.isAutoApplyPlay() && mediaInfo != null) { |
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/hook/OnStreamChangedHookParam.java
| 1 | package com.genersoft.iot.vmp.media.zlm.dto.hook; | 1 | package com.genersoft.iot.vmp.media.zlm.dto.hook; |
| 2 | 2 | ||
| 3 | -import com.genersoft.iot.vmp.common.StreamInfo; | 3 | +import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| 4 | 4 | ||
| 5 | import java.util.List; | 5 | import java.util.List; |
| 6 | 6 | ||
| @@ -291,7 +291,7 @@ public class OnStreamChangedHookParam extends HookParam{ | @@ -291,7 +291,7 @@ public class OnStreamChangedHookParam extends HookParam{ | ||
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | - private StreamInfo streamInfo; | 294 | + private StreamContent streamInfo; |
| 295 | 295 | ||
| 296 | public String getApp() { | 296 | public String getApp() { |
| 297 | return app; | 297 | return app; |
| @@ -407,11 +407,11 @@ public class OnStreamChangedHookParam extends HookParam{ | @@ -407,11 +407,11 @@ public class OnStreamChangedHookParam extends HookParam{ | ||
| 407 | this.docker = docker; | 407 | this.docker = docker; |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | - public StreamInfo getStreamInfo() { | 410 | + public StreamContent getStreamInfo() { |
| 411 | return streamInfo; | 411 | return streamInfo; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | - public void setStreamInfo(StreamInfo streamInfo) { | 414 | + public void setStreamInfo(StreamContent streamInfo) { |
| 415 | this.streamInfo = streamInfo; | 415 | this.streamInfo = streamInfo; |
| 416 | } | 416 | } |
| 417 | 417 |
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
| @@ -332,7 +332,6 @@ public class DeviceServiceImpl implements IDeviceService { | @@ -332,7 +332,6 @@ public class DeviceServiceImpl implements IDeviceService { | ||
| 332 | device.setUpdateTime(DateUtil.getNow()); | 332 | device.setUpdateTime(DateUtil.getNow()); |
| 333 | if (deviceMapper.update(device) > 0) { | 333 | if (deviceMapper.update(device) > 0) { |
| 334 | redisCatchStorage.updateDevice(device); | 334 | redisCatchStorage.updateDevice(device); |
| 335 | - | ||
| 336 | } | 335 | } |
| 337 | } | 336 | } |
| 338 | 337 |
src/main/java/com/genersoft/iot/vmp/vmanager/bean/StreamContent.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.vmanager.bean; | ||
| 2 | + | ||
| 3 | +import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 4 | + | ||
| 5 | +public class StreamContent { | ||
| 6 | + | ||
| 7 | + private String app; | ||
| 8 | + private String stream; | ||
| 9 | + | ||
| 10 | + private String ip; | ||
| 11 | + | ||
| 12 | + private String flv; | ||
| 13 | + | ||
| 14 | + private String https_flv; | ||
| 15 | + private String ws_flv; | ||
| 16 | + private String wss_flv; | ||
| 17 | + private String fmp4; | ||
| 18 | + private String https_fmp4; | ||
| 19 | + private String ws_fmp4; | ||
| 20 | + private String wss_fmp4; | ||
| 21 | + private String hls; | ||
| 22 | + private String https_hls; | ||
| 23 | + private String ws_hls; | ||
| 24 | + private String wss_hls; | ||
| 25 | + private String ts; | ||
| 26 | + private String https_ts; | ||
| 27 | + private String ws_ts; | ||
| 28 | + private String wss_ts; | ||
| 29 | + private String rtmp; | ||
| 30 | + private String rtmps; | ||
| 31 | + private String rtsp; | ||
| 32 | + private String rtsps; | ||
| 33 | + private String rtc; | ||
| 34 | + | ||
| 35 | + private String rtcs; | ||
| 36 | + private String mediaServerId; | ||
| 37 | + private Object tracks; | ||
| 38 | + | ||
| 39 | + public StreamContent(StreamInfo streamInfo) { | ||
| 40 | + if (streamInfo == null) { | ||
| 41 | + return; | ||
| 42 | + } | ||
| 43 | + this.app = streamInfo.getApp(); | ||
| 44 | + this.stream = streamInfo.getStream(); | ||
| 45 | + if (streamInfo.getFlv() != null) { | ||
| 46 | + this.flv = streamInfo.getFlv().getUrl(); | ||
| 47 | + } | ||
| 48 | + if (streamInfo.getHttps_flv() != null) { | ||
| 49 | + this.https_flv = streamInfo.getHttps_flv().getUrl(); | ||
| 50 | + } | ||
| 51 | + if (streamInfo.getWs_flv() != null) { | ||
| 52 | + this.ws_flv = streamInfo.getWs_flv().getUrl(); | ||
| 53 | + } | ||
| 54 | + if (streamInfo.getWss_flv() != null) { | ||
| 55 | + this.wss_flv = streamInfo.getWss_flv().getUrl(); | ||
| 56 | + } | ||
| 57 | + if (streamInfo.getFmp4() != null) { | ||
| 58 | + this.fmp4 = streamInfo.getFmp4().getUrl(); | ||
| 59 | + } | ||
| 60 | + if (streamInfo.getWs_fmp4() != null) { | ||
| 61 | + this.ws_fmp4 = streamInfo.getWs_fmp4().getUrl(); | ||
| 62 | + } | ||
| 63 | + if (streamInfo.getWss_fmp4() != null) { | ||
| 64 | + this.wss_fmp4 = streamInfo.getWss_fmp4().getUrl(); | ||
| 65 | + } | ||
| 66 | + if (streamInfo.getHls() != null) { | ||
| 67 | + this.hls = streamInfo.getHls().getUrl(); | ||
| 68 | + } | ||
| 69 | + if (streamInfo.getHttps_hls() != null) { | ||
| 70 | + this.https_hls = streamInfo.getHttps_hls().getUrl(); | ||
| 71 | + } | ||
| 72 | + if (streamInfo.getWs_hls() != null) { | ||
| 73 | + this.ws_hls = streamInfo.getWs_hls().getUrl(); | ||
| 74 | + } | ||
| 75 | + if (streamInfo.getWss_hls() != null) { | ||
| 76 | + this.wss_hls = streamInfo.getWss_hls().getUrl(); | ||
| 77 | + } | ||
| 78 | + if (streamInfo.getTs() != null) { | ||
| 79 | + this.ts = streamInfo.getTs().getUrl(); | ||
| 80 | + } | ||
| 81 | + if (streamInfo.getHttps_ts() != null) { | ||
| 82 | + this.https_ts = streamInfo.getHttps_ts().getUrl(); | ||
| 83 | + } | ||
| 84 | + if (streamInfo.getWs_ts() != null) { | ||
| 85 | + this.ws_ts = streamInfo.getWs_ts().getUrl(); | ||
| 86 | + } | ||
| 87 | + if (streamInfo.getRtmp() != null) { | ||
| 88 | + this.rtmp = streamInfo.getRtmp().getUrl(); | ||
| 89 | + } | ||
| 90 | + if (streamInfo.getRtmps() != null) { | ||
| 91 | + this.rtmps = streamInfo.getRtmps().getUrl(); | ||
| 92 | + } | ||
| 93 | + if (streamInfo.getRtsp() != null) { | ||
| 94 | + this.rtsp = streamInfo.getRtsp().getUrl(); | ||
| 95 | + } | ||
| 96 | + if (streamInfo.getRtsps() != null) { | ||
| 97 | + this.rtsps = streamInfo.getRtsps().getUrl(); | ||
| 98 | + } | ||
| 99 | + if (streamInfo.getRtc() != null) { | ||
| 100 | + this.rtc = streamInfo.getRtc().getUrl(); | ||
| 101 | + } | ||
| 102 | + if (streamInfo.getRtcs() != null) { | ||
| 103 | + this.rtcs = streamInfo.getRtcs().getUrl(); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + this.mediaServerId = streamInfo.getMediaServerId(); | ||
| 107 | + this.tracks = streamInfo.getTracks(); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public String getApp() { | ||
| 111 | + return app; | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + public void setApp(String app) { | ||
| 115 | + this.app = app; | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + public String getStream() { | ||
| 119 | + return stream; | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + public void setStream(String stream) { | ||
| 123 | + this.stream = stream; | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + public String getIp() { | ||
| 127 | + return ip; | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public void setIp(String ip) { | ||
| 131 | + this.ip = ip; | ||
| 132 | + } | ||
| 133 | + | ||
| 134 | + public String getFlv() { | ||
| 135 | + return flv; | ||
| 136 | + } | ||
| 137 | + | ||
| 138 | + public void setFlv(String flv) { | ||
| 139 | + this.flv = flv; | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + public String getHttps_flv() { | ||
| 143 | + return https_flv; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + public void setHttps_flv(String https_flv) { | ||
| 147 | + this.https_flv = https_flv; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public String getWs_flv() { | ||
| 151 | + return ws_flv; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + public void setWs_flv(String ws_flv) { | ||
| 155 | + this.ws_flv = ws_flv; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + public String getWss_flv() { | ||
| 159 | + return wss_flv; | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + public void setWss_flv(String wss_flv) { | ||
| 163 | + this.wss_flv = wss_flv; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public String getFmp4() { | ||
| 167 | + return fmp4; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public void setFmp4(String fmp4) { | ||
| 171 | + this.fmp4 = fmp4; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + public String getHttps_fmp4() { | ||
| 175 | + return https_fmp4; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public void setHttps_fmp4(String https_fmp4) { | ||
| 179 | + this.https_fmp4 = https_fmp4; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + public String getWs_fmp4() { | ||
| 183 | + return ws_fmp4; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + public void setWs_fmp4(String ws_fmp4) { | ||
| 187 | + this.ws_fmp4 = ws_fmp4; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + public String getWss_fmp4() { | ||
| 191 | + return wss_fmp4; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + public void setWss_fmp4(String wss_fmp4) { | ||
| 195 | + this.wss_fmp4 = wss_fmp4; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + public String getHls() { | ||
| 199 | + return hls; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + public void setHls(String hls) { | ||
| 203 | + this.hls = hls; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public String getHttps_hls() { | ||
| 207 | + return https_hls; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + public void setHttps_hls(String https_hls) { | ||
| 211 | + this.https_hls = https_hls; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + public String getWs_hls() { | ||
| 215 | + return ws_hls; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + public void setWs_hls(String ws_hls) { | ||
| 219 | + this.ws_hls = ws_hls; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + public String getWss_hls() { | ||
| 223 | + return wss_hls; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public void setWss_hls(String wss_hls) { | ||
| 227 | + this.wss_hls = wss_hls; | ||
| 228 | + } | ||
| 229 | + | ||
| 230 | + public String getTs() { | ||
| 231 | + return ts; | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + public void setTs(String ts) { | ||
| 235 | + this.ts = ts; | ||
| 236 | + } | ||
| 237 | + | ||
| 238 | + public String getHttps_ts() { | ||
| 239 | + return https_ts; | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + public void setHttps_ts(String https_ts) { | ||
| 243 | + this.https_ts = https_ts; | ||
| 244 | + } | ||
| 245 | + | ||
| 246 | + public String getWs_ts() { | ||
| 247 | + return ws_ts; | ||
| 248 | + } | ||
| 249 | + | ||
| 250 | + public void setWs_ts(String ws_ts) { | ||
| 251 | + this.ws_ts = ws_ts; | ||
| 252 | + } | ||
| 253 | + | ||
| 254 | + public String getWss_ts() { | ||
| 255 | + return wss_ts; | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + public void setWss_ts(String wss_ts) { | ||
| 259 | + this.wss_ts = wss_ts; | ||
| 260 | + } | ||
| 261 | + | ||
| 262 | + public String getRtmp() { | ||
| 263 | + return rtmp; | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + public void setRtmp(String rtmp) { | ||
| 267 | + this.rtmp = rtmp; | ||
| 268 | + } | ||
| 269 | + | ||
| 270 | + public String getRtmps() { | ||
| 271 | + return rtmps; | ||
| 272 | + } | ||
| 273 | + | ||
| 274 | + public void setRtmps(String rtmps) { | ||
| 275 | + this.rtmps = rtmps; | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + public String getRtsp() { | ||
| 279 | + return rtsp; | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + public void setRtsp(String rtsp) { | ||
| 283 | + this.rtsp = rtsp; | ||
| 284 | + } | ||
| 285 | + | ||
| 286 | + public String getRtsps() { | ||
| 287 | + return rtsps; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + public void setRtsps(String rtsps) { | ||
| 291 | + this.rtsps = rtsps; | ||
| 292 | + } | ||
| 293 | + | ||
| 294 | + public String getRtc() { | ||
| 295 | + return rtc; | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + public void setRtc(String rtc) { | ||
| 299 | + this.rtc = rtc; | ||
| 300 | + } | ||
| 301 | + | ||
| 302 | + public String getRtcs() { | ||
| 303 | + return rtcs; | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + public void setRtcs(String rtcs) { | ||
| 307 | + this.rtcs = rtcs; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + public String getMediaServerId() { | ||
| 311 | + return mediaServerId; | ||
| 312 | + } | ||
| 313 | + | ||
| 314 | + public void setMediaServerId(String mediaServerId) { | ||
| 315 | + this.mediaServerId = mediaServerId; | ||
| 316 | + } | ||
| 317 | + | ||
| 318 | + public Object getTracks() { | ||
| 319 | + return tracks; | ||
| 320 | + } | ||
| 321 | + | ||
| 322 | + public void setTracks(Object tracks) { | ||
| 323 | + this.tracks = tracks; | ||
| 324 | + } | ||
| 325 | +} |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/media/MediaController.java
| @@ -5,10 +5,11 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException; | @@ -5,10 +5,11 @@ import com.genersoft.iot.vmp.conf.exception.ControllerException; | ||
| 5 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; | 5 | import com.genersoft.iot.vmp.conf.security.SecurityUtils; |
| 6 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; | 6 | import com.genersoft.iot.vmp.conf.security.dto.LoginUser; |
| 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; | 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; |
| 8 | -import com.genersoft.iot.vmp.service.IStreamProxyService; | ||
| 9 | import com.genersoft.iot.vmp.service.IMediaService; | 8 | import com.genersoft.iot.vmp.service.IMediaService; |
| 9 | +import com.genersoft.iot.vmp.service.IStreamProxyService; | ||
| 10 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 10 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 11 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 11 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 12 | +import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 12 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 13 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 13 | import io.swagger.v3.oas.annotations.Operation; | 14 | import io.swagger.v3.oas.annotations.Operation; |
| 14 | import io.swagger.v3.oas.annotations.Parameter; | 15 | import io.swagger.v3.oas.annotations.Parameter; |
| @@ -53,11 +54,11 @@ public class MediaController { | @@ -53,11 +54,11 @@ public class MediaController { | ||
| 53 | @Parameter(name = "useSourceIpAsStreamIp", description = "是否使用请求IP作为返回的地址IP") | 54 | @Parameter(name = "useSourceIpAsStreamIp", description = "是否使用请求IP作为返回的地址IP") |
| 54 | @GetMapping(value = "/stream_info_by_app_and_stream") | 55 | @GetMapping(value = "/stream_info_by_app_and_stream") |
| 55 | @ResponseBody | 56 | @ResponseBody |
| 56 | - public StreamInfo getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app, | ||
| 57 | - @RequestParam String stream, | ||
| 58 | - @RequestParam(required = false) String mediaServerId, | ||
| 59 | - @RequestParam(required = false) String callId, | ||
| 60 | - @RequestParam(required = false) Boolean useSourceIpAsStreamIp){ | 57 | + public StreamContent getStreamInfoByAppAndStream(HttpServletRequest request, @RequestParam String app, |
| 58 | + @RequestParam String stream, | ||
| 59 | + @RequestParam(required = false) String mediaServerId, | ||
| 60 | + @RequestParam(required = false) String callId, | ||
| 61 | + @RequestParam(required = false) Boolean useSourceIpAsStreamIp){ | ||
| 61 | boolean authority = false; | 62 | boolean authority = false; |
| 62 | if (callId != null) { | 63 | if (callId != null) { |
| 63 | // 权限校验 | 64 | // 权限校验 |
| @@ -90,7 +91,7 @@ public class MediaController { | @@ -90,7 +91,7 @@ public class MediaController { | ||
| 90 | 91 | ||
| 91 | WVPResult<StreamInfo> result = new WVPResult<>(); | 92 | WVPResult<StreamInfo> result = new WVPResult<>(); |
| 92 | if (streamInfo != null){ | 93 | if (streamInfo != null){ |
| 93 | - return streamInfo; | 94 | + return new StreamContent(streamInfo); |
| 94 | }else { | 95 | }else { |
| 95 | //获取流失败,重启拉流后重试一次 | 96 | //获取流失败,重启拉流后重试一次 |
| 96 | streamProxyService.stop(app,stream); | 97 | streamProxyService.stop(app,stream); |
| @@ -109,7 +110,7 @@ public class MediaController { | @@ -109,7 +110,7 @@ public class MediaController { | ||
| 109 | streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority); | 110 | streamInfo = mediaService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority); |
| 110 | } | 111 | } |
| 111 | if (streamInfo != null){ | 112 | if (streamInfo != null){ |
| 112 | - return streamInfo; | 113 | + return new StreamContent(streamInfo); |
| 113 | }else { | 114 | }else { |
| 114 | throw new ControllerException(ErrorCode.ERROR100); | 115 | throw new ControllerException(ErrorCode.ERROR100); |
| 115 | } | 116 | } |
src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
| @@ -21,6 +21,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | @@ -21,6 +21,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 21 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 21 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 22 | import com.genersoft.iot.vmp.vmanager.bean.DeferredResultEx; | 22 | import com.genersoft.iot.vmp.vmanager.bean.DeferredResultEx; |
| 23 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 23 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 24 | +import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 24 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 25 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 25 | import io.swagger.v3.oas.annotations.Operation; | 26 | import io.swagger.v3.oas.annotations.Operation; |
| 26 | import io.swagger.v3.oas.annotations.Parameter; | 27 | import io.swagger.v3.oas.annotations.Parameter; |
| @@ -80,8 +81,8 @@ public class PlayController { | @@ -80,8 +81,8 @@ public class PlayController { | ||
| 80 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 81 | @Parameter(name = "deviceId", description = "设备国标编号", required = true) |
| 81 | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 82 | @Parameter(name = "channelId", description = "通道国标编号", required = true) |
| 82 | @GetMapping("/start/{deviceId}/{channelId}") | 83 | @GetMapping("/start/{deviceId}/{channelId}") |
| 83 | - public DeferredResult<WVPResult<StreamInfo>> play(HttpServletRequest request, @PathVariable String deviceId, | ||
| 84 | - @PathVariable String channelId) { | 84 | + public DeferredResult<WVPResult<StreamContent>> play(HttpServletRequest request, @PathVariable String deviceId, |
| 85 | + @PathVariable String channelId) { | ||
| 85 | 86 | ||
| 86 | // 获取可用的zlm | 87 | // 获取可用的zlm |
| 87 | Device device = storager.queryVideoDevice(deviceId); | 88 | Device device = storager.queryVideoDevice(deviceId); |
| @@ -93,8 +94,8 @@ public class PlayController { | @@ -93,8 +94,8 @@ public class PlayController { | ||
| 93 | msg.setKey(key); | 94 | msg.setKey(key); |
| 94 | String uuid = UUID.randomUUID().toString(); | 95 | String uuid = UUID.randomUUID().toString(); |
| 95 | msg.setId(uuid); | 96 | msg.setId(uuid); |
| 96 | - DeferredResult<WVPResult<StreamInfo>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue()); | ||
| 97 | - DeferredResultEx<WVPResult<StreamInfo>> deferredResultEx = new DeferredResultEx<>(result); | 97 | + DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue()); |
| 98 | + DeferredResultEx<WVPResult<StreamContent>> deferredResultEx = new DeferredResultEx<>(result); | ||
| 98 | 99 | ||
| 99 | result.onTimeout(()->{ | 100 | result.onTimeout(()->{ |
| 100 | logger.info("点播接口等待超时"); | 101 | logger.info("点播接口等待超时"); |
| @@ -106,24 +107,24 @@ public class PlayController { | @@ -106,24 +107,24 @@ public class PlayController { | ||
| 106 | resultHolder.invokeResult(msg); | 107 | resultHolder.invokeResult(msg); |
| 107 | }); | 108 | }); |
| 108 | 109 | ||
| 109 | - if (userSetting.getUseSourceIpAsStreamIp()) { | 110 | + |
| 110 | // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误 | 111 | // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误 |
| 111 | deferredResultEx.setFilter(result1 -> { | 112 | deferredResultEx.setFilter(result1 -> { |
| 112 | WVPResult<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1; | 113 | WVPResult<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1; |
| 113 | - WVPResult<StreamInfo> clone = null; | ||
| 114 | - try { | ||
| 115 | - clone = (WVPResult<StreamInfo>)wvpResult1.clone(); | ||
| 116 | - } catch (CloneNotSupportedException e) { | ||
| 117 | - throw new RuntimeException(e); | ||
| 118 | - } | ||
| 119 | - if (clone.getCode() == ErrorCode.SUCCESS.getCode()) { | ||
| 120 | - StreamInfo data = clone.getData().clone(); | ||
| 121 | - data.channgeStreamIp(request.getLocalName()); | ||
| 122 | - clone.setData(data); | 114 | + WVPResult<StreamContent> resultStream = null; |
| 115 | + if (wvpResult1.getCode() == ErrorCode.SUCCESS.getCode()) { | ||
| 116 | + StreamInfo data = wvpResult1.getData().clone(); | ||
| 117 | + if (userSetting.getUseSourceIpAsStreamIp()) { | ||
| 118 | + data.channgeStreamIp(request.getLocalName()); | ||
| 119 | + } | ||
| 120 | + resultStream = new WVPResult<>(); | ||
| 121 | + resultStream.setCode(wvpResult1.getCode()); | ||
| 122 | + resultStream.setMsg(wvpResult1.getMsg()); | ||
| 123 | + resultStream.setData(new StreamContent(wvpResult1.getData())); | ||
| 123 | } | 124 | } |
| 124 | - return clone; | 125 | + return resultStream; |
| 125 | }); | 126 | }); |
| 126 | - } | 127 | + |
| 127 | 128 | ||
| 128 | // 录像查询以channelId作为deviceId查询 | 129 | // 录像查询以channelId作为deviceId查询 |
| 129 | resultHolder.put(key, uuid, deferredResultEx); | 130 | resultHolder.put(key, uuid, deferredResultEx); |
src/main/java/com/genersoft/iot/vmp/vmanager/streamProxy/StreamProxyController.java
| 1 | package com.genersoft.iot.vmp.vmanager.streamProxy; | 1 | package com.genersoft.iot.vmp.vmanager.streamProxy; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson2.JSONObject; | 3 | import com.alibaba.fastjson2.JSONObject; |
| 4 | -import com.genersoft.iot.vmp.common.StreamInfo; | ||
| 5 | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 4 | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| 6 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 5 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 7 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | 6 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| 8 | import com.genersoft.iot.vmp.service.IMediaServerService; | 7 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 9 | import com.genersoft.iot.vmp.service.IStreamProxyService; | 8 | import com.genersoft.iot.vmp.service.IStreamProxyService; |
| 10 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 9 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 10 | +import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | ||
| 11 | import com.github.pagehelper.PageInfo; | 11 | import com.github.pagehelper.PageInfo; |
| 12 | import io.swagger.v3.oas.annotations.Operation; | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | import io.swagger.v3.oas.annotations.Parameter; | 13 | import io.swagger.v3.oas.annotations.Parameter; |
| @@ -58,7 +58,7 @@ public class StreamProxyController { | @@ -58,7 +58,7 @@ public class StreamProxyController { | ||
| 58 | }) | 58 | }) |
| 59 | @PostMapping(value = "/save") | 59 | @PostMapping(value = "/save") |
| 60 | @ResponseBody | 60 | @ResponseBody |
| 61 | - public StreamInfo save(@RequestBody StreamProxyItem param){ | 61 | + public StreamContent save(@RequestBody StreamProxyItem param){ |
| 62 | logger.info("添加代理: " + JSONObject.toJSONString(param)); | 62 | logger.info("添加代理: " + JSONObject.toJSONString(param)); |
| 63 | if (ObjectUtils.isEmpty(param.getMediaServerId())) { | 63 | if (ObjectUtils.isEmpty(param.getMediaServerId())) { |
| 64 | param.setMediaServerId("auto"); | 64 | param.setMediaServerId("auto"); |
| @@ -69,7 +69,7 @@ public class StreamProxyController { | @@ -69,7 +69,7 @@ public class StreamProxyController { | ||
| 69 | if (ObjectUtils.isEmpty(param.getGbId())) { | 69 | if (ObjectUtils.isEmpty(param.getGbId())) { |
| 70 | param.setGbId(null); | 70 | param.setGbId(null); |
| 71 | } | 71 | } |
| 72 | - return streamProxyService.save(param); | 72 | + return new StreamContent(streamProxyService.save(param)); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | @GetMapping(value = "/ffmpeg_cmd/list") | 75 | @GetMapping(value = "/ffmpeg_cmd/list") |
src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java
| @@ -11,22 +11,16 @@ import com.genersoft.iot.vmp.conf.security.dto.LoginUser; | @@ -11,22 +11,16 @@ import com.genersoft.iot.vmp.conf.security.dto.LoginUser; | ||
| 11 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; | 11 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 12 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 12 | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; |
| 13 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 13 | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| 14 | -import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; | ||
| 15 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | 14 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| 16 | import com.genersoft.iot.vmp.service.IMediaServerService; | 15 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 17 | import com.genersoft.iot.vmp.service.IMediaService; | 16 | import com.genersoft.iot.vmp.service.IMediaService; |
| 18 | import com.genersoft.iot.vmp.service.IStreamPushService; | 17 | import com.genersoft.iot.vmp.service.IStreamPushService; |
| 19 | import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler; | 18 | import com.genersoft.iot.vmp.service.impl.StreamPushUploadFileHandler; |
| 20 | -import com.genersoft.iot.vmp.vmanager.bean.BatchGBStreamParam; | ||
| 21 | -import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 22 | -import com.genersoft.iot.vmp.vmanager.bean.StreamPushExcelDto; | ||
| 23 | -import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 19 | +import com.genersoft.iot.vmp.vmanager.bean.*; |
| 24 | import com.github.pagehelper.PageInfo; | 20 | import com.github.pagehelper.PageInfo; |
| 25 | - | ||
| 26 | import io.swagger.v3.oas.annotations.Operation; | 21 | import io.swagger.v3.oas.annotations.Operation; |
| 27 | import io.swagger.v3.oas.annotations.Parameter; | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 28 | import io.swagger.v3.oas.annotations.tags.Tag; | 23 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 29 | -import org.apache.poi.sl.usermodel.Sheet; | ||
| 30 | import org.slf4j.Logger; | 24 | import org.slf4j.Logger; |
| 31 | import org.slf4j.LoggerFactory; | 25 | import org.slf4j.LoggerFactory; |
| 32 | import org.springframework.beans.factory.annotation.Autowired; | 26 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -34,12 +28,10 @@ import org.springframework.http.HttpStatus; | @@ -34,12 +28,10 @@ import org.springframework.http.HttpStatus; | ||
| 34 | import org.springframework.http.ResponseEntity; | 28 | import org.springframework.http.ResponseEntity; |
| 35 | import org.springframework.stereotype.Controller; | 29 | import org.springframework.stereotype.Controller; |
| 36 | import org.springframework.util.ObjectUtils; | 30 | import org.springframework.util.ObjectUtils; |
| 37 | -import org.springframework.util.StringUtils; | ||
| 38 | import org.springframework.web.bind.annotation.*; | 31 | import org.springframework.web.bind.annotation.*; |
| 39 | import org.springframework.web.context.request.async.DeferredResult; | 32 | import org.springframework.web.context.request.async.DeferredResult; |
| 40 | import org.springframework.web.multipart.MultipartFile; | 33 | import org.springframework.web.multipart.MultipartFile; |
| 41 | 34 | ||
| 42 | -import javax.servlet.http.HttpServletRequest; | ||
| 43 | import java.io.IOException; | 35 | import java.io.IOException; |
| 44 | import java.io.InputStream; | 36 | import java.io.InputStream; |
| 45 | import java.util.HashMap; | 37 | import java.util.HashMap; |
| @@ -243,8 +235,8 @@ public class StreamPushController { | @@ -243,8 +235,8 @@ public class StreamPushController { | ||
| 243 | @Parameter(name = "app", description = "应用名", required = true) | 235 | @Parameter(name = "app", description = "应用名", required = true) |
| 244 | @Parameter(name = "stream", description = "流id", required = true) | 236 | @Parameter(name = "stream", description = "流id", required = true) |
| 245 | @Parameter(name = "mediaServerId", description = "媒体服务器id") | 237 | @Parameter(name = "mediaServerId", description = "媒体服务器id") |
| 246 | - public StreamInfo getPlayUrl(@RequestParam String app,@RequestParam String stream, | ||
| 247 | - @RequestParam(required = false) String mediaServerId){ | 238 | + public StreamContent getPlayUrl(@RequestParam String app, @RequestParam String stream, |
| 239 | + @RequestParam(required = false) String mediaServerId){ | ||
| 248 | boolean authority = false; | 240 | boolean authority = false; |
| 249 | // 是否登陆用户, 登陆用户返回完整信息 | 241 | // 是否登陆用户, 登陆用户返回完整信息 |
| 250 | LoginUser userInfo = SecurityUtils.getUserInfo(); | 242 | LoginUser userInfo = SecurityUtils.getUserInfo(); |
| @@ -259,7 +251,7 @@ public class StreamPushController { | @@ -259,7 +251,7 @@ public class StreamPushController { | ||
| 259 | if (streamInfo == null){ | 251 | if (streamInfo == null){ |
| 260 | throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取播放地址失败"); | 252 | throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取播放地址失败"); |
| 261 | } | 253 | } |
| 262 | - return streamInfo; | 254 | + return new StreamContent(streamInfo); |
| 263 | } | 255 | } |
| 264 | 256 | ||
| 265 | /** | 257 | /** |
src/main/resources/all-application.yml
| @@ -195,6 +195,8 @@ user-settings: | @@ -195,6 +195,8 @@ user-settings: | ||
| 195 | gb-send-stream-strict: false | 195 | gb-send-stream-strict: false |
| 196 | # 设备上线时是否自动同步通道 | 196 | # 设备上线时是否自动同步通道 |
| 197 | sync-channel-on-device-online: false | 197 | sync-channel-on-device-online: false |
| 198 | + # 设备上线时是否自动同步通道 | ||
| 199 | + sip-use-source-ip-as-remote-address: true | ||
| 198 | 200 | ||
| 199 | # 关闭在线文档(生产环境建议关闭) | 201 | # 关闭在线文档(生产环境建议关闭) |
| 200 | springdoc: | 202 | springdoc: |
web_src/src/components/dialog/devicePlayer.vue
| @@ -53,93 +53,93 @@ | @@ -53,93 +53,93 @@ | ||
| 53 | 更多地址<i class="el-icon-arrow-down el-icon--right"></i> | 53 | 更多地址<i class="el-icon-arrow-down el-icon--right"></i> |
| 54 | </el-button> | 54 | </el-button> |
| 55 | <el-dropdown-menu slot="dropdown" > | 55 | <el-dropdown-menu slot="dropdown" > |
| 56 | - <el-dropdown-item v-if="streamInfo.flv" :command="streamInfo.flv.url"> | 56 | + <el-dropdown-item v-if="streamInfo.flv" :command="streamInfo.flv"> |
| 57 | <el-tag >FLV:</el-tag> | 57 | <el-tag >FLV:</el-tag> |
| 58 | - <span>{{ streamInfo.flv.url }}</span> | 58 | + <span>{{ streamInfo.flv }}</span> |
| 59 | </el-dropdown-item> | 59 | </el-dropdown-item> |
| 60 | - <el-dropdown-item v-if="streamInfo.https_flv" :command="streamInfo.https_flv.url"> | 60 | + <el-dropdown-item v-if="streamInfo.https_flv" :command="streamInfo.https_flv"> |
| 61 | <el-tag >FLV(https):</el-tag> | 61 | <el-tag >FLV(https):</el-tag> |
| 62 | - <span>{{ streamInfo.https_flv.url }}</span> | 62 | + <span>{{ streamInfo.https_flv }}</span> |
| 63 | </el-dropdown-item> | 63 | </el-dropdown-item> |
| 64 | - <el-dropdown-item v-if="streamInfo.ws_flv" :command="streamInfo.ws_flv.url"> | 64 | + <el-dropdown-item v-if="streamInfo.ws_flv" :command="streamInfo.ws_flv"> |
| 65 | <el-tag >FLV(ws):</el-tag> | 65 | <el-tag >FLV(ws):</el-tag> |
| 66 | - <span >{{ streamInfo.ws_flv.url }}</span> | 66 | + <span >{{ streamInfo.ws_flv }}</span> |
| 67 | </el-dropdown-item> | 67 | </el-dropdown-item> |
| 68 | - <el-dropdown-item v-if="streamInfo.wss_flv" :command="streamInfo.wss_flv.url"> | 68 | + <el-dropdown-item v-if="streamInfo.wss_flv" :command="streamInfo.wss_flv"> |
| 69 | <el-tag >FLV(wss):</el-tag> | 69 | <el-tag >FLV(wss):</el-tag> |
| 70 | - <span>{{ streamInfo.wss_flv.url }}</span> | 70 | + <span>{{ streamInfo.wss_flv }}</span> |
| 71 | </el-dropdown-item> | 71 | </el-dropdown-item> |
| 72 | - <el-dropdown-item v-if="streamInfo.fmp4" :command="streamInfo.fmp4.url"> | 72 | + <el-dropdown-item v-if="streamInfo.fmp4" :command="streamInfo.fmp4"> |
| 73 | <el-tag >FMP4:</el-tag> | 73 | <el-tag >FMP4:</el-tag> |
| 74 | - <span>{{ streamInfo.fmp4.url }}</span> | 74 | + <span>{{ streamInfo.fmp4 }}</span> |
| 75 | </el-dropdown-item> | 75 | </el-dropdown-item> |
| 76 | - <el-dropdown-item v-if="streamInfo.https_fmp4" :command="streamInfo.https_fmp4.url"> | 76 | + <el-dropdown-item v-if="streamInfo.https_fmp4" :command="streamInfo.https_fmp4"> |
| 77 | <el-tag >FMP4(https):</el-tag> | 77 | <el-tag >FMP4(https):</el-tag> |
| 78 | - <span>{{ streamInfo.https_fmp4.url }}</span> | 78 | + <span>{{ streamInfo.https_fmp4 }}</span> |
| 79 | </el-dropdown-item> | 79 | </el-dropdown-item> |
| 80 | - <el-dropdown-item v-if="streamInfo.ws_fmp4" :command="streamInfo.ws_fmp4.url"> | 80 | + <el-dropdown-item v-if="streamInfo.ws_fmp4" :command="streamInfo.ws_fmp4"> |
| 81 | <el-tag >FMP4(ws):</el-tag> | 81 | <el-tag >FMP4(ws):</el-tag> |
| 82 | - <span>{{ streamInfo.ws_fmp4.url }}</span> | 82 | + <span>{{ streamInfo.ws_fmp4 }}</span> |
| 83 | </el-dropdown-item> | 83 | </el-dropdown-item> |
| 84 | - <el-dropdown-item v-if="streamInfo.wss_fmp4" :command="streamInfo.wss_fmp4.url"> | 84 | + <el-dropdown-item v-if="streamInfo.wss_fmp4" :command="streamInfo.wss_fmp4"> |
| 85 | <el-tag >FMP4(wss):</el-tag> | 85 | <el-tag >FMP4(wss):</el-tag> |
| 86 | - <span>{{ streamInfo.wss_fmp4.url }}</span> | 86 | + <span>{{ streamInfo.wss_fmp4 }}</span> |
| 87 | </el-dropdown-item> | 87 | </el-dropdown-item> |
| 88 | - <el-dropdown-item v-if="streamInfo.hls" :command="streamInfo.hls.url"> | 88 | + <el-dropdown-item v-if="streamInfo.hls" :command="streamInfo.hls"> |
| 89 | <el-tag>HLS:</el-tag> | 89 | <el-tag>HLS:</el-tag> |
| 90 | - <span>{{ streamInfo.hls.url }}</span> | 90 | + <span>{{ streamInfo.hls }}</span> |
| 91 | </el-dropdown-item> | 91 | </el-dropdown-item> |
| 92 | - <el-dropdown-item v-if="streamInfo.https_hls" :command="streamInfo.https_hls.url"> | 92 | + <el-dropdown-item v-if="streamInfo.https_hls" :command="streamInfo.https_hls"> |
| 93 | <el-tag >HLS(https):</el-tag> | 93 | <el-tag >HLS(https):</el-tag> |
| 94 | - <span>{{ streamInfo.https_hls.url }}</span> | 94 | + <span>{{ streamInfo.https_hls }}</span> |
| 95 | </el-dropdown-item> | 95 | </el-dropdown-item> |
| 96 | - <el-dropdown-item v-if="streamInfo.ws_hls" :command="streamInfo.ws_hls.url"> | 96 | + <el-dropdown-item v-if="streamInfo.ws_hls" :command="streamInfo.ws_hls"> |
| 97 | <el-tag >HLS(ws):</el-tag> | 97 | <el-tag >HLS(ws):</el-tag> |
| 98 | - <span>{{ streamInfo.ws_hls.url }}</span> | 98 | + <span>{{ streamInfo.ws_hls }}</span> |
| 99 | </el-dropdown-item> | 99 | </el-dropdown-item> |
| 100 | - <el-dropdown-item v-if="streamInfo.wss_hls" :command="streamInfo.wss_hls.url"> | 100 | + <el-dropdown-item v-if="streamInfo.wss_hls" :command="streamInfo.wss_hls"> |
| 101 | <el-tag >HLS(wss):</el-tag> | 101 | <el-tag >HLS(wss):</el-tag> |
| 102 | - <span>{{ streamInfo.wss_hls.url }}</span> | 102 | + <span>{{ streamInfo.wss_hls }}</span> |
| 103 | </el-dropdown-item> | 103 | </el-dropdown-item> |
| 104 | - <el-dropdown-item v-if="streamInfo.ts" :command="streamInfo.ts.url"> | 104 | + <el-dropdown-item v-if="streamInfo.ts" :command="streamInfo.ts"> |
| 105 | <el-tag>TS:</el-tag> | 105 | <el-tag>TS:</el-tag> |
| 106 | - <span>{{ streamInfo.ts.url }}</span> | 106 | + <span>{{ streamInfo.ts }}</span> |
| 107 | </el-dropdown-item> | 107 | </el-dropdown-item> |
| 108 | - <el-dropdown-item v-if="streamInfo.https_ts" :command="streamInfo.https_ts.url"> | 108 | + <el-dropdown-item v-if="streamInfo.https_ts" :command="streamInfo.https_ts"> |
| 109 | <el-tag>TS(https):</el-tag> | 109 | <el-tag>TS(https):</el-tag> |
| 110 | - <span>{{ streamInfo.https_ts.url }}</span> | 110 | + <span>{{ streamInfo.https_ts }}</span> |
| 111 | </el-dropdown-item> | 111 | </el-dropdown-item> |
| 112 | - <el-dropdown-item v-if="streamInfo.ws_ts" :command="streamInfo.ws_ts.url"> | 112 | + <el-dropdown-item v-if="streamInfo.ws_ts" :command="streamInfo.ws_ts"> |
| 113 | <el-tag>TS(ws):</el-tag> | 113 | <el-tag>TS(ws):</el-tag> |
| 114 | - <span>{{ streamInfo.ws_ts.url }}</span> | 114 | + <span>{{ streamInfo.ws_ts }}</span> |
| 115 | </el-dropdown-item> | 115 | </el-dropdown-item> |
| 116 | - <el-dropdown-item v-if="streamInfo.wss_ts" :command="streamInfo.wss_ts.url"> | 116 | + <el-dropdown-item v-if="streamInfo.wss_ts" :command="streamInfo.wss_ts"> |
| 117 | <el-tag>TS(wss):</el-tag> | 117 | <el-tag>TS(wss):</el-tag> |
| 118 | - <span>{{ streamInfo.wss_ts.url }}</span> | 118 | + <span>{{ streamInfo.wss_ts }}</span> |
| 119 | </el-dropdown-item> | 119 | </el-dropdown-item> |
| 120 | - <el-dropdown-item v-if="streamInfo.rtc" :command="streamInfo.rtc.url"> | 120 | + <el-dropdown-item v-if="streamInfo.rtc" :command="streamInfo.rtc"> |
| 121 | <el-tag >RTC:</el-tag> | 121 | <el-tag >RTC:</el-tag> |
| 122 | - <span>{{ streamInfo.rtc.url }}</span> | 122 | + <span>{{ streamInfo.rtc }}</span> |
| 123 | </el-dropdown-item> | 123 | </el-dropdown-item> |
| 124 | - <el-dropdown-item v-if="streamInfo.rtcs" :command="streamInfo.rtcs.url"> | 124 | + <el-dropdown-item v-if="streamInfo.rtcs" :command="streamInfo.rtcs"> |
| 125 | <el-tag >RTCS:</el-tag> | 125 | <el-tag >RTCS:</el-tag> |
| 126 | - <span>{{ streamInfo.rtcs.url }}</span> | 126 | + <span>{{ streamInfo.rtcs }}</span> |
| 127 | </el-dropdown-item> | 127 | </el-dropdown-item> |
| 128 | - <el-dropdown-item v-if="streamInfo.rtmp" :command="streamInfo.rtmp.url"> | 128 | + <el-dropdown-item v-if="streamInfo.rtmp" :command="streamInfo.rtmp"> |
| 129 | <el-tag >RTMP:</el-tag> | 129 | <el-tag >RTMP:</el-tag> |
| 130 | - <span>{{ streamInfo.rtmp.url }}</span> | 130 | + <span>{{ streamInfo.rtmp }}</span> |
| 131 | </el-dropdown-item> | 131 | </el-dropdown-item> |
| 132 | - <el-dropdown-item v-if="streamInfo.rtmps" :command="streamInfo.rtmps.url"> | 132 | + <el-dropdown-item v-if="streamInfo.rtmps" :command="streamInfo.rtmps"> |
| 133 | <el-tag >RTMPS:</el-tag> | 133 | <el-tag >RTMPS:</el-tag> |
| 134 | - <span>{{ streamInfo.rtmps.url }}</span> | 134 | + <span>{{ streamInfo.rtmps }}</span> |
| 135 | </el-dropdown-item> | 135 | </el-dropdown-item> |
| 136 | - <el-dropdown-item v-if="streamInfo.rtsp" :command="streamInfo.rtsp.url"> | 136 | + <el-dropdown-item v-if="streamInfo.rtsp" :command="streamInfo.rtsp"> |
| 137 | <el-tag >RTSP:</el-tag> | 137 | <el-tag >RTSP:</el-tag> |
| 138 | - <span>{{ streamInfo.rtsp.url }}</span> | 138 | + <span>{{ streamInfo.rtsp }}</span> |
| 139 | </el-dropdown-item> | 139 | </el-dropdown-item> |
| 140 | - <el-dropdown-item v-if="streamInfo.rtsps" :command="streamInfo.rtsps.url"> | 140 | + <el-dropdown-item v-if="streamInfo.rtsps" :command="streamInfo.rtsps"> |
| 141 | <el-tag >RTSPS:</el-tag> | 141 | <el-tag >RTSPS:</el-tag> |
| 142 | - <span>{{ streamInfo.rtsps.url }}</span> | 142 | + <span>{{ streamInfo.rtsps }}</span> |
| 143 | </el-dropdown-item> | 143 | </el-dropdown-item> |
| 144 | </el-dropdown-menu> | 144 | </el-dropdown-menu> |
| 145 | </el-dropdown> | 145 | </el-dropdown> |
| @@ -450,9 +450,9 @@ export default { | @@ -450,9 +450,9 @@ export default { | ||
| 450 | getUrlByStreamInfo(){ | 450 | getUrlByStreamInfo(){ |
| 451 | console.log(this.streamInfo) | 451 | console.log(this.streamInfo) |
| 452 | if (location.protocol === "https:") { | 452 | if (location.protocol === "https:") { |
| 453 | - this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]].url | 453 | + this.videoUrl = this.streamInfo[this.player[this.activePlayer][1]] |
| 454 | }else { | 454 | }else { |
| 455 | - this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]].url | 455 | + this.videoUrl = this.streamInfo[this.player[this.activePlayer][0]] |
| 456 | } | 456 | } |
| 457 | return this.videoUrl; | 457 | return this.videoUrl; |
| 458 | 458 |