Esempio n. 1
0
        /// <summary>
        /// 查询单个录像播放的进度
        /// </summary>
        /// <param name="replayStatus"></param>
        private void QueryReplayStatus(RelayStatusModel replayStatus)
        {
            if (replayStatus == null)
            {
                return;
            }

            //非播放状态下的录像回放无需进行进度查询
            if (!IsNeedQueryReplayPosition(replayStatus))
            {
                return;
            }

            //查询失败或得到错误的结果时不做任何处理
            DateTime replayDateTime = ReplayAdapter.GetReplayPositon(replayStatus.PlayingHandle);

            if (replayDateTime == DateTime.MinValue)
            {
                return;
            }

            //如果播放时间进度已经超过录像文件的最大时间,则通知消息订阅者停止播放
            if (VideoRecordCache.IsTimeBeyondTimeRangeOfVideoFiles(replayStatus.Camera.ChannelID, replayDateTime))
            {
                ReplayPositionChangedEvent?.Invoke(replayStatus.PlayingScreenHandle, DateTime.MaxValue);
                return;
            }

            ReplayPositionChangedEvent?.Invoke(replayStatus.PlayingScreenHandle, replayDateTime);
        }