public void CommandTogglePlayPause()
 {
     if (player.IsPlaying)
     {
         player.Pause();
     }
     else
     {
         player.Play();
     }
 }
Esempio n. 2
0
 private void m_Template_TemplatePaused(object sender, PausedEventArgs e)
 {
     if (vlcControl.IsPlaying)
     {
         vlcControl.Pause();
     }
 }
Esempio n. 3
0
 private void TrackBar_MouseDown(object sender, MouseEventArgs e)
 {
     if (vlcControl != null)
     {
         vlcControl.Pause();
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Toggles the playback state between pause and play and shows the correct button for the playback state.
        /// </summary>
        private void TogglePause()
        {
            if (startPlay)                                // If the media has been set by calling the overloaded method VlcControl.SetMedia()
            {
                if (vlcControl.IsPlaying && !IsDvdMode()) // If the VlcControl class instance is playing, then pause.. (if not DVD (menus, etc.. --> can be annoying!))..
                {
                    vlcControl.Pause();
                    if (statistic != null) // this ensures that a saved playback will not be re-read from previous statistics..
                    {
                        statistic.Position = vlcControl.Time;
                    }

                    btnPlay.Visible  = true; // Set the button visibility
                    btnPause.Visible = false;
                }
                else // .. if the VlcControl class instance's playback state is paused, then play..
                {
                    if (startPlay) // avoid the play command to reload the saved playback position..
                    {
                        Database.UpdateFile(file.FullName, vlcControl.Time, vlcControl.Length, IsWacthed, Volume);
                    }

                    if (statistic != null && file != null)
                    {
                        statistic.Position = vlcControl.Time;
                    } // END: avoid the play command to reload the saved playback position..

                    vlcControl.Play();
                    btnPlay.Visible  = false; // Set the button visibility
                    btnPause.Visible = true;
                }
                wind   = false; // don't wind while paused or play is clicked
                rewind = false; // don't rewind while paused or play is clicked
            }
        }
Esempio n. 5
0
 private void videoPauseButton_Click(object sender, EventArgs e)
 {
     if (vlcControl != null)
     {
         if (vlcControl.IsPlaying)
         {
             vlcControl.Pause();
         }
     }
 }
Esempio n. 6
0
 private void vlcControl1_Click(object sender, EventArgs e)
 {
     if (_vlcControl1.IsPlaying == true)
     {
         _vlcControl1.Pause();
     }
     else if (_vlcControl1.IsPlaying == false)
     {
         _vlcControl1.Play();
     }
 }
Esempio n. 7
0
 public override void Pause()
 {
     if (media != null && playState == PlayState.Playing || playState == PlayState.Paused)
     {
         vlcCtrl.Pause();
         if (media.State == States.Paused)
         {
             playState = PlayState.Paused;
         }
         else
         {
             playState = PlayState.Playing;
         }
     }
 }
Esempio n. 8
0
 /// <summary>
 /// Pause/Resume playback on the selected Vlc control
 /// </summary>
 /// <param name="vlc">Vlc control to toggle</param>
 public static void TogglePause(VlcControl vlc)
 {
     if (vlc != null)
     {
         if (vlc.State == Vlc.DotNet.Core.Interops.Signatures.MediaStates.Paused)
         {
             vlc.Play();
             log.Debug(string.Format("{0} resume playing", vlc.Name));
         }
         else if (vlc.State == Vlc.DotNet.Core.Interops.Signatures.MediaStates.Playing)
         {
             vlc.Pause();
             log.Debug(string.Format("{0} pause", vlc.Name));
         }
     }
 }
Esempio n. 9
0
 /// <summary>
 /// Pauses this instance.
 /// </summary>
 /// <returns>Task.</returns>
 public void Pause()
 {
     _vlcControl.Pause();
 }
Esempio n. 10
0
 private void Pause(object o)
 {
     _player.Pause();
     IsPlaying = false;
 }
Esempio n. 11
0
 private void button8_Click(object sender, EventArgs e)
 {
     control.Pause();
 }