- Home /
Streaming video to movie texture in web player
Hi all! I am trying to build a streaming video gallery inside a web player. There will be several videos so I would like to have them streamed from my server. The videos must be played on a movietexture plane in the environment. I am not a code writer at all but I have looked into using the WWW class and cannot seem to make the videos stream inside the web player build. However when I build to a windows stand alone player the videos will stream from the server. I am using unity pro version 3.5.6f4.
Does anyone know if there are specific limitations of the web player that keep it from being able to stream videos?
If not, could someone kindly provide some help with the specific code that would make this work please?
I have already tried the code here but was unable to get it to work.
The following code will enable the videos to stream inside the stand alone player but not the web player:
var url = "http://academic.cahnrs.wsu.edu/virtual-tour/videos/creamery-scholarship.ogv";
@script RequireComponent (AudioSource)
var movieTexture;
function Start ()
{ var www = new WWW (url); var movieTexture = www.movie; while (!movieTexture.isReadyToPlay) yield; renderer.material.mainTexture = movieTexture; audio.clip = movieTexture.audioClip; movieTexture.Play (); audio.Play (); }
Thanks for any help.
try to ad this there was no action to play it
function On$$anonymous$$ouseDown () {
if (renderer.material.mainTexture.isPlaying) { renderer.material.mainTexture.Pause(); } else { renderer.material.mainTexture.Play(); } }