1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unity Dev: play a movie on the iPhone | Handheld.PlayFullScreenMovie issue

Last updated at Posted at 2015-11-26

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.
  • Screen Shot 2015-11-26 at 20.10.21.png
  • Also, you need to add a movie in the "StreamingAssets" folder in the "Assets" folder as seen in the image below.
  • Screen Shot 2015-11-26 at 20.10.40.png
  • 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 () {
	
	}
}
  • That's all you need to do before build your iOS app. The sad thing is, however, you cannot make sure whether or not the code works fine unless you actually deploy the app on the iPhone. In the emulator you would see nothing.
  • Screen Shot 2015-11-26 at 20.20.10.png
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?