コード例 #1
0
        private void InitializePlayer()
        {
            _player = new MediaPlayer {
                ScrubbingEnabled = true
            };
            _player.MediaOpened += PlayerOnMediaOpened;
            _player.MediaEnded  += PlayerOnMediaEnded;

            TimeSource = new MediaPlayerTimeSource(_player,
                                                   new DispatcherClock(Dispatcher, TimeSpan.FromMilliseconds(10)));

            UpdateVideoBrush();
        }
コード例 #2
0
        private void InitializePlayer()
        {
            _player = new MediaPlayer();
            _player.ScrubbingEnabled = true;
            _player.MediaOpened     += PlayerOnMediaOpened;

            TimeSource = new MediaPlayerTimeSource(_player,
                                                   new DispatcherClock(Dispatcher, TimeSpan.FromMilliseconds(10)));

            VideoBrush = new DrawingBrush(new VideoDrawing {
                Player = _player, Rect = new Rect(0, 0, 1, 1)
            })
            {
                Stretch = Stretch.Fill
            };
        }