/* * 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; }
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(); }
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; }
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); }