• 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
2
Question by artie · Jan 24, 2013 at 10:50 AM · androidmovietexturemovie

Big problem with mobile movies

I'm trying to use Handheld.PlayFullScreenMovie on Android. I'm following the instructions. Got code here: http://answers.unity3d.com/questions/218362/bundle-up-a-movie-file-for-handheld.html

But Unity won't BUILD the Android project, giving me this:

 'MovieTexture' is not supported when building for Android.
 Asset: 'Assets/Resources/SSSuccess.mp4'
 UnityEditor.HostView:OnGUI()

I tried putting it in StreamingAssets and got the same problem. Note this is at BUILD time, not compile time. I'm not trying to code a MovieTexture. I just have it lying around.

NEED HELP!

Comment
Add comment · Show 1
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 jorjdboss · Jan 24, 2013 at 11:07 AM 1
Share

Comment out all the code that that uses movie texture. If you can't find the code, remove the movie texture from the unity project folder, you may get a null exception in your code, go to this location and comment out the code that's trying to use the .mp4 file.

If you have the basic version of unity, you cannot load movies except through native plugins.

5 Replies

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

Answer by artie · Jan 24, 2013 at 11:03 AM

Found it, but leaving this here in case anyone else runs into this: I had assigned the movie to a texture (for web/pc builds). So I had to set that texture to 'none'.

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 sysG · Apr 16, 2015 at 07:31 PM

I just removed movie files from Resources folder and its all ok) Also i made a dummy of MovieTexture class

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 whaison · Aug 14, 2015 at 05:27 AM

save filetype .bytes

and

string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d"; IEnumerator Start () { // Start a download of the given URL WWW www = WWW.LoadFromCacheOrDownload (url, 1);

 // Wait for download to complete
 yield return www;

 // Load and retrieve the AssetBundle
 AssetBundle bundle = www.assetBundle;

 // Load the TextAsset object
 TextAsset txt = bundle.Load("myBinaryAsText", typeof(TextAsset)) as TextAsset;

 // Retrieve the binary data as an array of bytes
 byte[] bytes = txt.bytes;

}

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
1

Answer by Xorxor · Dec 19, 2015 at 08:37 AM

In order to support both Windows and Android I had to do the following:

1 Use Platform Dependent Compilation to remove references to MovieTexture

 #if UNITY_ANDROID && !UNITY_EDITOR
     // Android Code
     public string movieString;
 #else
     // Windows Code
     public MovieTexture movieTexture;
 #endif

Or

 #if UNITY_STANDALONE || UNITY_EDITOR
     // Windows Code
     public MovieTexture movieTexture;
 #endif

2 Make sure that there are no references to any MovieTextures in any fields including Materials.

3 I need to load my MovieTextures dynamically at runtime on Windows so I keep them in the Assets/Resources folder. This is an issue for Android builds because the contents of Resources gets copied to whatever build even if the build can't support the contents. In order to overcome this I use a build script to build my project which temporarily moves the Resources folder when building for Android.

 using UnityEngine;
 #if UNITY_EDITOR
 using UnityEditor;
 #endif
 using System.IO;
 using System.Collections;

 public class Build: MonoBehaviour
 {
 #if UNITY_EDITOR
     // Build Android
     // % (ctrl on Windows, cmd on OS X), # (shift), & (alt)
     [MenuItem("Build/Build Android %&#b")] 
     static void BuildAndroid() 
     {
         //_________________________________________
         // Pre Build 
         // Move Resources to a dummy folder
         // FIXME: Check if these folders exist
         string moveResourcesAway = AssetDatabase.MoveAsset("Assets/Resources", "Assets/StandaloneResources");
         Debug.Log(moveResourcesAway);

         //_________________________________________
         // Build
         string[] levels = null; // { "Assets/Scene1.unity", "Assets/Scene2.unity" };
         BuildOptions buildOptions = BuildOptions.AutoRunPlayer;
         BuildPipeline.BuildPlayer(levels, "Build/BuildAndroid.apk", BuildTarget.Android, buildOptions);

         //_________________________________________
         // Post Build
         // Move Resources back
         string moveResourcesBack = AssetDatabase.MoveAsset("Assets/StandaloneResources", "Assets/Resources");
         Debug.Log(moveResourcesBack);
     }
 #endif
 }



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 TGKG · Dec 22, 2015 at 09:06 AM 0
Share

Xorxor, I am trying to play a video using RawImage inside the Canvas. Works fine in the Editor however I am getting the following error when I try to "build & run" for Android. "error CS0246: The type or namespace name `$$anonymous$$ovieTexture' could not be found. Are you missing a using directive or an assembly reference?" In the inspector I have my movie as the Texture in RawImage and as well as the variable "movie" in the script Code is as follows: using UnityEngine; using System.Collections; using UnityEngine.UI;

 [RequireComponent (typeof(AudioSource))]
 
 public class VideoTEst : $$anonymous$$onoBehaviour {
     
     public $$anonymous$$ovieTexture movie;
     private AudioSource audio;
 
     void Awake()
     {
         audio = GetComponent<AudioSource>();
     }
     
     void Start () 
     {
              audio.clip = movie.audioClip;
 
         movie.loop = true;
         movie.Play();
         audio.Play();
     }
 }

Any thoughts on what I need to do?

avatar image TGKG TGKG · Dec 21, 2015 at 06:10 PM 0
Share

Just discovered that $$anonymous$$ovieTexture is NOT supported by Android. Back to the drawing board. http://docs.unity3d.com/$$anonymous$$anual/android-unsupported.html

avatar image
0

Answer by gdp2 · Jul 30, 2017 at 01:28 AM

Not sure if this is the same as other answers given here or not, but I managed to fix this error by altering the Importer Version setting on my file. I changed it from MovieTexture to VideoClip. I.e.:

alt text


tmp.png (19.2 kB)
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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

Movies on Android. Is it possible? 2 Answers

Is it possible to play a movie on Android OS? 3 Answers

WWW.movie doesn't work 1 Answer

www.movie on GUI Texture in front of Camera 0 Answers

I use Handheld.PlayFullScreenMovie to play movies on android,but,how to pause or end it? 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