private void Start_Click(object sender, RoutedEventArgs e)
        {
            if (_isPause)
            {
                _player.Play();
            }
            else
            {
                _player.Play(_Openningfile);
            }

            btnStart.Visibility = Visibility.Collapsed;
            btnPause.Visibility = Visibility.Visible;
            btnStop.Visibility  = Visibility.Visible;
        }
Example #2
0
        //Vlc.DotNet.Forms.VlcControl vlc
        void   t()
        {
            Vlc.DotNet.Forms.VlcControl vlc = new Vlc.DotNet.Forms.VlcControl();
            ((System.ComponentModel.ISupportInitialize)(vlc)).BeginInit();
            //this.SuspendLayout();

            this.Controls.Add(vlc);

            vlc.VlcLibDirectoryNeeded += vlc_VlcLibDirectoryNeeded;
            ((System.ComponentModel.ISupportInitialize)(vlc)).EndInit();
            //this.ResumeLayout(false);

            //Vlc.DotNet.Forms.VlcControl vlc = new Vlc.DotNet.Forms.VlcControl();



            //wz w1 = GetWZ(sm, i, wei, hei, 0, y0);
            vlc.Location = new System.Drawing.Point(0, 0);
            vlc.Size     = new System.Drawing.Size(this.Width, this.Height);
            //vlc.Source = jt1.url;
            // vlc.Video.AspectRatio = vlc.Width.ToString() + ":" + vlc.Height.ToString();

            //、、//、 vlc.Play(new Uri("rtsp://169.85.100.36/axis-media/media.amp?camera=1"));
            //this.Controls.Add(vlc);

            vlc.Play(new Uri("rtsp://169.85.100.36/axis-media/media.amp?camera=1"));
        }
Example #3
0
        private void btnStartRec_Click(object sender, EventArgs e)
        {
            vlcRecorder.SetMedia(CommonParam.mConfig.videoUrl,
                                 ":sout=#transcode{vcodec=theo,vb=1000,scale=1,acodec=flac,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ogg,dst="
                                 + CommonParam.ProgramPath + CommonParam.SessionFolderName + "\\video_" + DateTime.Now.ToString(@"yyyy_MM_dd.HH_mm_ss") + ".mp4}");
            vlcRecorder.Play();

            timer1.Start();
            timer1.Interval  = 500;
            nRecTimeInSecond = 0;

            label43.Visible = true;

            btnStartRec.Enabled = false;
            btnStopRec.Enabled  = true;
            btnPause.Enabled    = true;
        }
Example #4
0
 private void PlayBtn_Click(object sender, RoutedEventArgs e)
 {
     if (VLC.IsPlaying)
     {
         VLC.Pause();
     }
     else
     {
         VLC.Play();
     }
 }
Example #5
0
        public void Play()
        {
            if (!vlc_ok)
            {
                return;
            }


            if (is_end)
            {
                MediaPlayer.Play(new FileInfo(source));

                is_end = false;
            }

            old_time = DateTime.UtcNow;
            timer.Start();
            MediaPlayer.Play();

            // set position if need
            MediaPlayer.Position = (float)this.position;
        }
Example #6
0
 private void BtnPlay_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(FilePath))
     {
         if (IsStopped)
         {
             vlcControl.Play(new Uri(FilePath));
             IsRunning = false;//Will be Changed in next
         }
         if (IsRunning)
         {
             BtnPlayPause.Image = Properties.Resources.next_16x16;
         }
         else
         {
             BtnPlayPause.Image = Properties.Resources.pause_16x16;
         }
         IsRunning = !IsRunning;
         vlcControl.Pause();
         IsStopped = false;
     }
 }
Example #7
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 #8
0
        public bool Play()
        {
            if (!IsMediaPresent || Status == MEDIA_STATUS.PLAYING)
            {
                return(false);
            }

            control.Play();

            /*
             * if(this.relatedVideo != null)
             * {
             *  this.relatedVideo.Play();
             * }*/

            return(true);
        }
Example #9
0
 public void Play(string path)
 {
     this.Visible = true;
     videopath    = new Uri(path);
     vlcControl1.Play(videopath);
 }
        private void btnPlay_Click(object sender, RoutedEventArgs e)
        {
            Vlc.DotNet.Core.VlcMediaPlayer player2 = new Vlc.DotNet.Core.VlcMediaPlayer();

            player.Play(new Uri(txtURI.Text));
        }
Example #11
0
        public void spxshi()
        {
            try
            {
                TC.yx = false;

                //清除现有镜头
                this.Cursor = Cursors.WaitCursor;
                foreach (mjpeg.cameraW c in arc)
                {
                    c.mjpegSource.Yx = false;
                    c.Stop();
                    c.Dispose();
                }
                foreach (Vlc.DotNet.Forms.VlcControl c in arr)
                {
                    c.Stop();
                    c.Dispose();
                }
                ar.Clear();
                arc.Clear();
                arr.Clear();
                GC.Collect();
                int sm = getsm(jtss.Count);
                TC.yx = true;
                //显示
                int wei = this.Width;
                int hei = this.Height - 60;
                int y0  = 30;
                int i   = 0;
                foreach (JT jt1 in jtss)
                {
                    if (i < sm)
                    {
                        bool rtsp = jt1.url.Trim().ToUpper().Substring(0, 4) == "RTSP";
                        if (rtsp)
                        {
                            Vlc.DotNet.Forms.VlcControl vlc = new Vlc.DotNet.Forms.VlcControl();
                            ((System.ComponentModel.ISupportInitialize)(vlc)).BeginInit();
                            this.SuspendLayout();

                            wz w1 = GetWZ(sm, i, wei, hei, 0, y0);
                            vlc.Location = new System.Drawing.Point(w1.x, w1.y);
                            vlc.Size     = new System.Drawing.Size(w1.w, w1.h);
                            this.Controls.Add(vlc);
                            try
                            {
                                vlc.VlcLibDirectoryNeeded += vlc_VlcLibDirectoryNeeded;
                                ((System.ComponentModel.ISupportInitialize)(vlc)).EndInit();
                                this.ResumeLayout(false);

                                vlc.Video.AspectRatio = vlc.Width.ToString() + ":" + vlc.Height.ToString();

                                vlc.Play(new Uri(jt1.url));
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("联系计算机人员安装VLC控件:" + ex.ToString());
                            }
                            //vlc.Play(new Uri("rtsp://169.85.100.36/axis-media/media.amp?camera=1"));
                            ar.Add(vlc);
                            arr.Add(vlc);
                            vlc.Resize += vlc_Resize;
                        }
                        else
                        {
                            c = new cameraW();
                            wz w1 = GetWZ(sm, i, wei, hei, 0, y0);
                            c.Location = new System.Drawing.Point(w1.x, w1.y);
                            c.Size     = new System.Drawing.Size(w1.w, w1.h);
                            c.Source   = jt1.url;
                            this.Controls.Add(c);
                            ar.Add(c);
                            arc.Add(c);
                            c.Start();
                        }
                        i = i + 1;
                    }
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.Message); }
            finally
            { this.Cursor = Cursors.Default; }
        }