protected IEnumerator DoIntroductionVideo(string playPrompt, string repeatPrompt) { yield return(PressAnyKey(playPrompt)); bool replay = false; do { //start video player and wait for it to stop playing SetRamulatorState("INSTRUCT", true, new Dictionary <string, object>()); videoPlayer.StartVideo(); while (videoPlayer.IsPlaying()) { yield return(null); } SetRamulatorState("INSTRUCT", false, new Dictionary <string, object>()); SetRamulatorState("WAITING", true, new Dictionary <string, object>()); textDisplayer.DisplayText("repeat video prompt", repeatPrompt); while (!Input.GetKeyDown(KeyCode.Y) && !Input.GetKeyDown(KeyCode.N)) { yield return(null); } textDisplayer.ClearText(); SetRamulatorState("WAITING", false, new Dictionary <string, object>()); replay = Input.GetKey(KeyCode.N); }while (replay); }
protected IEnumerator DoIntroductionVideo() { yield return(PressAnyKey("Press any key to play movie.")); bool replay = false; do { //start video player and wait for it to stop playing SetRamulatorState("INSTRUCT", true, new Dictionary <string, object>()); videoPlayer.StartVideo(); while (videoPlayer.IsPlaying()) { yield return(null); } SetRamulatorState("INSTRUCT", false, new Dictionary <string, object>()); SetRamulatorState("WAITING", true, new Dictionary <string, object>()); textDisplayer.DisplayText("repeat video prompt", "Press Y to continue to practice list, \n Press N to replay instructional video."); while (!Input.GetKeyDown(KeyCode.Y) && !Input.GetKeyDown(KeyCode.N)) { yield return(null); } textDisplayer.ClearText(); SetRamulatorState("WAITING", false, new Dictionary <string, object>()); replay = Input.GetKey(KeyCode.N); }while (replay); }
private IEnumerator DoCountdown() { countdownVideoPlayer.StartVideo(); while (countdownVideoPlayer.IsPlaying()) { yield return(null); } // for (int i = 0; i < currentSettings.countdownLength; i++) // { // textDisplayer.DisplayText ("countdown display", (currentSettings.countdownLength - i).ToString ()); // yield return PausableWait (currentSettings.countdownTick); // } }
public void ShowVideo(string video, bool skippable, Action callback) { if (videoControl == null) { throw new Exception("No video player in this scene"); } // absolute video path string videoPath = System.IO.Path.Combine(fileManager.ExperimentRoot(), (string)GetSetting(video)); if (videoPath == null) { throw new Exception("Video resource not found"); } videoControl.StartVideo(videoPath, skippable, callback); }
private async void ShowThreadInfo() { int i = 0; bool vidimage = false; // falso = imagem while (true) { if (!s_socket) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync( CoreDispatcherPriority.Normal, () => { canvas.Children.Clear(); mediaelement.Source = null; }); if (!s_video) { if (vidimage) { i = 0; } vidimage = false; //imagens int val = imagens.Count; if (val != imagens.Count) { i = 0; } if (imagens.Count > 0 && !desenho) { if (i >= imagens.Count) { i = 0; } ImageControl imageControle = new ImageControl(); imagem_atual = imagens[i]; await imageControle.AddImgtoCanvasAsync(canvas, imagens[i]); await Task.Delay(time); i++; } } else { if (!vidimage) { i = 0; } vidimage = true; //videos //imagens int val = videos.Count; if (val != videos.Count) { i = 0; } if (videos.Count > 0 && !desenho) { if (i >= videos.Count) { i = 0; } VideoControl videoControl = new VideoControl(); videoControl.StartVideo(videos[i], mediaelement); await Task.Delay(Convert.ToInt32(duracao[i])); i++; } } } } }