| File was renamed from ard-vtdu/src/main/java/com/ard/vtdu/service/impl/ArdMediaServiceImpl.java |
| | |
| | | import com.ard.vtdu.client.MediaClient; |
| | | import com.ard.vtdu.config.MediamtxConfig; |
| | | import com.ard.vtdu.domain.*; |
| | | import com.ard.vtdu.service.IMediaService; |
| | | import com.ard.vtdu.service.IArdMediaService; |
| | | import com.ard.vtdu.util.ArdTool; |
| | | import com.dtflys.forest.exceptions.ForestRuntimeException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | **/ |
| | | @Service |
| | | @Slf4j |
| | | public class ArdMediaServiceImpl implements IMediaService { |
| | | public class ArdArdMediaServiceImpl implements IArdMediaService { |
| | | |
| | | @Resource |
| | | MediaClient mediaClient; |
| | |
| | | String webrtcUrl = protocol + mediamtxConfig.getPlayHost() + ":8889/" + ardVtdu.getName(); |
| | | |
| | | Conf conf = new Conf(); |
| | | conf.setName(ardVtdu.getName()); |
| | | conf.setSource(ardVtdu.getRtspSource()); |
| | | conf.setName(ardVtdu.getName()); |
| | | conf.setRunOnDemand(""); |
| | | conf.setRunOnDemandRestart(false); |
| | | conf.setRunOnDemandCloseAfter("5s"); |
| | |
| | | if (StringUtils.isNotEmpty(conf.getRunOnDemand())) { |
| | | runOn = conf.getRunOnDemand(); |
| | | } |
| | | //RTSP源地址 |
| | | Matcher matcher = Pattern.compile("rtsp://[^\\s\"]+").matcher(runOn); |
| | | if (matcher.find()) { |
| | | info.setRtspSource(matcher.group()); |
| | | info.setIsCode(1); |
| | | } else { |
| | | info.setRtspSource(conf.getSource()); |
| | | info.setIsCode(0); |
| | | } |
| | | //传输协议 |
| | | matcher = Pattern.compile("-rtsp_transport\\s+(\\w+)").matcher(runOn); |
| | | Matcher matcher = Pattern.compile("-rtsp_transport\\s+(\\w+)").matcher(runOn); |
| | | if (matcher.find()) { |
| | | info.setProtocol(matcher.group(1)); |
| | | } |