Ejemplo n.º 1
0
        /// <summary>
        /// 按时间回放
        /// </summary>
        /// <param name="channel">通道号</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="stopTime">停止时间</param>
        /// <param name="hWnd">窗口句柄</param>
        /// <returns></returns>
        public bool PlayBackByTime(int channel, DateTime startTime, DateTime stopTime, IntPtr hWnd)
        {
            HCNetSDK.NET_DVR_TIME dvrStart = DateTimeToDvrTime(startTime);
            HCNetSDK.NET_DVR_TIME dvrStop  = DateTimeToDvrTime(stopTime);
            _play_handle = HCNetSDK.NET_DVR_PlayBackByTime(_user_id, channel, ref dvrStart, ref dvrStop, hWnd);
            if (_play_handle == -1)
            {
                return(false);
            }
            uint outValue = 0;

            return(PlayBackControl(PlayControlCode.START, 0, out outValue));
        }