QTPlayback

Author: Frank McPherson

Description
This plugin uses the QuickTime library to play a movie back to a Unity texture. If the movie contains sound, the sound should stay synchronized with the video. Interactive features of QuickTime are not supported - this is for in-order playback only. Using this (or any) C  plugin requires Unity Pro.

Usage
When the texture script is attached to a GUITexture, the approach we're taking on our current project, you can get the movie to play right side up by making the Pixel Inset Y Min greater than the Y Max.

When the texture script is attached to a primitive object, you can flip the movie rightside up by attaching a material and changing the Position->Y Scale to -1. Thanks to NCarter for the suggestion on that one.

If getting Error -43, check that the MoviePath paths are correct in TexturePlayback.cs. Better yet, expose the paths as vars and you can set them in the Inspector.--casemon 01:07, 13 May 2007 (PDT)

Note for use with Unity Versions 3.x.x the function GetInstanceID needs to be replaced with GetNativeTextureID --lowbloodsugar

Caveats
This plugin was written when Unity3D published to only the Mac OS X, Windows, and Web Player platforms, and each of the platforms used the OpenGL renderer. Since that time, Unity has shipped the capability to import and play back Ogg Theora movies, which has obviated much of the original need for this plugin. It will also no longer function correctly on Windows players with the default renderer, since Windows players now use the Direct3D renderer by default. One could modernize the plugin to support the D3D renderer on Windows by replacing calls to GetInstanceID and GetNativeTextureID with Texture.GetNativeTexturePtr. --fhmiv Mon Feb 25 10:35:42 EST 2013

Downloads
I've provided a number of downloads for this example. The first download contains the full Unity project with the simple example assets.

Updated 20070404 version from the forums, Unity Project with Assets

Original 20070209 Unity Project with Assets

The second download contains the XCode and Visual Studio projects I used to build the plug-in (restored).

Original 20070206 version of the Source Code

Versions

 * Added 20070404 update from forums. --casemon 13:15, 7 July 2007 (PDT)
 * Restored source code link (thanks WikiHistory and Neil!) Looks like this was accidentally edited; the edit was incomplete, open brackets, missing info, etc. --casemon 03:04, 2 May 2007 (PDT)
 * Added Jergen's modified csharp script from the forums. --casemon 03:04, 2 May 2007 (PDT)

Alternate Code
This is Jergen's code posted on the forum; it makes using the plugin a little more accessible. To use, replace  in your project with this:
 * This code was originally for the 20070209 version and likely needs updating to work with the 20070404 version of the plugin.