[1078] 支持无人观看自动停流

This commit is contained in:
lin
2025-07-15 18:11:23 +08:00
parent be04660de8
commit 44ed06bcbe
7 changed files with 29 additions and 28 deletions

View File

@@ -234,8 +234,6 @@ public class jt1078PlayServiceImpl implements Ijt1078PlayService {
return;
}
// 设置超时监听
dynamicTask.startDelay(playKey, () -> {
log.info("[JT-点播] 超时, phoneNumber {} channelId {}", phoneNumber, channelId);
@@ -382,7 +380,8 @@ public class jt1078PlayServiceImpl implements Ijt1078PlayService {
}
String app = "1078";
String stream = phoneNumber + "_" + channelId;
String stream = String.format("%s_%s_%s_%s", phoneNumber, channelId,
DateUtil.yyyy_MM_dd_HH_mm_ssToUrl(startTime), DateUtil.yyyy_MM_dd_HH_mm_ssToUrl(endTime));
MediaServer mediaServer = mediaServerService.getMediaServerForMinimumLoad(null);
if (mediaServer == null) {
for (CommonCallback<WVPResult<StreamInfo>> errorCallback : errorCallbacks) {

View File

@@ -100,15 +100,12 @@ public class jt1078ServiceImpl implements Ijt1078Service {
*/
@Override
public JTMediaStreamType checkStreamFromJt(String stream) {
if (!stream.startsWith("jt_")) {
return null;
}
String[] streamParamArray = stream.split("_");
if (streamParamArray.length == 3) {
if (streamParamArray.length == 2) {
return JTMediaStreamType.PLAY;
}else if (streamParamArray.length == 5) {
return JTMediaStreamType.PLAYBACK;
}else if (streamParamArray.length == 4) {
return JTMediaStreamType.PLAYBACK;
}else if (streamParamArray.length == 5) {
return JTMediaStreamType.TALK;
}else {
return null;