Reference VideoPlayer Component Script Question

Hey,

Not great at scripting but I’m learning, wondering if someone can help me…

I have a game object called videoPlane that has a component VideoPlayer.

From a script on a separate button I want to get the video player on that plane/gameobject and make it pause.

I imagine something like this but cant seem to figure it out.
videoPlane.gameObject.GetComponent () .Pause

That will work. I was having trouble referencing the component, turns out I needed this at the top of the script:
using UnityEngine.Video;
Make sure you have that or else it won’t recognize the component.

2 Likes

Your asset is excellent and looks beautiful on an Oculus Rift S. This is probably a dumb question, but I’m a little confused by how to use Video Player to pause an SBS video I’m playing with VR3D Media Viewer. I put the video texture into both the “Default Image” of the VR3D Media Viewer and also into the “Video Clip” of the Video Player. When I try to do a Pause() of the video player in a script, it doesn’t work. Could you show a simple example of pausing a VR3D stereo video? Thanks so much!