- Home /
Can I use a single Video Player object to play multiple video clips
Hi.
I have a project with multiple buttons to play multiple videos (each button plays a specific video).
I have tried to set up the functionality with the Button's On Click () dialog. I placed the video player into the object field then selected VideoPlayer.clip from the drop down and dropped the clip into the Clip field.
When I click the button, the clip populates in the clip field in the Video Player Inspector, but it does not play (or at least not in view).
The Video Player is set to play in the Near Plane.
Am I missing something? Do I need to actually create a script instead?
Thanks
Answer by Warianos92 · Feb 19, 2021 at 09:28 AM
Hi there!
Yes it is possible. it depends on wha tyou want to do, but lets say you want to put the video on a rawImage Let´s say you have 3 videos, each of them have an URL to get the video.
1st you have to add a Render Texture to a raw Image and then add the same Render texture to the video players;
2nd you Video1.Prepare() and do it for everyone else;
3rd you Video1.Play() the video that you want according to the button click and pause it when you want.
Here is a video that helped me: https://www.youtube.com/watch?v=9LwOmMzOrp4
Best Regards man