- Home /
Question by
Gflunky · May 07, 2019 at 11:26 AM ·
unity 5videotextureubuntu
why video texture doesn`t work on ubuntu 18.04 ?
hello everyone. guys, i`ve a problem with video texture on ubuntu 18.04. i just want to display a video on rawimage. here is code that i use. it works on windows 10 and ubuntu 16 but it doesn`t work on ubuntu 18.04 and i dont know why, please help me to find out what is wrong i`m doing.
VideoPlayer videoPlayer;
VideoSource videoSource;
AudioSource audioSource;
// Use this for initialization
IEnumerator Start () {
Debug.Log ("hello");
videoPlayer = gameObject.AddComponent<VideoPlayer> ();
audioSource = gameObject.AddComponent<AudioSource> ();
videoPlayer.source = VideoSource.VideoClip;
videoPlayer.url = "/home/max/video.ogv";
videoPlayer.Prepare ();
while (!videoPlayer.isPrepared) {
yield return null;
}
GetComponent<RawImage> ().texture = videoPlayer.texture;
videoPlayer.Play ();
/*WWW www = new WWW ("file:///home/max/New Unity Project/image.png");
yield return www;
Texture2D texture = www.texture;
this.GetComponent<RawImage> ().texture = texture;*/
}
// Update is called once per frame
void Update () {
}
Comment
Your answer

Follow this Question
Related Questions
Is it feasible to play 4K video in Unity? 8 Answers
running an external executable is failing 0 Answers
Unity for Ubuntu 14.04 64 bits 1 Answer
Unity 5 game intro 0 Answers
Unity 5 on a Ubuntu 14.04 32 bits 1 Answer