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?

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.

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

Here is an example of streaming youtube on a texture , it uses ffmpeg and Unity native plugins , unfortunately ,it’s unlikely to ever been accepted on unity asset store …