Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by quantum_rez · Jan 10, 2013 at 08:41 AM · androidtexturevideomovie

why cannot build movie texture on android?

hi all, i want to play video in unity, and i found that using movie texture, and i can use it on standalone, but when i want to build on android device, i get some error just like here :

  • The type or namespace name `MovieTexture' could not be found. Are you missing a using directive or an assembly reference?

  • Error building Player because scripts had compiler errors

this is my code:

 using UnityEngine;
 using System.Collections;
 
 [RequireComponent(typeof(AudioSource))]
 [RequireComponent(typeof(AudioListener))]
 
 public class Movie : MonoBehaviour {
     
     public MovieTexture movie;
     
     private float movieTimer;
     
     void OnGUI(){
         GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), movie);
         movie.Play();
         
         if(movie.duration < movieTimer){
             movie.Stop();
             print("Movie Finish");
         }
     }
     
     // Use this for initialization
     void Start () {
     
     }
     
     // Update is called once per frame
     void Update () {
         movieTimer += Time.deltaTime;
     }
 }

anything wrong? or i have miss something so i can't build movie texture on android?

please help me..

Thanks

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
8
Best Answer

Answer by Arrod55 · Aug 01, 2013 at 01:18 AM

I realize this is a bit old, but it still came up in my search results when trying to solve a similar problem.

There are two parts to this solution...

First, any code using "MovieTexture" MUST be set only for PC builds. The game I am working on is for Android and PC, so I use the following preprocessor commands:

 #if UNITY_ANDROID
     Handheld.PlayFullScreenMovie("");
 #else
     MovieTexture stuff;
 #endif

The second part is that you cannot have any movies applied as textures in your scenes. Even if you are not using them, they cannot be set as a texture.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ragnaros100 · Feb 08, 2016 at 04:59 PM 0
Share

Hey man. I know this is very old, but how did you play videos on Android using the PlayFullScreen$$anonymous$$ovie method? The package is jar compressed, so you can't just pass a string to it...

avatar image
0

Answer by Bunny83 · Jan 10, 2013 at 09:29 AM

Because it's not supported on iOS or Android as you can read in the docs

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image quantum_rez · Jan 10, 2013 at 10:04 AM 0
Share

oh nooo, so how can i play video on android with unity? any other way?

sorry i want to ask why in this thread $$anonymous$$ovieTexture can work on android? with some code and i don't understand about the code.

Thanks

avatar image quantum_rez · Jan 10, 2013 at 12:29 PM 0
Share

this thread sorry sorry

http://forum.unity3d.com/threads/73338-$$anonymous$$ovieTexture-has-no-definition-for-iPhone-Android

avatar image
0

Answer by Xorxor · Dec 15, 2015 at 09:52 PM

It's an annoyance that any code including MovieTexture won't compile for Android etc. This means that you need to preprocess your code, including any public fields to exclude the code from the compiler. This seems fine since MovieTexture fields will get serialized as development happens in the Editor, but if there were classes that didn't exist on the desktop, but needed to get serialized for Android etc. then this wouldn't work. Smells bad to me.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Incept_test · Apr 24, 2016 at 03:09 PM

Check this : https://www.assetstore.unity3d.com/en/#!/content/32877

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cambesa · Aug 22, 2016 at 05:01 AM 0
Share

I tried to make this plugin demo(10 seconds video max) work on android but keep getting the error that I can not build using $$anonymous$$ovieTextures on Android, I removed all references to movie textures in my coding so I think there's a reference to $$anonymous$$ovieTexture in the source code of SPlugin which withheld unity from building at all(both asset bundles and build for Android). It works fine on pc though but our main target is Android.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to play video on android 4 Answers

Video Texture Loop 2 Answers

Problem on Playing the video in Android within a Texture 0 Answers

How to check if Handheld.PlayFullScreenMovie has stopped playing 2 Answers

How to import a movie texture and apply it without stretching? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges