// Use this for initialization void Start() { Current = this; vplayer = GetComponent <VideoPlayer>(); initPos = transform.position; Hide(); /* * vplayer.time = 0.1f; * vplayer.Pause(); */ //VidResource = UImanager.Current.Speakers[UImanager.Current.speakerState].Questions[0].vidResource; loadedClip = Resources.Load(UImanager.Current.Speakers[UImanager.Current.speakerState].Questions[0].vidResource) as VideoClip; vplayer.clip = loadedClip; /* * var myLoadedAssetBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "myassetBundle")); * if (myLoadedAssetBundle == null) * { * Debug.Log("Failed to load AssetBundle!"); * return; * } * * var prefab = myLoadedAssetBundle.LoadAsset<VideoClip>(UImanager.Current.Speakers[UImanager.Current.speakerState].Questions[0].vidResource) as VideoClip; * vplayer.clip = prefab; */ }
private void Button_Click_1(object sender, RoutedEventArgs e) { if (mediaPlayerIsPlaying) { btnplay.Content = "Play"; VidPlayer.Pause(); mediaPlayerIsPlaying = false; } else { btnplay.Content = "Pause"; VidPlayer.Play(); mediaPlayerIsPlaying = true; } }
// Hind the window void CloseApp() { // Reset the quesitons MyTest = new Test(); AnswerIndex = 0; WrongAnswerIndex = 0; VidPlayer.Source = null; VidPlayer.Stop(); VolumeHandler.TurnOffVolumeTimer(); main.Hide(); }
private void Btnstop_Click(object sender, RoutedEventArgs e) { VidPlayer.Stop(); mediaPlayerIsPlaying = false; btnplay.Content = "Play"; }