x


Getting a youtube vid , applying it as a texture to a gameobject and playing it with sound

function YoutubePlay(){


// Start download
var youtoobMuvee = new WWW(youtubeString);

// Make sure the movie is ready to start before we start playing
var movieTexture = youtoobMuvee.movie;
while (!movieTexture.isReadyToPlay)
yield;



funkBox.renderer.material.mainTexture=movieTexture;
audio.clip = movieTexture.audioClip;

// Play both movie & sound
funkBox.renderer.material.mainTexture.Play();
audio.Play();
}

Getting a youtube vid , applying it as a texture to a gameobject and playing it with sound doesnt work , i am getting these errors

!texture.texture
UnityEngine.MovieTexture:get_isReadyToPlay()
UnityEngine.MovieTexture:get_isReadyToPlay()

failed to create 2D texture
UnityEngine.MovieTexture:get_isReadyToPlay()
UnityEngine.MovieTexture:get_isReadyToPlay()

what am i doing wrong here?

more ▼

asked Aug 14 '10 at 10:41 AM

yeoldesnake 1 gravatar image

yeoldesnake 1
549 15 18 22

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

You can't stream videos from YouTube, since they are not in OGG format (Ogg Vorbis Theora)...

From the Unity Manual: (Link to manual)

The data must be a movie in Ogg Theora format.

more ▼

answered Aug 14 '10 at 05:36 PM

Cyb3rManiak gravatar image

Cyb3rManiak
1.6k 1 4 17

damn , will there be .flv support in unity 3?

Aug 15 '10 at 09:42 AM yeoldesnake 1
(comments are locked)
10|3000 characters needed characters left

You need to write your own decoder, THEN it's possible.

more ▼

answered Aug 14 '10 at 07:09 PM

Whimsical gravatar image

Whimsical
240 6 7 18

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2276
x546
x120

asked: Aug 14 '10 at 10:41 AM

Seen: 1535 times

Last Updated: Aug 14 '10 at 03:15 PM