648540858
2023-03-20 039fbf7e243d4bf0f46b44e7dae2a5d36e978056
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
@@ -12,7 +12,6 @@
import com.genersoft.iot.vmp.service.IPlayService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -112,7 +111,7 @@
            return resultDeferredResult;
        }
        MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
        PlayResult play = playService.play(newMediaServerItem, serial, code, (mediaServerItem, response)->{
        playService.play(newMediaServerItem, serial, code, (mediaServerItem, response)->{
            StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(serial, code);
            JSONObject result = new JSONObject();
            result.put("StreamID", streamInfo.getStream());
@@ -120,12 +119,12 @@
            result.put("ChannelID", code);
            result.put("ChannelName", deviceChannel.getName());
            result.put("ChannelCustomName", "");
            result.put("FLV", streamInfo.getFlv());
            result.put("WS_FLV", streamInfo.getWs_flv());
            result.put("RTMP", streamInfo.getRtmp());
            result.put("HLS", streamInfo.getHls());
            result.put("RTSP", streamInfo.getRtsp());
            result.put("WEBRTC", streamInfo.getRtc());
            result.put("FLV", streamInfo.getFlv().getUrl());
            result.put("WS_FLV", streamInfo.getWs_flv().getUrl());
            result.put("RTMP", streamInfo.getRtmp().getUrl());
            result.put("HLS", streamInfo.getHls().getUrl());
            result.put("RTSP", streamInfo.getRtsp().getUrl());
            result.put("WEBRTC", streamInfo.getRtc().getUrl());
            result.put("CDN", "");
            result.put("SnapURL", "");
            result.put("Transport", device.getTransport());
@@ -186,7 +185,7 @@
        }
        try {
            cmder.streamByeCmd(device, code, streamInfo.getStream(), null);
        } catch (InvalidArgumentException | ParseException | SipException | SsrcTransactionNotFoundException e) {
        } catch (InvalidArgumentException | ParseException | SipException | SsrcTransactionNotFoundException  e) {
            JSONObject result = new JSONObject();
            result.put("error","发送BYE失败:" + e.getMessage());
            return result;