Hey guys,
This is the result I get of a video that plays fine in unity, doing a print right
after the Play() function. Format is OGV
I would like to get this resolved instead of doing isPlaying.
Any ideas will be greatly appreciated.
Hey guys,
This is the result I get of a video that plays fine in unity, doing a print right
after the Play() function. Format is OGV
I would like to get this resolved instead of doing isPlaying.
Any ideas will be greatly appreciated.
Before you call the Play() function, the duration is -1.
cf. http://forum.unity3d.com/threads/121989-MovieTexture-duration-does-not-work-with-OGV-videos
the duration will be -1 for some reason, but I successfully find a workaround:
IEnumerator playVideoList()
{
Renderer fr = GetComponent();
fr.material.mainTexture = videoList[0];
MovieTexture fmovie = (MovieTexture)fr.material.mainTexture;
fmovie.Play();
AudioSource faud = GetComponent();
faud.clip = fmovie.audioClip;
faud.Play();
//yield return null;
while (true)
{
Renderer r = GetComponent<Renderer>();
MovieTexture movie = (MovieTexture)r.material.mainTexture;
if (!movie.isPlaying)
{
if (idx == videoList.Length - 1) break;
r.material.mainTexture = videoList[++idx];
movie = (MovieTexture)r.material.mainTexture;
movie.Stop();
movie.Play();
AudioSource aud = GetComponent<AudioSource>();
aud.clip = movie.audioClip;
aud.Stop();
aud.Play();
}
yield return new WaitForFixedUpdate();
}
}
Catch up on the newest movies, TV series, and more to get the most out of Fmovies. It’s simple to discover new releases and binge-watch your favourite TV episodes with Fmovies. instantly access a huge selection of films and TV shows.