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 Sir-Gatlin · Jul 03, 2017 at 06:01 PM · playervrvideovideo streaming

IS Videoplayer.preparecompleted pointless?

So I assumed Videoplayer.preparecompleted would trigger when the video is prepared. I assumed that meant the video was fully loaded and ready to play front to back with not needing to download anymore. but when using it, it looks like it means all prep was made to get the video player ready to play and can start playing it, but no promises to how much of the video is loaded. If I call video.prepare and wait to play on preparecompleted it video does not play, it shows the first frame and freezes. It works better to just use .play, but then after a few seconds it stops due to needing to load.

All i want is a way to track load progress. I want to be able to know how much of my video from url is loaded, so i know when it is safe to start playing the video with no interruptions.

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
0

Answer by Virat-Gangurde · Jul 04, 2020 at 10:52 AM

Hi!

The usual way to play a movie from the web, with Unity, is to point the VideoPlayer to the movie using the VideoPlayer.url property and calling Play(). But this, as you are pointing out, does not report buffering progress and is indeed a missing feature in the VideoPlayer that we may address eventually.

Here are two options; none of them is perfect but maybe adequate for your use case: Instead of calling VideoPlayer.Play() immediately, you can add a handler on the VideoPlayer.prepareCompleted event and then call VideoPlayer.Prepare(). This does not expose progress, but at least you can have a spinning cursor in the mean time and have it disappear as soon as buffering is considered sufficient to start playback. If it's acceptable for you to not start the playback until the movie is fully downloaded, then you can just use UnityWebRequest.Get directly to download the file locally. This will get you the same progress reporting that you're using for textures. Once downloaded, you can have your VideoPlayer use the local file by setting the VideoPlayer.url property to the filesystem path of the downloaded file. Hope this helps,

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

95 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 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

Can handheld.PlayfullScreenMovie() work with Vr view to play 360 degree video using google vr sdk? 0 Answers

play back 360 video STEREO on GearVR 1 Answer

pre-prepare video in scene before its needed 0 Answers

Trouble getting Google GVRVideoPlayer to Implement in Unity 5.6.2 with Google Cardboard v1.60 0 Answers

How to play video on WEBGL 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