MovieTexture Can't Compile in Android
I need to put video in Android, but error CS0246: The type or namespace name "MovieTexture" could not be found. Are you missing a using directive or an assembly reference?
Can Help me please? MovieTexture can't compile in Android :'(
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (GUITexture))]
[RequireComponent (typeof (AudioSource))]
public class PlayVideo : MonoBehaviour
{
private GUITexture videoGUI;
private MovieTexture movieC;
private AudioSource movieA;
public string movieName;
void Awake()
{
videoGUI = this.GetComponent<GUITexture>();
movieA = this.GetComponent<AudioSource>();
movieC = (MovieTexture)Resources.Load(movieName);
movieA.clip = movieC.audioClip;
float newHeight = -(Screen.height-(Screen.width/(movieC.width/(float)movieC.height)));
float yOffset = (-Screen.height-newHeight)/2;
videoGUI.pixelInset = new Rect(Screen.width/2, yOffset,0,newHeight);
}
void Start()
{
videoGUI.texture = movieC;
movieC.Play();
movieA.Play();
}
public void PauseButton()
{
if (movieC.isPlaying) {
Debug.Log ("Pause");
movieC.Pause ();
movieA.Pause ();
} else {
Debug.Log ("Play");
movieC.Play ();
movieA.Play ();
}
}
}
Answer by henkjan · Jan 27, 2016 at 02:21 PM
MovieTextures don't work on mobile builds. You could use Handheld.PlayFullScreenMovie if you want to play it fullscreen. Or else there some solution in the asset store: https://www.assetstore.unity3d.com/en/#!/search/page=1/sortby=popularity/query=category:162
Your answer
Follow this Question
Related Questions
MovieTexture play on Android 1 Answer
GST Movie Texture plugin - error CS0246 2 Answers
what should i do for play video in full screen for android project 0 Answers
How to apply GStreamer Movie Texture 0 Answers
MOBILES WITH MOVIETEXTURE CAN'T BUILD 0 Answers