Esempio n. 1
0
        private void lstVideos_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                video.Stop();
                video.Dispose();
            }
            catch { }

            timerVideo.Enabled = false;
            int index = listaVideos.SelectedIndex;

            _selectedIndex   = index;
            video            = new Microsoft.DirectX.AudioVideoPlayback.Video(_videoPaths[index], false);
            video.Owner      = painelVideo;
            painelVideo.Size = _pnlSize;

            do
            {
                var currentAnimal = _container.GetInstance <FormVideoAnalyzerSelecionaAnimal>();
                currentAnimal.ShowDialog();
                if (currentAnimal.AnimalSelecionado == null)
                {
                    return;
                }
                IdAnimalEmAnalise = currentAnimal.AnimalSelecionado.IdAnimal;
            } while (IdAnimalEmAnalise == Guid.Empty);
            video.Play();
            btnPlay.Image                 = Resources.Knob_Pause;
            video.Ending                 += Video_Ending;
            txtDiretorio.Text             = listaVideos.Text;
            trackBarVideoProgress.Maximum = Convert.ToInt32(video.Duration);
            timerVideo.Enabled            = true;
        }
Esempio n. 2
0
 private void btnPlay_Click(object sender, EventArgs e)
 {
     if (!video.Playing)
     {
         video.Play();
         timerVideo.Enabled = true;
         btnPlay.Image      = Resources.Knob_Pause;
     }
     else if (video.Playing)
     {
         video.Pause();
         timerVideo.Enabled = false;
         btnPlay.Image      = Resources.Knob_Play_Green;
     }
 }
Esempio n. 3
0
        public void Play()
        {
            if (video == null)
            {
                return;
            }

            if (checkpoint == -100 && cut.Checked)
            {
                NextSegmentRequested?.Invoke(this, null);
                return;
            }

            video.Play();
            timer.Start();
            TimerTicked(this, null);

            playBtn.Text = "\x23F8";
        }
 private void Form1_Load(object sender, EventArgs e)
 {
     _video.Play();
 }
Esempio n. 5
0
 /// <summary>
 /// Plays the Video.
 /// </summary>
 public void Play()
 {
     CurrentState = MediaStates.Playing;
     vid.Play();
 }