Unity 5.5.1f1
Hey guys I’m trying to load and play captured HoloLens videos and videos in general in my Unity app. The point is to be able to place a related video next to a event that’s happening.
IEnumerator LoadMovieTextureFromFile(string fileName)
{
Debug.Log(videoFolderPath + "\\" + fileName);
WWW www = new WWW(videoFolderPath + "\\" + fileName);
while (!www.isDone)
{
Debug.Log("Loading...");
yield return null;
}
Debug.Log(www.movie.duration + " <--- wwww");
if (www.error != null)
{
Debug.Log("Error: Can't laod movie! - " + www.error);
yield break;
}
MovieTexture video = www.movie as MovieTexture;
Debug.Log("Movie loaded");
Debug.Log(www.movie);
renderMat.material.mainTexture = video;
video.Play();
}
Here is a sample of my code that loads and attempts to play the video. www.error is not happening so I assume the video is loaded correctly.
The play surface is a panel with a Material using the sprites/Default shader.
Also a note HoloLens does capture in .mp4 which I’ve heard has issues with Unity, but I’ve also seen posts where it seems like people are loading them fine and just experiencing lag.
( https://forums.hololens.com/discussion/423/movietexture-on-hololens )