I play an .ogg video on a GUI movie texture. The video plays good. But the audio has a delay.
When I play the .ogg video separately it plays okay.
This is how i did.
I created an empty gameobject. Then attached the script ( given below ) After that i assigned the audio source to the gameobject.
Script
var myMovie:MovieTexture ;
var me :int;
function Start()
{
audio.clip = myMovie.audioClip;
audio.Play();
myMovie.Play();
}
function OnGUI()
{
GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), myMovie);
}
function Update ()
{
if(!myMovie.isPlaying || Input.GetKeyDown(KeyCode.Escape) ){
Application.LoadLevel(me);
}
}
help me with this script.
Any suggestions appreciated.