- Home /
Unity3D Free | Play Video
I'm currently using Unity3D, the free version. I'm aware that Unity3D Pro has the option to play videos with ease, but is there a way to play a video in Unity3D Free, like before (or after) the Unity3D water mark?
as the other s suggest, you could play a simple animation. (probably not too big images)
you could just grab 2dToolkit, which makes that as easy as humanly possible.
Answer by NOVAgaming · Oct 22, 2012 at 01:07 AM
You can't play videos on either, but you may show images very fast,simulating a video effect.
Answer by Apples_mmmmmmmm · Oct 22, 2012 at 01:35 AM
You could export your video as images (likely 24 images per second) instead of the video as a singular file. Then through script you could call the images in order at the rate that you want them to appear, for a 24fps setup you would bring up a image every 1/24 of a second.
Answer by arky25 · Apr 05, 2013 at 02:19 PM
I wrote a script wich reads out all pictures out of a folder. You can use Virtualdub to make your clip to pictures, load the folder into unity 3d and then type in the name of the folder in the script. The script looks like this. pragma strict
var imageFolderName = "";
var MakeTexture = false;
var pictures = new Array();
var loop = false;
var counter = 0;
var Film = true;
var PictureRateInSeconds:float = 1;
private var nextPic:float = 0;
function Start () {
if(Film == true){
PictureRateInSeconds = 0.04166666666666666666;
}
var textures : Object[] = Resources.LoadAll(imageFolderName);
for(var i = 0; i < textures.Length; i++){
Debug.Log("found");
pictures.Add(textures[i]);
}
}
function Update () {
if(Time.time > nextPic){
nextPic = Time.time + PictureRateInSeconds;
counter += 1;
if(MakeTexture){renderer.material.mainTexture = pictures[counter];}
}
if(counter >= pictures.length){
Debug.Log("fertig");
if(loop){
counter = 0;
}
}
}
you have to create a Resources folder and put the folder with the pictures into that folder. But it works great!
Hm, this code has a major problem. It preloads the images and will use a huge amount of memory. On a mobile device we are probably talking seconds, if you use a modern HD format.
To make this work, you would need to load, decode, display and release each image in sequence. But this is very time consu$$anonymous$$g and would completely kill the framerate. For low resolution videos it might be an option though.
Your answer
Follow this Question
Related Questions
I don't see ads on my game after downloading it from Google play 1 Answer
windows to ios? 1 Answer
Changing Unity Free splash screen and icon 1 Answer
system.net.sockets in unity3d free 0 Answers
Searching for free .raw Heightmaps 0 Answers