Hi there, I'm new to Unity (using 5.6.2f1) and I've read a few discussion over the years about video issues but I still can't have video inside unity. So I tried .mp4, mwv and ogv and none of them works. Actually ogv it's the only format which doesn't throw errors, however I still can't link it to my movietexture (I get a forbidden icon when I try to link it to my variable, nothing in the console). If I apply the transcode I'll get a warning about an issue with 30 audio samples but that's it. the import seems to be fine as I can preview the video in the top left part of the screen. This is the simple script I am using (taken from this video ) Any help please? Thank you! Code (csharp): public class playVideo : MonoBehaviour { public MovieTexture movie; private AudioSource audio; // Use this for initialization void Start () { GetComponent<RawImage>().texture = movie as MovieTexture; audio = GetComponent<AudioSource>(); audio.clip = movie.audioClip; movie.Play(); audio.Play(); } // Update is called once per frame void Update () { if(Input.GetKeyDown(KeyCode.Space) && movie.isPlaying) { movie.Pause(); } else { movie.Play(); } } }
don't use MovieTexture, it's outdated since you're using 5.6, there's new VideoPlayer component; which has its own share of (mostly non showstopping) issues, but support for native playback and codecs is better
What operating system are you using? I am using OSX 10.9.5 and it crashes every time when pressing play in the VideoComponent. I think it only works for OSX 10.10 above.