Beispiel #1
0
 protected void OnPlaybackStopping(InvocationEventArgs e)
 {
     if (PlaybackStopping != null)
     {
         PlaybackStopping(this, e);
     }
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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;
        }
Beispiel #4
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;
        }