Sadness
Movie Textures are not supported on iOS. Instead, full-screen streaming playback is provided using Handheld.PlayFullScreenMovie.
http://docs.unity3d.com/Manual/class-MovieTexture.html
Anyway, I solved how to code for playing a movie on the iPhone.
- you could add a component to any object in a scene. In my case, I just added a C# script component(movieplayer) to the Main Camera.
-
- Also, you need to add a movie in the "StreamingAssets" folder in the "Assets" folder as seen in the image below.
-
- Finally, you code like this.
using UnityEngine;
using System.Collections;
public class movieplayer : MonoBehaviour {
// Use this for initialization
void Start () {
Handheld.PlayFullScreenMovie ("file://" + Application.streamingAssetsPath + "/"+"EasyMovieTexture.mp4");
Debug.Log (Application.streamingAssetsPath);
}
// Update is called once per frame
void Update () {
}
}