コード例 #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;
         */
    }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: achauglid/Dog
 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;
     }
 }
コード例 #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();
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: achauglid/Dog
 private void Btnstop_Click(object sender, RoutedEventArgs e)
 {
     VidPlayer.Stop();
     mediaPlayerIsPlaying = false;
     btnplay.Content      = "Play";
 }