PolySpatialVideoComponent.GetState() returns IsPlaying even after video ends

It’s a minor thing but it should change to IsStopped after the video reaches its end, right?

Hi,

Thanks for calling this out! PolySpatialVideoComponent currently doesn’t change the state as expected without an explicit call to Stop(), since right now it’s just a wrapper class that allows users to control the video player component on the backend (AVPlayer on RealityKit and Unity’s VideoPlayer on Unity), and there’s currently no video info passed from the backend to PolySpatialVideoComponent to update the state when the video finishes on the backend.

While we can add that callback, we are working on switching from PolySpatialVideoPlayer to the normal Unity VideoPlayer component, which should add additional functionality, like the ability to query for state changes, and allow the usage of callback events like loopPointReached.

1 Like

Beautiful, no trouble at all. I’ll work around it with a view to return to using Unity VideoPlayer later on. Thank you!

I noticed our videos get uniformly flipped on both the x/y but only in the VisionOS Simulator? How odd? I don’t know if this is just a quirk with AVPlayer?

That sounds like a problem with texture coordinates being inverted. Since we’re using AVPlayer to generate native RealityKit VideoMaterial and applying it to Unity-created entities, we needed to invert the texture coordinates to avoid videos rendering as flipped in RealityKit.

In this case, it seems likely that something in that process may have gone awry - if you can file a bug and attach a repro project, that would greatly help in figuring out what may be going wrong!

1 Like

Figured it out, we had two PolySpatialVideoComponents targeting the same mesh. One flipped it and the other flipped it back :man_facepalming:t2: at least thats our theory!

1 Like