private async 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(); await this.PlayFileAsync(sourceFiles[0], MediaPlayer1); sourceFiles.RemoveAt(0); await this.PlayFileAsync(sourceFiles[0], MediaPlayer2); sourceFiles.RemoveAt(0); await MediaPlayer2.PauseAsync(); }
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(); } }