Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by phineliner · Nov 10, 2015 at 08:46 PM · videoresources.loadvideo streamingstreamingassetsplayfullscreenmovie

How to use video files twice: Once as Resources and once as StreamingAssets

I have a couple .mp4 videos which play fine on Standalone when loading them from Resources Folder via Resources.Load<MovieTexture>("videoname"). They also play fine on Mobile when loading from StreamingAssets folder via Handheld.PlayFullScreenMovie("videoname.ext").

Mobile does not support MovieTexture and Standalone does not support Handheld. So in Order for this to work on Standalone and Mobile, I would need to duplicate the video files which would result in having the same video files in both folders (Resources and StreamingAssets). This is redundant and I would like to avoid this.

Is there a simple solution for that? Can you somehow merge those folders or similar? Or maybe I can specify to ommit one or another folder when deploying for a certain platform?

I know you can not Resources.Load from StreamingAssets and you can not Handheld.PlayFullScreenMovie from Resources (one of both would solve this problem). I also know about loading videos from StreamingAssets via WWW class, but this only supports .ogvwhich in return is not supported by mobile.

Cheers, phineliner

P.S.: I know that there are Plugins like AVPro, but I'm a student and this is a university project, so I don't want to spend 200 bucks for a plugin ;)

edit:

In case I have the files duplicated (distributed to the two folders), I can not build for Mobile anymore: 'MovieTexture' is not supported when building for Android.. It's giving me this error because I have the imported video file inside of the Resources folder. Can I somehow tell to ignore the videos of the resources folder while deploying for mobile? They aren't used in that case either... In code I can use #if UNITY_ANDROID to hide code containing MovieTexture, but how can I do this in the editor itself? I can avoid this by using WWWand load an .ogv video from StreamingAssets, but this would also mean that I need two files for the same video (one .mp4 and one .ogv).

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 mdespault · Feb 17, 2016 at 12:41 PM 0
Share

Did you ever have any luck with this? I'm wondering the exact same question at the moment. I have different video-player solutions depending on the platform, but I can't find a way to gracefully handle the fact that iOS for example needs the videos to be in S$$anonymous$$$$anonymous$$gAssets but for standalone/PC builds I want it in the Resources folder. As you said, having a video in the Resources folder cases the iOS build to not compile, and I don't see an easy way to "exclude" it (even though I never reference it, the compiler doesn't care).

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by mdespault · Feb 23, 2016 at 02:29 PM

I re-posted a similar question and ended up finding a solution that worked for me anyway:

http://answers.unity3d.com/answers/1146086/view.html

I think my answer is awaiting moderation, but hopefully will be up soon. In a nutshell, I ended up storing my videos in AssetBundles to bypass the iOS MovieTexture compile errors

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

VideoPlayer streaming and buffering 0 Answers

Is it possible to access a file from the android Internal storage on to a Unity app during run time? 0 Answers

Integrating Intel-Media SDK with Unity 0 Answers

StreamingAssets Folder Max Size 2 Answers

How to integrate a video with alpha channel (rgb+alpha) in the new 5.6 videoplayer? 5 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