| | |
| | | import com.ard.sample.manage.service.ILiveStreamService; |
| | | import com.ard.vtdu.config.MediamtxConfig; |
| | | import com.ard.vtdu.domain.ArdVtdu; |
| | | import com.ard.vtdu.service.IMediaMTXService; |
| | | import com.ard.vtdu.service.IArdMediaService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | private IMessageSenderService messageSender; |
| | | |
| | | @Resource |
| | | private IMediaMTXService mediaService; |
| | | private IArdMediaService ardMediaService; |
| | | @Resource |
| | | private MediamtxConfig mediamtxConfig; |
| | | |
| | |
| | | case RTMP: |
| | | ArdVtdu vtdu = new ArdVtdu(); |
| | | vtdu.setName(liveParam.getVideoId()); |
| | | vtdu = mediaService.addPath(vtdu); |
| | | vtdu.setRtspSource("publisher"); |
| | | vtdu = ardMediaService.addPath(vtdu); |
| | | live.setRtmpUrl(vtdu.getRtmpUrl()); |
| | | live.setRtspUrl(vtdu.getRtspUrl()); |
| | | live.setWebrtcUrl(vtdu.getWebrtcUrl()); |
| | |
| | | if (receiveReply.getResult() != 0) { |
| | | return ResponseResult.error(LiveErrorEnum.find(receiveReply.getResult())); |
| | | } |
| | | mediaService.removePath(videoId); |
| | | ardMediaService.removePath(videoId); |
| | | return ResponseResult.success(); |
| | | } |
| | | |