private void createSessions() { if (m_SessionIdList.Count > 0) { return; } for (int i = 0; i < m_strCameraidList.Count; i++) { m_SessionIdList.Add(HkAction.AllocSession());//申请会话,保存到列表中 } }
public void Play(string cameraId) { var region = GetCurrentDisplayRegion(); if (region.IsDisplaying && region.SessionId != IntPtr.Zero) { HkAction.Stop(region.SessionId); } region.SessionId = HkAction.AllocSession(); if (region.SessionId != null && !string.IsNullOrEmpty(cameraId)) { var playStatus = HkAction.Play(region.DisplayHandler, cameraId, region.SessionId); if (playStatus) { region.IsDisplaying = true; SelectedIndex = SelectedIndex >= Regions.Count - 1 ? 0 : (SelectedIndex + 1); } } }