コード例 #1
0
        private IEnumerator QueuePlayCoroutine(PlayOptions options)
        {
            bool needsRestart = !string.IsNullOrEmpty(videoPlayer.videoURL);

            if (needsRestart)
            {
                Destroy(videoPlayer);
                videoPlayer        = gameObject.AddComponent <GvrVideoPlayerTexture>();
                videoPlayer.Screen = MediaScreen;
            }

            videoPlayer.videoType = (GvrVideoPlayerTexture.VideoType)options.Type;
            videoPlayer.videoURL  = options.Path;

            yield return(new WaitForEndOfFrame());

            videoPlayer.Init();

            while (!videoPlayer.VideoReady)
            {
                yield return(new WaitForEndOfFrame());
            }

            videoPlayer.Play();

            queuedPlayCoroutine = null;
            yield return(null);
        }
コード例 #2
0
 void Start() {
   t = 0;
   done = false;
   player = GetComponent<GvrVideoPlayerTexture>();
   if (player != null) {
     player.Init();
   }
 }
コード例 #3
0
 private void Start()
 {
     t      = 0;
     done   = false;
     player = GetComponent <GvrVideoPlayerTexture>();
     if (player != null)
     {
         player.Init();
     }
 }
コード例 #4
0
 void Start()
 {
     t      = 0;
     done   = false;
     player = GetComponent <GvrVideoPlayerTexture>();
     controler.SetActive(false);
     if (player != null)
     {
         player.Init();
     }
 }
コード例 #5
0
 public void loadBrief(Configuration configuration)
 {
     videoPlayer.videoURL = "jar:file://${Application.dataPath}!/assets/brief" + configuration.climate + ".mp4";
     videoPlayer.SetOnExceptionCallback((type, message) => {
         Debug.LogError("GvrVideoPlayerTexture threw Exception of type: " + type + ": " + message);
     });
     if (!videoPlayer.Init())
     {
         Debug.LogError("Failed to init GvrVideoPlayerTexture with video: " + videoPlayer.videoURL);
     }
 }
コード例 #6
0
    void setupGVR()
    {
        gvrGroup.SetActive(true);

                #if UNITY_ANDROID && !UNITY_EDITOR
        // Assign a different material
        domeMats     = domeObj.GetComponent <Renderer>().materials;
        domeMats [0] = gvrVideoMat;
        domeObj.GetComponent <Renderer>().materials = domeMats;
        // Enable the gvr video texture player to play the file jar:file://${Application.dataPath}!/assets/animaticpoem_1.mp4
        GvrVideoPlayerTexture gvrplayer = domeObj.GetComponentInChildren <GvrVideoPlayerTexture>();
        gvrplayer.enabled = true;
        gvrplayer.Init();
                #else
        // Enable the Unity Video Texture Player
        domeObj.GetComponentInChildren <VideoPlayer>().enabled = true;
                #endif
    }
コード例 #7
0
ファイル: Main.cs プロジェクト: KosmoGalaxy/flc-unity-video
 private void Start()
 {
     player.Init();
 }