添加界面优化接口
This commit is contained in:
@@ -28,6 +28,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItemLite;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.IMediaService;
|
||||
import com.genersoft.iot.vmp.service.IPlayService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
||||
@@ -103,6 +104,9 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
@Autowired
|
||||
private IMediaServerService mediaServerService;
|
||||
|
||||
@Autowired
|
||||
private IMediaService mediaService;
|
||||
|
||||
@Autowired
|
||||
private ZLMRESTfulUtils zlmresTfulUtils;
|
||||
|
||||
@@ -1016,7 +1020,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
AudioBroadcastResult audioBroadcastResult = new AudioBroadcastResult();
|
||||
audioBroadcastResult.setApp(app);
|
||||
audioBroadcastResult.setStream(stream);
|
||||
audioBroadcastResult.setMediaServerItem(new MediaServerItemLite(mediaServerItem));
|
||||
audioBroadcastResult.setStreamInfo(mediaService.getStreamInfoByAppAndStream(mediaServerItem, app, stream, null, null, false));
|
||||
audioBroadcastResult.setCodec("G.711");
|
||||
wvpResult.setData(audioBroadcastResult);
|
||||
RequestMessage requestMessage = new RequestMessage();
|
||||
|
||||
@@ -41,4 +41,5 @@ public interface IMediaService {
|
||||
* @return
|
||||
*/
|
||||
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr);
|
||||
StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, boolean isPlay);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,11 @@ public class MediaServiceImpl implements IMediaService {
|
||||
|
||||
@Override
|
||||
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr) {
|
||||
return getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks, addr, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr, boolean isPlay) {
|
||||
StreamInfo streamInfoResult = new StreamInfo();
|
||||
streamInfoResult.setStream(stream);
|
||||
streamInfoResult.setApp(app);
|
||||
@@ -107,11 +112,10 @@ public class MediaServiceImpl implements IMediaService {
|
||||
streamInfoResult.setHttps_ts(String.format("https://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
||||
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
||||
streamInfoResult.setWss_ts(String.format("wss://%s:%s/%s/%s.live.ts", addr, mediaInfo.getHttpSSlPort(), app, stream));
|
||||
streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=play", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream));
|
||||
streamInfoResult.setRtc(String.format("https://%s:%s/index/api/webrtc?app=%s&stream=%s&type=%s", mediaInfo.getStreamIp(), mediaInfo.getHttpSSlPort(), app, stream, isPlay?"play":"push"));
|
||||
}
|
||||
|
||||
streamInfoResult.setTracks(tracks);
|
||||
return streamInfoResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -190,10 +190,7 @@ public class PlayServiceImpl implements IPlayService {
|
||||
redisCatchStorage.stopPlay(streamInfo);
|
||||
storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId());
|
||||
streamInfo = null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (streamInfo == null) {
|
||||
String streamId = null;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.genersoft.iot.vmp.vmanager.bean;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItemLite;
|
||||
|
||||
@@ -8,9 +9,9 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItemLite;
|
||||
*/
|
||||
public class AudioBroadcastResult {
|
||||
/**
|
||||
* 推流的媒体节点信息
|
||||
* 推流的各个方式流地址
|
||||
*/
|
||||
private MediaServerItemLite mediaServerItem;
|
||||
private StreamInfo streamInfo;
|
||||
|
||||
/**
|
||||
* 编码格式
|
||||
@@ -28,12 +29,12 @@ public class AudioBroadcastResult {
|
||||
private String stream;
|
||||
|
||||
|
||||
public MediaServerItemLite getMediaServerItem() {
|
||||
return mediaServerItem;
|
||||
public StreamInfo getStreamInfo() {
|
||||
return streamInfo;
|
||||
}
|
||||
|
||||
public void setMediaServerItem(MediaServerItemLite mediaServerItem) {
|
||||
this.mediaServerItem = mediaServerItem;
|
||||
public void setStreamInfo(StreamInfo streamInfo) {
|
||||
this.streamInfo = streamInfo;
|
||||
}
|
||||
|
||||
public String getCodec() {
|
||||
|
||||
Reference in New Issue
Block a user