Question by
richwarp · Jun 29, 2016 at 04:43 PM ·
movietexture
Getting Time in ms from Movie Texture?
I'm trying to implement this code to sync up audio to video that is being played back on a movie texture. I'm quite new to coding, and this error is throwing me - 'the name 'movieTexture' does not exist in the current context.
Can anyone advise as to what I'm doing wrong?
many thanks!
using UnityEngine; using System.Collections;
public class myDecoder : MonoBehaviour {
// Create a new C# script and get the instance of TB Spat Decoder in game object/scene
TBE.TBSpatDecoder Decoder;
void Awake()
{
// Get the instance of TB Spat Decoder on the game object
Decoder=Decoder.GetComponent<TBE.TBSpatDecoder> ();
// Set the decoder to by synchronised to an external source
Decoder.syncMode = TBE.TBSyncMode.TB_SYNC_EXTERNAL;
}
// Called every frame
void Update()
{
float videoTime = movieTexture.getTimeMs ();
Decoder.setExternalClockInMs (videoTime);
}
void Start()
{
movieTexture.Play ();
Decoder.play ();
}
}
Comment
Your answer
Follow this Question
Related Questions
Can you use a key press to change the Video playing on a Plane 0 Answers
Is there any way I can play a youtube video using just its URL in my app? (Unity v.5.6.0) 0 Answers
Is MovieTexture works on Linux Standalone app ? 1 Answer
how to assign video to albedo unity 0 Answers
Streaming video as MovieTexture 2 Answers