调整通用点播代码封装
parent
3b24a6c8ca
commit
f7ed06e5f5
|
@ -240,21 +240,7 @@ public class CommonChannelController {
|
|||
result.setResult(WVPResult.fail(code, msg));
|
||||
}
|
||||
};
|
||||
|
||||
if (channel.getGbDeviceDbId() != null) {
|
||||
// 国标通道
|
||||
channelPlayService.playGbDeviceChannel(channel, callback);
|
||||
} else if (channel.getStreamProxyId() != null) {
|
||||
// 拉流代理
|
||||
channelPlayService.playProxy(channel, callback);
|
||||
} else if (channel.getStreamPushId() != null) {
|
||||
// 推流
|
||||
channelPlayService.playPush(channel, null, null, callback);
|
||||
} else {
|
||||
// 通道数据异常
|
||||
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||
}
|
||||
channelPlayService.play(channel, null, callback);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ public interface IGbChannelPlayService {
|
|||
|
||||
void start(CommonGBChannel channel, InviteInfo inviteInfo, Platform platform, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void play(CommonGBChannel channel, Platform platform, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void playProxy(CommonGBChannel channel, ErrorCallback<StreamInfo> callback);
|
||||
|
|
|
@ -39,20 +39,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
|||
}
|
||||
log.info("[点播通用通道] 类型:{}, 通道: {}({})", inviteInfo.getSessionName(), channel.getGbName(), channel.getGbDeviceId());
|
||||
if ("Play".equalsIgnoreCase(inviteInfo.getSessionName())) {
|
||||
if (channel.getGbDeviceDbId() != null) {
|
||||
// 国标通道
|
||||
playGbDeviceChannel(channel, callback);
|
||||
} else if (channel.getStreamProxyId() != null) {
|
||||
// 拉流代理
|
||||
playProxy(channel, callback);
|
||||
} else if (channel.getStreamPushId() != null) {
|
||||
// 推流
|
||||
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
||||
} else {
|
||||
// 通道数据异常
|
||||
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||
}
|
||||
play(channel, platform, callback);
|
||||
}else if ("Playback".equals(inviteInfo.getSessionName())) {
|
||||
if (channel.getGbDeviceDbId() != null) {
|
||||
// 国标通道
|
||||
|
@ -101,6 +88,29 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void play(CommonGBChannel channel, Platform platform, ErrorCallback<StreamInfo> callback) {
|
||||
if (channel.getGbDeviceDbId() != null) {
|
||||
// 国标通道
|
||||
playGbDeviceChannel(channel, callback);
|
||||
} else if (channel.getStreamProxyId() != null) {
|
||||
// 拉流代理
|
||||
playProxy(channel, callback);
|
||||
} else if (channel.getStreamPushId() != null) {
|
||||
if (platform != null) {
|
||||
// 推流
|
||||
playPush(channel, platform.getServerGBId(), platform.getName(), callback);
|
||||
}else {
|
||||
// 推流
|
||||
playPush(channel, null, null, callback);
|
||||
}
|
||||
} else {
|
||||
// 通道数据异常
|
||||
log.error("[点播通用通道] 通道数据异常,无法识别通道来源: {}({})", channel.getGbName(), channel.getGbDeviceId());
|
||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playGbDeviceChannel(CommonGBChannel channel, ErrorCallback<StreamInfo> callback){
|
||||
// 国标通道
|
||||
|
|
Loading…
Reference in New Issue