Hi!
I have a small problem playing a movie clip at start of a scene (i want to make an intro after new game was clicked), however my video doesn´t play. there is only a milisecond of a black screen and that´s it.
I have to option wait until finished on.
Here is the video for download.
http://r6---sn-p5qlsnsd.googlevideo.com/videoplayback?ipbits=0&mime=video/mp4&ratebypass=yes&mt=1438893978&mv=m&ms=au&sver=3&dur=60.627&signature=CFA4D6BA0625A5EBF952E2F4DCF8B4B0A4AC579E.B90EA9F0BABD5634D036056D128C4A507A748D5D&key=yt5&mn=sn-p5qlsnsd&itag=22&id=o-AG8Fk5_fDPPo-1Tu0UetGaNrV_7nYlisDOQW64zHSRCr&expire=1438915667&mm=31&ip=2a03:8180:1001:16a::2&lmt=1438892930931106&fexp=9407992,9408710,9413139,9415365,9415485,9416126,9416227,9416312,9416481,9416729,9417457,9418084,9418153,9418200,9418203,9418435&source=youtube&sparams=dur,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,nh,pl,ratebypass,source,upn,expire&initcwndbps=1802500&pl=40&nh=IgpwcjAzLmlhZDA3KgkxMjcuMC4wLjE&upn=KljWEcMhf2k&title=intro
cheers
Comments
Now I'm using this script on an empty gameobject to play the movie:
using UnityEngine;
using System.Collections;
public class playMovie : MonoBehaviour {
public AC.ActionListAsset actionToRunAfter;
public string url = "http://www.yoursite.com/yourvideo.mov";
// Use this for initialization
void Start () {
Debug.Log ("Trying to play movie!");
StartCoroutine(PlayStreamingVideo(url));
}
private IEnumerator PlayStreamingVideo(object URL) {
Handheld.PlayFullScreenMovie((string)URL, Color.white, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFill);
yield return new WaitForEndOfFrame();
yield return new WaitForEndOfFrame();
Debug.Log("Video playback completed.");
AC.AdvGame.RunActionListAsset(actionToRunAfter);
}
}
hope this helps!
The method to play movies varies depending on your device. What platform are you building to, and does the problem only occur in builds or in the editor as well?
For some reason, Unity makes it especially difficult to play a movie on desktop platforms - and you can only play the movie as a texture on a material.
You will have to create a Plane / Quad in your scene, position it so that it spans the FOV of the camera, and assign it a custom material (a default unlit textured should be all you need). Then assign that same material in the Action's slot - the movie will play on that material, and in turn play it full-screen on your Plane/quad.
I can't say for why it won't wait until finish - the code is correct - but if it's not working, try unchecking "Wait until finish" and instead use an Engine: Pause game Action afterwards that pauses the game by the clip's duration time.