//Events
        #region Mediaevents

        private void VideoPlayer_MediaOpened(object sender, RoutedEventArgs e)
        {
            if (!VideoPlayer.NaturalDuration.HasTimeSpan)
            {
                return;
            }

            IntroPlayerKernel.Get().EventAggregator.PublishMessage(new MediaOpenedEvent());
            VideoPositonDefiner.Maximum = VideoPlayer.NaturalDuration.TimeSpan.TotalMilliseconds;
        }
Example #2
0
        //Methods
        #region VideoPositionMethod

        private void VideoPositionChanged(object state)
        {
            if (Math.Abs((double)state - VideoPosition) < 1000)
            {
                Dispatcher.Invoke(() =>
                {
                    IntroPlayerKernel.Get().EventAggregator.PublishMessage(new SeekToPlayerPositionEvent(VideoPosition));
                });
            }
        }
 private void OnUpdatePosition(object state)
 {
     Dispatcher.Invoke(() =>
     {
         if (oldPosition != VideoPlayer.Position)
         {
             IntroPlayerKernel.Get().EventAggregator.PublishMessage(new VideoPositionChangedEvent(VideoPlayer.Position));
             oldPosition = VideoPlayer.Position;
         }
     });
 }
 public AboutViewModel() : base(IntroPlayerKernel.Get().EventAggregator)
 {
 }
 private void VideoPlayer_MediaFailed(object sender, ExceptionRoutedEventArgs e)
 {
     IntroPlayerKernel.Get().EventAggregator.PublishMessage(new MediaFailedEvent());
 }
 public MainWindow()
 {
     InitializeComponent();
     IntroPlayerKernel.Get().EventAggregator.Subscribe(this);
     PositionUpdateTimer = new Timer(OnUpdatePosition, null, 0, 1000);
 }
 public IntroPlayerController() : base(IntroPlayerKernel.Get().EventAggregator)
 {
 }