• 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
0
Question by VIPINSIRWANI · Aug 14, 2013 at 10:37 AM · videohandheld

Video is not playing on Android

Hello Everyone, I am playing one video on game start on IOS i-phone/ i-pad it is working but on android devce it is not working

    IEnumerator playVideo () {
         Handheld.PlayFullScreenMovie("Final.mp4", Color.black,
             FullScreenMovieControlMode.Hidden, 
             FullScreenMovieScalingMode.AspectFit);
         yield return null;
         camMenu.gameObject.SetActive(true);
         if (GetComponent<AudioListener>())
             GetComponent<AudioListener>().audio.volume = 0;
         playedVideo = true;
     }
Comment
Add comment · Show 4
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 Graham-Dunnett ♦♦ · Aug 14, 2013 at 10:54 AM 0
Share

I formatted your code for you. Please learn how to do this for yourself.

avatar image Graham-Dunnett ♦♦ · Aug 14, 2013 at 10:55 AM 0
Share

What does 'not working' mean?

avatar image VIPINSIRWANI · Aug 14, 2013 at 11:40 AM 0
Share

I PLaced the video in Strea$$anonymous$$g Assets and it is working fine for I-phone or I-pad but when i switch Platform as Android on that time my video is not playing on game startup once see my code hole Script` public class VideoClip : $$anonymous$$onoBehaviour { // public $$anonymous$$ovieTexture movi bool playedVideo = false; float alphaFadeValue; public Texture2D blackTexture; public Transform cam$$anonymous$$enu;

 public $$anonymous$$aterial table$$anonymous$$at, paddlePlayerOne, paddlePlayerTwo, puck;
 
 public Texture[] tables;
 public Texture[] paddles;
 public Texture[] pucks;
 void Start () {
    alphaFadeValue = 0.3f;
     Screen.orientation = ScreenOrientation.Portrait;
     int video = PlayerPrefs.GetInt("video");
     if (video == 0) {
         cam$$anonymous$$enu.gameObject.SetActive(false);
         StartCoroutine(playVideo());
     } else {
         cam$$anonymous$$enu.gameObject.SetActive(true);
         enabled = false;
     }
     ChangeTexturesForSinglePlayer();
     PlayerPrefs.SetInt("video", 0);

 }
 
 IEnumerator playVideo () {
     Handheld.PlayFullScreen$$anonymous$$ovie("Final.mp4", Color.black,
         FullScreen$$anonymous$$ovieControl$$anonymous$$ode.Hidden, 
         FullScreen$$anonymous$$ovieScaling$$anonymous$$ode.AspectFit);
     yield return null;
     cam$$anonymous$$enu.gameObject.SetActive(true);
     if (GetComponent<AudioListener>())
         GetComponent<AudioListener>().audio.volume = 0;
     playedVideo = true;
 }
 
 void OnGUI () {
     if (playedVideo) {
         Debug.Log("played");
         alphaFadeValue -= $$anonymous$$athf.Clamp01(Time.deltaTime / 5);
         GUI.color = new Color(0, 0, 0, alphaFadeValue);
         GUI.DrawTexture( new Rect(0, 0, Screen.width, Screen.height ), blackTexture );
     } else {
         Debug.Log("Playing");
     }
     
     if (alphaFadeValue < 0f) {
         enabled = false;
     }
 }
 
 void ChangeTexturesForSinglePlayer () {
     int tableIndex = 0, paddleIndex = 0, puckIndex = 0;
     puckIndex = PlayerPrefs.GetInt("puck");
     puck.mainTexture = pucks[puckIndex];        
     tableIndex = PlayerPrefs.GetInt("table");
     table$$anonymous$$at.mainTexture = tables[tableIndex];
     
     paddleIndex = PlayerPrefs.GetInt("paddles");
     paddleIndex = 2;
     paddlePlayerOne.mainTexture = paddles[paddleIndex];
 }
 

} `

avatar image meat5000 ♦ VIPINSIRWANI · Aug 16, 2013 at 12:19 PM 0
Share

Do you have Unity Pro? I think $$anonymous$$ovieTextures is a Pro only feature

Also check that your mp4 codec is supported by Android

http://developer.android.com/guide/appendix/media-formats.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by meat5000 · Aug 14, 2013 at 10:59 AM

I believe the video should be placed in the Streaming Assets folder.

Check this :

http://docs.unity3d.com/Documentation/Manual/StreamingAssets.html

and this :

http://answers.unity3d.com/questions/154961/android-video-playback.html

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

17 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 avatar image avatar image

Related Questions

Handheld.PlayFullScreenMovie only plays sound, but no video 1 Answer

Remove controls bar of playing video on Android / IOS 1 Answer

Video playback in Android doesn't change orientation 0 Answers

FullScreenMovieScalingMode.AspectFit not working on iOS and Android 0 Answers

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


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