Video on an object. For example, a television.

Hello,

To play videos I found this code:

var url = "http://www.unity3d.com/webplayers/Movie/sample.ogg"

Start function () { / / Start download var www = new WWW (url);

/ / Make sure the movie is ready to start Before we start playing var MovieTexture = www.movie; while (! movieTexture.isReadyToPlay) yield;

/ / Initialize texture gui to Be 1:1 resolution centered on screen 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;

/ / Assign clip to audio source / / Sync with audio playback audio.clip = movieTexture.audioClip;

/ / Play Both movie & sound movieTexture.Play (); audio.Play ();

}

It works, but the video does not appear on the objects.

1 - I can play the video on an object? I wanted to emulate a television

2 - What code would you use to stop the video with the click of a mouse?

Thanks.

This will help you:

http://unity3d.com/support/documentation/Manual/Video%20Files.html