- Home /
How can I load a mp4 from a website to use as a Movie Texture at runtime?
New to Unity. Right now I have my code do this:
WWW w = new WWW(vidUrl);
Debug.Log(w.movie);
and I get this error:
MoviePlayback::LoadMovieData got NULL!
UnityEngine.WWW:get_movie()
<DownloadData>c__Iterator0:MoveNext() (at Assets/realAd/AdScript.cs:39)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
What is the right way to dynamically load a mp4 movie texture at runtime?
Hi,
I think I never used movie texture in Unity to play It's little hard for me to give you the proper answer but I just wanna let you know one thing: In case you are playing video from 'Youtube' the It will not play. You need a direct link to the file like "http://www.sample-videos.com/video/mp4/240/big_buck_bunny_240p_1mb.mp4"
As you can see the link contains the source file of the video.
But I strongly recommend that if you are using this video playing for you mobile devices then this might be little hard as the movie texture is not very optimized. Do use the following asset ( if you can purchase ) Best asset for most of the videos playing issues in Unity https://www.assetstore.unity3d.com/en/#!/content/10032