public void AddPlayByPlayMarker(PlayByPlay playByPlay)
 {
     if (!this.IsPlayByPlayAlreadyAdded(playByPlay))
     {
         this.AddPlayByPlayToSmoothStreamAsset(playByPlay);
     }
 }
        private bool IsPlayByPlayAlreadyAdded(PlayByPlay playByPlay)
        {
            SmoothStreamingVideoAsset smoothAsset = this.VideoAsset as SmoothStreamingVideoAsset;

            if (smoothAsset == null)
            {
                return(false);
            }

            return(smoothAsset.PlayByPlayMarkers.Any(pbp => pbp.TimeWithOffset == playByPlay.TimeWithOffset && pbp.Text.Equals(playByPlay.Text)));
        }
        private void AddPlayByPlayToSmoothStreamAsset(PlayByPlay playByPlay)
        {
            SmoothStreamingVideoAsset smoothAsset = this.VideoAsset as SmoothStreamingVideoAsset;

            if (smoothAsset == null)
            {
                return;
            }

            smoothAsset.PlayByPlayMarkers.Add(playByPlay);
        }
        private bool ShouldDisplayPlayByPlayMarker(PlayByPlay playByPlay, double startPosition)
        {
            double endPosition = (this.OutPosition - this.InPosition) + startPosition;

            return(playByPlay.Time >= TimeSpan.FromSeconds(startPosition).Ticks&& playByPlay.Time <= TimeSpan.FromSeconds(endPosition).Ticks);
        }