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 /
This question was closed Jul 04, 2014 at 04:39 PM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by PommPoirAbricot · Jun 12, 2014 at 09:29 AM · androidmoviehandheldplayfullscreenmovie

[SOLVED] Does someone have a working script sample with Handheld.Playfullscreenmovie on Android ?

Hello Everybody!

I am working on project under Unity 4.2 pro.

I spent hours to find a solution but no way. I need your help :

I would like to play movies with Handheld.PlayfullScreenMovie(). Do you have a working project or a sample that i can try to export on android ?

  • I created "StreamingAssets" folder
    under "Assets" folder.

  • I put into it my movie "doseriche.mp4".

  • Then the path in Handheld.PlayFullScreenMovie should be "doseriche.mp4" under Android, am i wrong ?

  • In Player settings, i set "Write Access" to "External".

  • I tried different paths.

But it still doesn't work.

Here is my code :

 using UnityEngine;
 using System.Collections;
 
 public class test_handheld : MonoBehaviour
 {
     string fileName = "doseriche";
     string fileExtension = ".mp4";
 
     string filepath;
     string s = string.Empty;
 
     string url = "http://[...]/tests_devonly/";
 
     private Vector2 scrollPosition;
     bool done = false;
 
     void Play(string p)
     {
         //iPhoneUtils.PlayMovie(p, Color.white);
         s += p + ": " + Handheld.PlayFullScreenMovie(p, Color.white, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.Fill) + "\n";
     }
 
     void Start()
     {
         Handheld.PlayFullScreenMovie(fileName + fileExtension);
         StartCoroutine(BeginDownload());
     }
 
     void OnGUI()
     {
         GUILayout.Box(s);
 
         scrollPosition = GUILayout.BeginScrollView(scrollPosition);
         {
             if (GUILayout.Button("file://" + fileName + fileExtension, GUILayout.Height(30)))
                 Play("file://" + fileName + fileExtension);
             if (GUILayout.Button(fileName + fileExtension, GUILayout.Height(30)))
                 Play(fileName + fileExtension);
 
             if (GUILayout.Button("file://" + fileName, GUILayout.Height(30)))
                 Play("file://" + fileName);
             if (GUILayout.Button(fileName, GUILayout.Height(30)))
                 Play(fileName);
 
             if (GUILayout.Button("jar:file://" + Application.dataPath + "!/assets/" + fileName + fileExtension, GUILayout.Height(30)))
                 Play("jar:file://" + Application.dataPath + "!/assets/" + fileName + fileExtension);
             if (GUILayout.Button("jar:file://" + Application.dataPath + "!/assets/" + fileName, GUILayout.Height(30)))
                 Play("jar:file://" + Application.dataPath + "!/assets/" + fileName);
 
             if (GUILayout.Button(Application.streamingAssetsPath + "/" + fileName + fileExtension, GUILayout.Height(30)))
                 Play(Application.streamingAssetsPath + "/" + fileName + fileExtension);
             if (GUILayout.Button(Application.streamingAssetsPath + "/" + fileName, GUILayout.Height(30)))
                 Play(Application.streamingAssetsPath + "/" + fileName);
         }
         GUILayout.EndScrollView();
 
         if (done)
         {
             if (GUILayout.Button(filepath, GUILayout.Height(30)))
                 Play(filepath);
             if (GUILayout.Button("file://" + filepath, GUILayout.Height(30)))
                 Play("file://" + filepath);
         }
     }
 
     #region comment download under Android
     IEnumerator BeginDownload()
     {
         string path = Application.persistentDataPath;
         filepath = path + "/" + fileName + fileExtension;
         WWW www = new WWW(url + fileName + fileExtension);
         yield return www;
         s += "DONE!" + "\n";
         done = true;
         System.IO.File.WriteAllBytes(filepath, www.bytes);
     }
     #endregion
 }
 

Do you have a working project i can try to export to android ?

Thanks a lot for any 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 Nsingh13 · May 05, 2015 at 04:32 AM 0
Share

I'm sorry this is unrelated but WOW 0_0, over 3000 views in 3 $$anonymous$$utes! Now that, sir, was a great question.

1 Reply

  • Sort: 
avatar image
4
Best Answer

Answer by PommPoirAbricot · Jun 13, 2014 at 02:25 PM

Solved Playfullscreenmovie is a Android Pro feature ! This is not indicated in documentation

 using UnityEngine;
 using System.Collections;
 
 public class playmovie : MonoBehaviour {
     private string movPath = "doseriche.mp4";
 
     // Use this for initialization
     void Start () {
         StartCoroutine(PlayStreamingVideo(movPath));
     }
 
     private IEnumerator PlayStreamingVideo(string url)
     {
         Handheld.PlayFullScreenMovie(url, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFill);
         yield return new WaitForEndOfFrame();
         yield return new WaitForEndOfFrame();
         Debug.Log("Video playback completed.");
     }
 }


[1]: https://store.unity3d.com/products/v24/feature_4_pro.en.html

Comment
Add comment · Show 3 · 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 PatrickAllen · Jul 04, 2014 at 04:31 PM 0
Share

So I just spent half a day trying to do the impossible?

Why would they not include this very important info in the docs?!

avatar image meat5000 ♦ · Jul 04, 2014 at 04:34 PM 0
Share

It's in there somewhere. Docs are improved continuously, I think it's tough for Unity $$anonymous$$m to spot everything :P

Good job finding the answer. If you need a short (SHORT!) clip, you could use @Eric5h5's awesome, simple and elegant Texture Swap Animator.

avatar image gamedge · May 05, 2015 at 04:25 AM 0
Share

this feature is available in Unity 5 Personal

Follow this Question

Answers Answers and Comments

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

Related Questions

Need help with Handeld.PlayFullScreenMovie for Android 1 Answer

PlayFullScreenMovie on Android shows black frames at start and end of video 2 Answers

Add some text overlay on when playing Handheld.playfullscreen 0 Answers

Android can't AutoOrientation when do Handheld.PlayFullScreenMovie 0 Answers

Android Handheld.PlayfullscreenMovie not working from Cloud Build 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