protected void OnPlaybackStopping(InvocationEventArgs e) { if (PlaybackStopping != null) { PlaybackStopping(this, e); } }
private void Pause(bool userGenerated) { InvocationEventArgs e = new InvocationEventArgs(false, userGenerated); this.OnPlaybackPausing(e); if (e.Cancel || this.IsMediaNull) { return; } if (ContainsAudio) { if (!audio.Paused) { audio.Pause(); } } else { if (!video.Paused) { video.Pause(); } } this.btnPlay.Enabled = true; this.btnPause.Enabled = false; this.btnStop.Enabled = true; }
private void Stop(bool userGenerated) { InvocationEventArgs e = new InvocationEventArgs(false, userGenerated); this.OnPlaybackStopping(e); if (e.Cancel || this.IsMediaNull) { return; } if (ContainsAudio) { if (!audio.Stopped) { audio.Stop(); } } else { if (!video.Stopped) { video.Stop(); } } this.secondsPlayed = 0; posTemp = -1; this.btnPlay.Enabled = true; this.btnPause.Enabled = false; this.btnStop.Enabled = false; this.CurrentMediaScrobbled = false; this.trkPosition.Value = 0; }
public void Play(bool userGenerated) { InvocationEventArgs e = new InvocationEventArgs(false, userGenerated); this.OnPlaybackStarting(e); if (e.Cancel || this.IsMediaNull) { return; } if (!alreadyPlayed && this.CurrentMedia != null) { alreadyPlayed = true; } if (this.ContainsAudio) { if (!audio.Stopped & !audio.Paused) { this.OpenAudioFile(this.CurrentMedia.Filename); audio.Play(); } if (!audio.Playing) { audio.Play(); } } else { if (!video.Playing) { video.Play(); } } this.btnPlay.Enabled = false; this.btnPause.Enabled = true; this.btnStop.Enabled = true; this.timeToCount = this.TimeToCount; }