コード例 #1
0
        private void btStart_Click(object sender, EventArgs e)
        {
            if (lbSourceFiles.Items.Count < 2)
            {
                MessageBox.Show("You must add 2 or more files to test seamless playback.");
                return;
            }

            InitPlayer(MediaPlayer1);
            InitPlayer(MediaPlayer2);

            foreach (var item in lbSourceFiles.Items)
            {
                sourceFiles.Add(item.ToString());
            }

            CurrentPlayer = MediaPlayer1;

            MediaPlayer1.Show();
            MediaPlayer2.Hide();
            PlayFile(sourceFiles[0], MediaPlayer1);
            sourceFiles.RemoveAt(0);

            PlayFile(sourceFiles[0], MediaPlayer2);
            sourceFiles.RemoveAt(0);
            MediaPlayer2.Pause();
        }
コード例 #2
0
        private void StopDelegateMethod2()
        {
            //timer1.Enabled = false;
            tbTimeline.Value = 0;

            MediaPlayer1.Show();
            MediaPlayer2.Hide();

            CurrentPlayer = MediaPlayer1;
            MediaPlayer1.Resume();
            if (sourceFiles.Count > 0)
            {
                PlayFile(sourceFiles[0], MediaPlayer2);
                sourceFiles.RemoveAt(0);
                MediaPlayer2.Pause();
            }
        }