Example #1
0
        /*
         * public void syncVideos()
         * {
         *  if(this.Video.RelatedVideo != null)
         *  {
         *      if(!this.Video.RelatedVideo.Loading)
         *      {
         *          //this.Video.RelatedVideo.Loading = true;
         *          //Sincronizo el tiempo del video 2
         *          var tl = new Thread(new ThreadStart(delegate {
         *              Thread.Sleep(1000);
         *              this.Video.RelatedVideo.Control.Time = this.Video.Control.Time;
         *              //Thread.Sleep(500);
         *              //this.Video.RelatedVideo.Loading = false;
         *          }));
         *          tl.Start();
         *      }
         *  }
         *
         * }*/

        public void UserControlLoaded(object sender, RoutedEventArgs e)
        {
            var arch = (IntPtr.Size == 4) ? "x86" : "x64";
            //Inicializo el reproductor 1
            var videoVlc = new Vlc.DotNet.Forms.VlcControl();

            videoVlc.BeginInit();
            videoVlc.VlcLibDirectory = new DirectoryInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"libvlc\win-{arch}"));

            if ((string)this.Tag != "LicensePlate")
            {
                videoVlc.VlcMediaplayerOptions = new[] { "--input-fast-seek" };
            }
            videoVlc.EndInit();
            this.videoVlc.Child = videoVlc;

            Console.WriteLine("VLC Version:" + videoVlc.ProductVersion);
            //Inicializo el reproductor 2

            /*
             * var videoVlc2 = new Vlc.DotNet.Forms.VlcControl();
             * videoVlc2.BeginInit();
             * videoVlc2.VlcLibDirectory = new DirectoryInfo(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $@"libvlc\win-{arch}"));
             * //videoVlc2.VlcMediaplayerOptions = new[] { "--input-fast-seek" };
             * videoVlc2.EndInit();
             * this.videoVlc2.Child = videoVlc2;*/


            this.Focus();
            this.KeyDown += onKeyDown;
            this.KeyUp   += onKeyUp;
        }
Example #2
0
 public void MyTestInitialize()
 {
     vlcControl = new Vlc.DotNet.Forms.VlcControl();
     vlcControl.BeginInit();
     vlcControl.VlcLibDirectory = new DirectoryInfo(@"C:\Users\Gabriel\Downloads\vlc-3.0.6");;
     vlcControl.EndInit();
     video = new Video();
 }
Example #3
0
        private void InitVlcPlayer()
        {
            MediaPlayer.BeginInit();
            MediaPlayer.VlcLibDirectory = new DirectoryInfo(
                Path.Combine(Directory.GetCurrentDirectory(), "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));
            MediaPlayer.VlcMediaplayerOptions = new string[] { };
            MediaPlayer.EndInit();

            MediaPlayer.MediaChanged    += MediaPlayerOnMediaChanged;
            MediaPlayer.LengthChanged   += MediaPlayerOnLengthChanged;
            MediaPlayer.EndReached      += VlcPlayerOnEndReached;
            MediaPlayer.PositionChanged += MediaPlayerOnPositionChanged;
        }
Example #4
0
        public FrmMain()
        {
            InitializeComponent();

            // build the VLC control
            vlcVideoPlayer = new Vlc.DotNet.Forms.VlcControl();
            vlcVideoPlayer.BeginInit();
            vlcVideoPlayer.PositionChanged += VlcVideoPlayer_PositionChanged;
            vlcVideoPlayer.VlcLibDirectory = new DirectoryInfo(Path.Combine(Directory.GetCurrentDirectory(), "vlc"));
            vlcVideoPlayer.Dock = DockStyle.Fill;
            vlcVideoPlayer.EndInit();
            pnlVideoPlayer.Controls.Add(vlcVideoPlayer);
        }
Example #5
0
        public Player() : base()
        {
            InitializeComponent();
            VLC = vlc.MediaPlayer;                                                                //просто удобнее обращаться
            VLC.VlcLibDirectory = new System.IO.DirectoryInfo(@"c:\Program Files\VideoLAN\VLC\"); //Путь может отличаться.
            VLC.EndInit();
            VLC.Play(new Uri(@"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"));

            timer = new System.Windows.Threading.DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            timer.Tick += new EventHandler(timerTick);
            timer.Start();
        }
Example #6
0
 public void EndInit()
 {
     MediaPlayer.EndInit();
 }