Simple script to play movie in android
already tried and tested a few scripts with Handheld.PlayFullScreenMovie but without success): someone has some functional script for this.
I have already created empty scene where the logo will play the game and then go to the menu, already have the logo in mp4!
I would be very grateful for the help!
@hexagonius How can I add UI button such as Skip button while playing the video on Android?
That wasn't an answer and please ask a seperate question.
Answer by hexagonius · Sep 06, 2015 at 05:11 PM
just the call should work. have you put the mp4 into StreamingAssets? Have you tried using the example code from the docs exactly as provided?
http://docs.unity3d.com/ScriptReference/Handheld.PlayFullScreenMovie.html
no, how put in s$$anonymous$$$$anonymous$$gAssets? sorry, this is the first game for android I do!
im create folder Strea$$anonymous$$gAssets and put my movie there. and this script
using UnityEngine;
using System.Collections;
public class Intro$$anonymous$$ovie : $$anonymous$$onoBehaviour {
void Start() {
StartCoroutine(CoroutinePlay$$anonymous$$ovie());
}
protected IEnumerator CoroutinePlay$$anonymous$$ovie() {
Handheld.PlayFullScreen$$anonymous$$ovie ("finalandroid.mp4", Color.black, FullScreen$$anonymous$$ovieControl$$anonymous$$ode.CancelOnInput);
yield return new WaitForSeconds(6.0f); //Allow time for Unity to pause execution while the movie plays.
Application.LoadLevel("main$$anonymous$$enu");
}
}
but my movie dont play ): what could it be?
thanks for help (:
only part I found was about the format.you sure one of these matches? :
H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. Note that B frames are not supported in the Baseline profile. $$anonymous$$PEG-4 Part 2 video (Simple Profile).
the movie was exported using adobe premier as an h.264 format, 640x480 29.9 fps movie file. (i used a preset for android tablets phone devices 480p)
I looked if the video was playing on android, it seems that it appears but it goes very fast. $$anonymous$$y Video has 6 seconds duration