Syncing Video Time Over Server?

I am stuck on trying to sync the time of the video for players who join the room after the video has already played. I have an RPC that plays the video, and sets the time to the current video time in a variable set locally. The RPC is set to all buffered. However, the video always starts from the beginning. I tested that I was setting the time correctly by setting it locally every three seconds to the current time, and it works. Any ideas on how to successfully sync the time of the video in Unity using PUN2 and the Video Player?

Comments

  • You could relate the start time of a video to the server's timestamp of a room.
    In a room, you can store the server timestamp in a property and everyone who's there can compare it to the current timestamp and adjust video playback accordingly.
  • Thanks for the answer. I've tried multiple things and still cannot get it to sync properly. I have it working, but only when a second user actually plays the video, the syncing is not being buffered even though it has an RPC with AllBuffered as the RPCTarget. Do you have any code samples that I could look at to solve this? Thanks a lot. I'm surprised there aren't more questions about this online.
  • I'm just not sure how to relate the PhotonNetwork.ServerTimestamp to the time of the video. If you could explain a little more how this would be done, I would greatly appreciate it.