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 JulienGn · Nov 16, 2017 at 04:12 PM · videoloaddynamic

Dynamicaly load a video on a GameObject

Hello,

I searched for a good while but all my attempts resulted in failures until now. I need to write a script able to load and display on a GameObject a video from its very link. My point is to make sure by only writing down the disk link of the video on a text file, the referenced video will be loaded from a script.

My expectations went short when I couldn't seem to manage to find proper "Resource.Load" like I did for loading textures from their link.

Anybody can land me a hand here ?

Thank you.

Edit: Idealy, I'd like to load a videoclip from its link.

Comment
Add comment
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

1 Reply

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

Answer by Legend_Bacon · Nov 16, 2017 at 05:47 PM

Hello there,

If you have a (relatively) recent version of Unity, you might want to try their Video Player. It's pretty simple, and seems to work great. I use it to have a video rendered on a plane.

In terms of code, you can play the video like this:

     public void PlayVideo(string videoName)
     {
         VideoClip clip = Resources.Load<VideoClip>(videoName) as VideoClip;
         vp_VideoPlayerRef.clip = clip;
         vp_VideoPlayerRef.Play();
     }
 

There are heavy restrictions on which formats it supports though, so I'd recommend reading the above link in details. But if you follow all their rules, you can just load a video from Resources and play it.

Hope that helps!

~LegendBacon

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 JulienGn · Nov 17, 2017 at 01:17 PM 0
Share

Hi, sorry for the late reply but I couldn't afford to spend too much time on the matter anymore yesterday. The problem was actualy a corruption of my video in the first place, so a simple Resources.Load() of VideoClip was enough, since I have a custom videoplayer for taking charge of VideoClip elements.

Thank you for the tip, though, this will definitively help on my future work.

Have an excellent day.

avatar image ben06feb · Jan 20, 2018 at 11:18 AM 0
Share

Hi, I need to get video clip which is placed under Resources/subfolder, these subfolder names and videos will be dynamic, user will place those. In Editor its working fine with Resources. Load property, while we taking build - if we take build with Resources folder with all contents, it will reflect. But the changes in folder and files will not get reflected. Is there any other way to retrieve video clips.

avatar image Legend_Bacon ben06feb · Jan 22, 2018 at 09:12 AM 0
Share

Hello there,


While this should probably be a separate question of its own, I'll answer it here. You mention that you want you folder system to be dynamic, but you also say you use Resources for this. Just to clarify, the Resources folder is NOT dynamic. You can put stuff in there that you want/need your project to load with, but you can't add folders or files to it at runtime. (Not in a build, at least).

Ins$$anonymous$$d, you should probably just use Application.persistentDataPath to achieve this kind of behavior.

I hope that helps!

Cheers,

~LegendBacon

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

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

Related Questions

Resources.Load dynamic path 2 Answers

Video Player preparing too long Android 0 Answers

Display dynamic video content on the fly 0 Answers

Dynamically load AudioClip during runtime 1 Answer

non-dynamic asset load? 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