Merge branch 'master' into dev/播放页面云台功能页面优化
commit
e2c59eed88
|
@ -28,7 +28,10 @@ import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.context.request.async.DeferredResult;
|
import org.springframework.web.context.request.async.DeferredResult;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.sip.message.Response;
|
import javax.sip.message.Response;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,16 +203,39 @@ public class CommonChannelController {
|
||||||
|
|
||||||
@Operation(summary = "播放通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "播放通道", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@GetMapping("/play")
|
@GetMapping("/play")
|
||||||
public DeferredResult<WVPResult<StreamContent>> deleteChannelToGroupByGbDevice(Integer channelId){
|
public DeferredResult<WVPResult<StreamContent>> deleteChannelToGroupByGbDevice(HttpServletRequest request, Integer channelId){
|
||||||
Assert.notNull(channelId,"参数异常");
|
Assert.notNull(channelId,"参数异常");
|
||||||
CommonGBChannel channel = channelService.getOne(channelId);
|
CommonGBChannel channel = channelService.getOne(channelId);
|
||||||
Assert.notNull(channel, "通道不存在");
|
Assert.notNull(channel, "通道不存在");
|
||||||
|
|
||||||
DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue());
|
DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue());
|
||||||
|
|
||||||
ErrorCallback<StreamInfo> callback = (code, msg, data) -> {
|
ErrorCallback<StreamInfo> callback = (code, msg, streamInfo) -> {
|
||||||
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
if (code == InviteErrorCode.SUCCESS.getCode()) {
|
||||||
result.setResult(WVPResult.success(new StreamContent(data)));
|
WVPResult<StreamContent> wvpResult = WVPResult.success();
|
||||||
|
if (streamInfo != null) {
|
||||||
|
if (userSetting.getUseSourceIpAsStreamIp()) {
|
||||||
|
streamInfo=streamInfo.clone();//深拷贝
|
||||||
|
String host;
|
||||||
|
try {
|
||||||
|
URL url=new URL(request.getRequestURL().toString());
|
||||||
|
host=url.getHost();
|
||||||
|
} catch (MalformedURLException e) {
|
||||||
|
host=request.getLocalAddr();
|
||||||
|
}
|
||||||
|
streamInfo.channgeStreamIp(host);
|
||||||
|
}
|
||||||
|
if (!ObjectUtils.isEmpty(streamInfo.getMediaServer().getTranscodeSuffix())
|
||||||
|
&& !"null".equalsIgnoreCase(streamInfo.getMediaServer().getTranscodeSuffix())) {
|
||||||
|
streamInfo.setStream(streamInfo.getStream() + "_" + streamInfo.getMediaServer().getTranscodeSuffix());
|
||||||
|
}
|
||||||
|
wvpResult.setData(new StreamContent(streamInfo));
|
||||||
|
}else {
|
||||||
|
wvpResult.setCode(code);
|
||||||
|
wvpResult.setMsg(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.setResult(wvpResult);
|
||||||
}else {
|
}else {
|
||||||
result.setResult(WVPResult.fail(code, msg));
|
result.setResult(WVPResult.fail(code, msg));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
width="65rem"
|
width="65rem"
|
||||||
top="2rem"
|
top="2rem"
|
||||||
center
|
center
|
||||||
|
:append-to-body="true"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:visible.sync="showVideoDialog"
|
:visible.sync="showVideoDialog"
|
||||||
:destroy-on-close="false"
|
:destroy-on-close="false"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
title="选择虚拟组织"
|
title="选择虚拟组织"
|
||||||
width="30%"
|
width="30%"
|
||||||
top="5rem"
|
top="5rem"
|
||||||
|
:append-to-body="true"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:visible.sync="showDialog"
|
:visible.sync="showDialog"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
|
|
Loading…
Reference in New Issue