//------------------------------------------------------------- // 概要:MovieStartイベントが発生するか確認 //------------------------------------------------------------- private static void OpenTest(string streamUrl) { // 再生中の判定 bool isPlaying = false; // イベント登録 PecaPlayerForm form = new PecaPlayerForm(); form.Show(); PecaPlayerControl pecaPlayer = form.pecaPlayer; PrivateObject accessor = new PrivateObject(pecaPlayer); IMoviePlayer moviePlayer = (IMoviePlayer)accessor.GetField("moviePlayer"); moviePlayer.MovieStart += (sender, e) => { isPlaying = true; }; // テスト対象を実行 pecaPlayer.Open(streamUrl); // 再生されるまで待つ while (isPlaying == false) { Application.DoEvents(); Thread.Sleep(100); } }
//------------------------------------------------------------- // 概要:MovieStartイベントが発生するか確認 //------------------------------------------------------------- private static void OpenTest(string streamUrl) { // 再生中の判定 bool isPlaying = false; // イベント登録 PecaPlayerForm form = new PecaPlayerForm(); form.Show(); PecaPlayerControl pecaPlayer = form.pecaPlayer; PrivateObject accessor = new PrivateObject(pecaPlayer); IMoviePlayer moviePlayer = (IMoviePlayer)accessor.GetField("moviePlayer"); moviePlayer.MovieStart += (sender, e) => { isPlaying = true; }; // テスト対象を実行 pecaPlayer.Open(streamUrl); // 再生されるまで待つ while (isPlaying == false) { Application.DoEvents(); Thread.Sleep(100); } }