使用设备Id+通道Id作为session的识别标识,解决点播异常时无法释放session的问题

This commit is contained in:
panlinlin
2021-04-16 17:52:30 +08:00
parent 760f1f4d94
commit 2b3b7dbc79
15 changed files with 87 additions and 78 deletions

View File

@@ -36,7 +36,7 @@ public interface IRedisCatchStorage {
StreamInfo queryPlaybackByStreamId(String steamId);
StreamInfo queryPlayByDevice(String deviceId, String code);
StreamInfo queryPlayByDevice(String deviceId, String channelId);
/**
* 更新流媒体信息

View File

@@ -75,11 +75,11 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public StreamInfo queryPlayByDevice(String deviceId, String code) {
public StreamInfo queryPlayByDevice(String deviceId, String channelId) {
// List<Object> playLeys = redis.keys(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
List<Object> playLeys = redis.scan(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
deviceId,
code));
channelId));
if (playLeys == null || playLeys.size() == 0) return null;
return (StreamInfo)redis.get(playLeys.get(0).toString());
}