Description
Returns a MovieTexture generated from the downloaded data (Read Only).
The data must be a movie in Ogg Theora format.
Even if the movie is not yet completely downloaded, this returns immediately,
allowing you to start playing the partial movie as it downloads.
var url =
"http://www.unity3d.com/webplayers/Movie/sample.ogg";
function Start () {
var www =
new WWW(url);
var movieTexture = www.movie;
while (!movieTexture.isReadyToPlay)
yield;
guiTexture.texture = movieTexture;
transform.localScale =
Vector3 (0,0,0);
transform.position =
Vector3 (0.5,0.5,0);
guiTexture.pixelInset.xMin = -movieTexture.width / 2;
guiTexture.pixelInset.xMax = movieTexture.width / 2;
guiTexture.pixelInset.yMin = -movieTexture.height / 2;
guiTexture.pixelInset.yMax = movieTexture.height / 2;
audio.clip = movieTexture.audioClip;
movieTexture.Play();
audio.Play();
}
@script RequireComponent (
GUITexture)
@script RequireComponent (
AudioSource)