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); }
void Start() { t = 0; done = false; player = GetComponent<GvrVideoPlayerTexture>(); if (player != null) { player.Init(); } }
private void Start() { t = 0; done = false; player = GetComponent <GvrVideoPlayerTexture>(); if (player != null) { player.Init(); } }
void Start() { t = 0; done = false; player = GetComponent <GvrVideoPlayerTexture>(); controler.SetActive(false); if (player != null) { player.Init(); } }
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); } }
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 }
private void Start() { player.Init(); }