How-To Play Video in Unity Project Using MovieTexture

Unity3D How-To Play Video in Unity Project Using MovieTexture

If you want to play movie clip in your Unity3d project you need to have Pro version!

If you are using Windows machine you also need to have QuickTime installed.

After you have everything prepared just drag (or copy) your movie clip into Asset folder, after that you will see it imported.

You need a MovieTexture instance to use imported clip. To play movie clip use following code:
MovieTexture movie;
public void Play()
{
    movie.Play();
}

To stop or pause:
movie.Pause();
movie.Stop();

You can access audio clip through audioClip field:

var audio = movie.audioClip;
Importing problems

First, check if you have Apple Quick Time installed.

If you working with a team, it might be a problem when someone imported videos in the project, but you still see them as a simple files. To fix that just select movies and reimport them. For some reason, Unity doesn’t do that automatically.

Unity3D How-To Play Video in Unity Project Using MovieTexture