i want to download the movie and audio file when running the game from a server with url address i do not want to save the movie and audio file in my development file i want to download it from sever or a url address while running the game and i want to see the progress of movie and audio file download to my game while playing is it possible any alternate option is available in java script.in the below code i am using movie file directly from my my project file instead of that i want to use the movie file from the server or url during run time of game instead of saving in my project file.Thanks in advance
var renplane : Renderer;
var movtex : MovieTexture;
function Update()
{
movtex.loop = true;
renplane.renderer.material.mainTexture = movtex;
movtex.Play();
}
Try With this script from Manual
var url = "http://www.unity3d.com/webplayers/Movie/sample.ogg";
function Start () {
// Start download
var www = new WWW(url);
// Make sure the movie is ready to start before we start playing
var movieTexture = www.movie;
while (!movieTexture.isReadyToPlay)
yield;
// Initialize gui texture to be 1:1 resolution centered on screen
guiTexture.texture = movieTexture;
transform.localScale = Vector3 (0,0,0);
transform.position = Vector3 (0.5,0.5,0);
guiTexture.pixelInset.xMin = -movieTexture.width / 2;
guiTexture.pixelInset.xMax = movieTexture.width / 2;
guiTexture.pixelInset.yMin = -movieTexture.height / 2;
guiTexture.pixelInset.yMax = movieTexture.height / 2;
// Assign clip to audio source
// Sync playback with audio
audio.clip = movieTexture.audioClip;
// Play both movie & sound
movieTexture.Play();
audio.Play();
}
use the WWW class and it's movie property
the video should be in Ogg theora format and the documentation have a good sample. it's really easy to do.