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 /
  • Help Room /
avatar image
1
Question by niraj_dat · Apr 06, 2017 at 07:38 AM · video

Playing Multiple Videos with New Video class

Hello Devs,

As we know with Unity 5.6 there is a Video class to handle video playback in cross platform. We decided to test this new component. We want to play 3 videos in a row and without any break in the middle when changing video. But everytime one video is completing it takes some time to load another.

It's obvious that it's taking little time load and prepare the video before playback. Is there any workaround with this new video class to pre-load the next video that we want to play without any delay to make the continuous feeling.

Here is the code currently we are testing with:

============================================

public VideoClip[] _videoClip; // Holds all the video clips in array

public VideoPlayer videoPlayer ; // This is responsible for playing the clip

public virtual void PlayVideo () {

     if (count < _videoClip.Length) 
     {
         videoPlayer.Play ();
         isVideoStarted = true;
     } 
     else 
     {
         count = 0;
         isVideoStarted = false;
         Debug.Log ("Video ended");
     }

}

==============================================

What we are doing - every time a video is completing we are assigning new video clip to the player. Any idea or suggestion will be helpful.

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by pjdVR · Mar 15, 2018 at 11:02 PM

Hi

The way I solved this was creating two identical game objects, each with a video player and while one is playing one clip the other starts preparing the next. Then at the end of the first clip disable the first game object, enable the second one and start playing.

Using a script to switch back and forth between two video players the break is almost imperceptible.

Hope that helps.

Comment
Add comment · Show 1 · 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 teckniquex · Apr 12, 2018 at 05:11 PM 0
Share

could you share the code? @pjdVR

avatar image
0

Answer by niraj_dat · Apr 06, 2017 at 09:40 AM

Any Idea?

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

Answer by samubence · Apr 10, 2017 at 12:39 PM

Hi @niraj_dat, I have the same problem. I've tried various solutions without success:

Added multiple VideoPlayer component to an object (with different clips) and Prepare() all. It seems a good solution, but when the first video starts to play, all the other players become unprepared. (the video player API is not documented, so from outside it seems like a bug)

What I had to do at the end is to create a large video and seek to different positions. With the I can create loops and jump out of them.... obviously this not a solution, but it worked in my case.

Any suggestion appreciated.

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

Answer by Z_Lokke · Jul 14, 2017 at 08:58 PM

Hey Folks,

Same issue here. I'm trying to make "choose your path" type experience but I seem to be running into load time issues, and lag in the footage even once its loaded. I'm event running into a weird issue where the footage will jump to the first shot and then just not display the footage even though the frames are incrementing in the background.

Did either of you have any luck with this? Or learn anything new about the VideoPlayer?

@niraj_dat @samubence

Comment
Add comment · Show 1 · 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 teckniquex · Apr 12, 2018 at 05:12 PM 0
Share

@Z_Lokke I am working on a choose your path as well. How did yours come along? $$anonymous$$aybe we can share

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

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

Related Questions

MovieTexture.duration returning consistently incorrect duration 1 Answer

Making VR-screenshot on Android 0 Answers

get the frame number of a video 0 Answers

Easy Movie Texture.... Where to Begin? 1 Answer

How to get AR sound and video to play only when the target image is detected 2 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