Exemplo n.º 1
0
        /// <summary>
        /// Refresh video position.
        /// </summary>
        /// <param name="timeSpan">Time span.</param>
        public void RefreshPosition(TimeSpan timeSpan)
        {
            DisplayPosition = VideoTimeFormatter.ConvertTimeSpanToText(timeSpan);

            Position = timeSpan.TotalSeconds;

            PositionPercent        = Math.Round(timeSpan.TotalMilliseconds / m_Duration.TotalMilliseconds * 100);
            DisplayPositionPercent = $"({PositionPercent}%)";
        }
Exemplo n.º 2
0
        /// <summary>
        /// Media opened.
        /// </summary>
        /// <param name="success">Success media opened.</param>
        /// <param name="duration">Duration.</param>
        public void MediaOpened(TimeSpan?duration = default(TimeSpan? ))
        {
            DisplayDuration = VideoTimeFormatter.ConvertTimeSpanToText(duration.Value);
            m_Duration      = duration.Value;
            DurationSecond  = duration.Value.TotalSeconds;

            if (m_RestorePosition > 0)
            {
                var lastPosition = TimeSpan.FromSeconds(m_RestorePosition);
                m_RestorePosition = 0;
                ChangePosition(lastPosition);
            }
            IsMediaOpened = true;
        }