• 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 Decidetto · Sep 07, 2016 at 06:42 PM · c#androidmobilevideovideo streaming

Handheld.PlayFullScreenMovie memory leak?

I'm developing a virtual classroom app for Android in Unity that allows children to walk through a 3D representation of their classroom with a touch-controlled FirstPersonController and watch instruction videos for subjects that they don't understand.

When they pick a video from one of the pop-up menus, it calls this piece of code. (Edited to a generic placeholder video for this.)

 public void PlayGoat()
     {
         Handheld.PlayFullScreenMovie("https://dl.dropboxusercontent.com/s/tm1fsh7rselv5vd/Taylor%20Swift%20-%20Trouble%20Goat%20Remix.mp4", Color.black, FullScreenMovieControlMode.Minimal);
     }

Really rather simple.

After any video plays (both when streamed from URL and loaded from StreamingAssets), the app starts to lag tremendously and eventually freezes after an x number of seconds. (It automatically closes the app after having been frozen for a few seconds.)

On the tablet type I'm developing this for, Samsung Galaxy Tab4 10.1, it freezes after about 40 seconds. On my phone, which has double the RAM, it takes considerably longer -- about 1:30 to 2 minutes -- to freeze. This makes me suspect there is a memory leak in the Handheld.PlayFullScreenMovie function that fills up the entire device's RAM before crashing it.

Does anyone have any experience with this, or any pointers on what to try?

I'd be fine with trying another way to play the videos, but it has to be capable of streaming from a URL.

My Unity version is 5.4.0f3.

Comment
Add comment · Show 2
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 Decidetto · Sep 08, 2016 at 02:23 AM 0
Share

I'm going to run a few more tests on this, checking the memory usage with a command every (few) update(s) tomorrow.

avatar image Lexangelus · Jan 04, 2017 at 02:58 PM 0
Share

Hello,

I work on the same version of Unity, with a high similar Device, and I have the same issue ! ^^ Do you find any solution for this problem ?

Thank you !

0 Replies

· Add your reply
  • Sort: 

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to display a video behind gui on mobile 2 Answers

Android MP4 Video Playback 2 Answers

onControllerHide() crash 0 Answers

Multiple Cars not working 1 Answer

AV Pro Video Playback Rewinding Issue -Android 0 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