|  |  |  | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | * API兼容:实时直播 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @SuppressWarnings(value = {"rawtypes", "unchecked"}) | 
|---|
|  |  |  | @CrossOrigin | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping(value = "/api/v1/stream") | 
|---|
|  |  |  | public class ApiStreamController { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | 
|---|
|  |  |  | 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()); | 
|---|