|
@@ -1705,16 +1705,43 @@ public class LiveRoomServiceImpl extends ServiceImpl<LiveRoomDao, LiveRoom> impl
|
|
|
return false;
|
|
|
}
|
|
|
if (pluginService.pluginName().equals(TencentCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
+// TencentWrapper.LiveStreamState liveStreamState = pluginService.liveStreamState(
|
|
|
+// getStreamId(liveRoom.getRoomUid(), liveRoom.getSpeakerId()));
|
|
|
+// if (liveStreamState == null) {
|
|
|
+// log.error("查询直播间流失败,返回结果为空");
|
|
|
+// return false;
|
|
|
+// }
|
|
|
+// log.info("查询直播间流状态:{},roomUid:{}", JSON.toJSONString(liveStreamState), liveRoom.getRoomUid());
|
|
|
+// if (!"active".equals(liveStreamState.getStreamState())) {
|
|
|
+// pluginService.liveStreamStop(getStreamId(liveRoom.getRoomUid(), liveRoom.getSpeakerId()));
|
|
|
+// }
|
|
|
+
|
|
|
+ //销毁直播间
|
|
|
+ pluginService.chatRoomDestroy(liveRoom.getRoomUid());
|
|
|
+
|
|
|
TencentWrapper.LiveStreamState liveStreamState = pluginService.liveStreamState(
|
|
|
getStreamId(liveRoom.getRoomUid(), liveRoom.getSpeakerId()));
|
|
|
if (liveStreamState == null) {
|
|
|
log.error("查询直播间流失败,返回结果为空");
|
|
|
- return false;
|
|
|
- }
|
|
|
- log.info("查询直播间流状态:{},roomUid:{}", JSON.toJSONString(liveStreamState), liveRoom.getRoomUid());
|
|
|
- if (!"active".equals(liveStreamState.getStreamState())) {
|
|
|
+ } else if ("active".equals(liveStreamState.getStreamState())) {
|
|
|
pluginService.liveStreamStop(getStreamId(liveRoom.getRoomUid(), liveRoom.getSpeakerId()));
|
|
|
}
|
|
|
+
|
|
|
+ // 录制任务Id
|
|
|
+ if (liveRoom.getServiceProvider().equals(TencentCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
+
|
|
|
+ List<String> collect = liveRoomService.lambdaQuery()
|
|
|
+ .eq(LiveRoom::getRoomUid, liveRoom.getRoomUid()).list().stream()
|
|
|
+ .map(LiveRoom::getVideoRecord)
|
|
|
+ .filter(StringUtils::isNotEmpty)
|
|
|
+ .distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (String taskId : collect) {
|
|
|
+ // 删除录制任务
|
|
|
+ pluginService.rtcRoomRecordStop(taskId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else if (pluginService.pluginName().equals(RongCloudLivePlugin.PLUGIN_NAME)) {
|
|
|
// 融云走原有逻辑 融云自动销毁
|
|
|
}
|