private void DisposeVideoTexture() { if (m_videoTexture != null) { m_videoTexture.Dispose(); m_videoTexture = null; Resources.UnloadUnusedAssets(); } }
void Start() { if (!string.IsNullOrEmpty(OgvUrl)) { UnityEngine.Debug.Log("Creating WWW for ogv"); #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER _videoPlugin = new NativeStreamingVideoPlugin(OgvUrl, gameObject); #elif UNITY_WEBGL _videoPlugin = new WebGLStreamingVideoPlugin(OgvUrl); #endif } }
private void CreateNewVideoTexture(string videoPath) { DisposeVideoTexture(); if (videoPath.Length > 0) { #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER m_videoTexture = new NativeStreamingVideoPlugin(videoPath, gameObject); #elif UNITY_WEBGL m_videoTexture = new WebGLStreamingVideoPlugin(videoPath, gameObject); #endif } }