Example #1
0
        /// <summary>
        /// Seeks the specified time span.
        /// </summary>
        /// <param name="timeSpan">The time span.</param>
        public void Seek(TimeSpan timeSpan)
        {
            if (SeekCommand?.CanExecute(timeSpan) == true)
            {
                SeekCommand?.Execute(timeSpan);

                MediaState = MediaState.Seeking;
                OnMediaStateChanged();
            }
        }
Example #2
0
        async Task openAndPlay(VideoAudioPair item, int?offsetSeconds = null)
        {
            try
            {
                String name = item.Video != null ? item.Video.Name : item.Audio.Name;

                EventAggregator.GetEvent <TitleChangedEvent>().Publish(name);

                await OpenAndPlayCommand.ExecuteAsync(item);

                if (offsetSeconds != null)
                {
                    SeekCommand.Execute((double)offsetSeconds.Value);
                }
            }
            catch (Exception)
            {
            }
        }