Example #1
0
    // 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;
         */
    }
Example #2
0
 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;
     }
 }
Example #3
0
        // Hind the window
        void CloseApp()
        {
            // Reset the quesitons
            MyTest = new Test();

            AnswerIndex      = 0;
            WrongAnswerIndex = 0;

            VidPlayer.Source = null;
            VidPlayer.Stop();

            VolumeHandler.TurnOffVolumeTimer();

            main.Hide();
        }
Example #4
0
 private void Btnstop_Click(object sender, RoutedEventArgs e)
 {
     VidPlayer.Stop();
     mediaPlayerIsPlaying = false;
     btnplay.Content      = "Play";
 }