| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @SuppressWarnings("rawtypes") |
| | |
| | | @Autowired |
| | | private DeviceChannelMapper deviceChannelMapper; |
| | | |
| | | private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | /** |
| | | * 开始播放时将流存入redis |
| | |
| | | */ |
| | | @Override |
| | | public boolean updateMediaInfo(ZLMServerConfig ZLMServerConfig) { |
| | | ZLMServerConfig.setUpdateTime(System.currentTimeMillis()); |
| | | ZLMServerConfig.setUpdateTime(format.format(new Date(System.currentTimeMillis()))); |
| | | return redis.set(VideoManagerConstants.MEDIA_SERVER_PREFIX, ZLMServerConfig); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void outlineForAll() { |
| | | List<Object> onlineDevices = redis.scan(String.format("%S*", VideoManagerConstants.KEEPLIVEKEY_PREFIX)); |
| | | for (int i = 0; i < onlineDevices.size(); i++) { |
| | | String key = (String) onlineDevices.get(i); |
| | | redis.del(key); |
| | | } |
| | | } |
| | | } |