I had no problem playing a full screen movie texture on my MAC iOS, its basicly a 15 seconds intro movie before loading the main menu.
But when I ran the build on the iPAD it gave mi this error:
Assets/Scripts/LoadDayVisit.cs(9,13): error CS0246: The type or namespace name `MovieTexture’ could not be found. Are you missing a using directive or an assembly reference?
And here is the script attached to the camera (nothing else in the scene):
using UnityEngine;
using System.Collections;
public class LoadDayVisit : MonoBehaviour {
//the GUI texture
private GUITexture videoGUItex;
//the Movie texture
private MovieTexture mTex;
//the AudioSource
private AudioSource movieAS;
//the movie name inside the resources folder
public string movieName;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void Awake()
{
GameObject maincam = GameObject.Find(“Main Camera”);
//get the attached GUITexture
videoGUItex = maincam.GetComponent();
//get the attached AudioSource
movieAS = maincam.GetComponent();
//load the movie texture from the resources folder
mTex = (MovieTexture)Resources.Load(movieName);
//set the AudioSource clip to be the same as the movie texture audio clip
movieAS.clip = mTex.audioClip;
//anamorphic fullscreen
videoGUItex.pixelInset = new Rect(Screen.width/2, Screen.height/2,0,0);
}
void OnMouseDown()
{
//set the videoGUItex.texture to be the same as mTex
videoGUItex.texture = mTex;
//Plays the movie
mTex.Play();
The problem with: Handheld.PlayFullScreenMovie() , is just that it doesn’t play my 1024 by 768 full sceen on the iPAD1.
I have an intro scene with a game object and this script on it: #pragma strict
function Start () {
Handheld.PlayFullScreenMovie (“introfinal.mov”, Color.black, FullScreenMovieControlMode.CancelOnInput);
}
Sorry but I am no programmer, trying to solve this problem with a very basic code knowledge (what do you mean by ading tags?)
Is it possible to integrate the Handheld.PlayFullScreenMovie method to my posted script (which was provided by a programmer), because as you can see it’s loading an intro scene and a “loading animation” before accessing the main menu (using the loadlevel.Asynch), here is the full script again:
using System.Collections;
public class IntroPlayMovie : MonoBehaviour {
//the GUI texture
private GUITexture videoGUItex;
//the Movie texture
private MovieTexture mTex;
//the AudioSource
private AudioSource movieAS;
//the movie name inside the resources folder
public string movieName;
// Use this for initialization
//the GUI texture
private GUITexture videoGUItex2;
//the Movie texture
private MovieTexture mTex2;
//the AudioSource
private AudioSource movieAS2;
//the movie name inside the resources folder
public string movieNameTransition;
// Use this for initialization
private bool once;
void Start () {
GameObject maincam = GameObject.Find("Main Camera");
//get the attached GUITexture
videoGUItex = maincam.GetComponent<GUITexture>();
//get the attached AudioSource
movieAS = maincam.GetComponent<AudioSource>();
//load the movie texture from the resources folder
mTex = (MovieTexture)Resources.Load(movieName);
//set the AudioSource clip to be the same as the movie texture audio clip
movieAS.clip = mTex.audioClip;
//anamorphic fullscreen
videoGUItex.pixelInset = new Rect(Screen.width/2, -Screen.height/2,0,0);
mTex2 = (MovieTexture)Resources.Load(movieNameTransition);
//set the videoGUItex.texture to be the same as mTex
videoGUItex.texture = mTex;
//Plays the movie
mTex.Play();
//mTex.
//mTex.loop = true;
//plays the audio from the movie
movieAS.Play();
once = false;
//Application.LoadLevelAsync("Brink_Night_UI");
}
// Update is called once per frame
void Update () {
if(mTex.isPlaying)
{
}
else
if(once == false)
{
once = true;
GameObject maincam = GameObject.Find("Main Camera");
//get the attached GUITexture
videoGUItex2 = maincam.GetComponent<GUITexture>();
//get the attached AudioSource
movieAS2 = maincam.GetComponent<AudioSource>();
//set the AudioSource clip to be the same as the movie texture audio clip
movieAS2.clip = mTex2.audioClip;
//anamorphic fullscreen
videoGUItex2.pixelInset = new Rect(Screen.width/2, -Screen.height/2-1,0,0);
//set the videoGUItex.texture to be the same as mTex
videoGUItex2.texture = mTex2;
//Plays the movie
mTex2.Play();
mTex2.loop = true;
//plays the audio from the movie
movieAS2.Play();
Application.LoadLevelAsync("Brink_MainMenu");
}
}
void Awake()
{
}
void OnMouseDown()
{
}
}
If you reply to a message in advanced mode (click on the button go advanced) you see this button # that’s for using code tags.
As for the video, do you have it in the Assets/Resources/ folder?
Sorry my bad it should be in the StreamingAssets folder. What happends when you make a new JavaScript script, and add this code to it:
function Start()
{
Handheld.PlayFullScreenMovie ("introfinal.mov", Color.black, FullScreenMovieControlMode.CancelOnInput);
}
Then turn off the script you where using and make an empty GameObject in your scene and add the JavaScript script you just made to the empty GameObject, and try to run it now on your iPad.