VRC_SyncVideoStream
Deprecated
This component is deprecated. It is not available in the latest VRChat SDK, and is either non-functional, or will no longer receive updates. It may be removed at a later date.
Note: VRChat SDK3 contains a prefab called "UdonSyncPlayer (AVPro)" that performs far better and is up to date!
In addition, you can write your own sync methods, permitting for complex, durable behavior when syncing videos between users. Check out Udon Video Sync Player for more info.
Quick Setup
Check out the Starter Guide for a quick setup.
VRChat on Oculus Quest Incompatibility
This component does not work on VRChat on Oculus Quest. If you place this component in a cross-platform world, it will cause errors while it attempts to sync to the PC users in the room and cause the world to misbehave. Remove it from the Quest version.
Similar to VRC_SyncVideoPlayer, this component provides the control center and playlist options for your video. Each entry now has a SyncType which supports the following modes:
- Normal - this is a normal playback video whose timecode is synced among viewers.
- LiveStream - this is a live streaming source, the timecode is irrelevant, it is showing the current live stream, so is reasonably synced among viewers.
- Karaoke - this is similar to Normal mode, except the sync is ignored after the first play start. This allows remote clients to "desync" with fastforward and rewind to adjust for singer latency. Owner Stop, Play, FF, REW will still affect everyone.
In addition, each stream has a SyncMinutes option. This indicates the period in minutes that the player will attempt to resynchronize its audio and video to compensate for drift. It currently does a simple stop, pause, play to accomplish this. Setting the value to 0 disables this feature.
Supported RPCs
- Play, PlayIndex, Stop, Pause, Next, Previous, Shuffle, Clear, AddURL are the same as VRC_SyncVideoPlayer.
- FastForwardSeconds / RewindSeconds - a float value indicates how much time to skip forward/backward
- Resync attempts to fix audio desync by pausing then starting video. It should be called locally.
- SetSyncType changes the current video's sync type, this is only useful for server-based redirected videos as the type is normally indicated in the play list entry. This should always be sent to Owner and this setting will update automatically on remotes.
- SetSyncMinutes changes the update rate of "auto-resync". Set it to zero to disable. This should always be sent to Owner and this setting will update automatically on remotes.
Supporting Components
Starter Guide
This is a simple guide meant to help get a working stream player into a world. There are a lot of options that you can change that are not mentioned in this guide, this is just a starting point.
- Create an empty game object, we'll call it StreamParent. Add the VRC_SyncVideoStream component to it.
- Configure the VRC_SyncVideoStream component. In this example we'll be playing a YouTube stream.
- Video Search Root: youtube.com
- Auto Start: Your preference, but for this example it will be on
In the "Videos" section, only use one "Url" entry. - URL: Paste the URL of the stream you want to watch
- Playback Speed: 1
- Sync Type: Live Stream
- Sync Minutes: 0
- Create a new plane and make it a child of StreamParent. You'll probably want the size of the plane to be in 16:9 ratio. (The easiest way to do this to size the plane as 16m x 9m, then use the Unity scale handles to proportionally scale it down) We'll be naming this object StreamScreen. Position this mesh where you'd like to have it in your world, and add the VRC_VideoScreen component to it.
- Configure the VRC_VideoScreen component. In this example, all we have to do is change the target of "Video Stream" to our StreamParent object.
- Make a new material, and apply it to the mesh we just created. Set the shader of that material to Video/EmissiveGamma. In the shader settings, check the "Apply Gamma" box.
- Create a new empty game object and position it where you'd like the stream audio to come from. We'll name it StreamSpeaker and make it a child of the StreamParent object. Add the VRC_VideoSpeaker component to it.
- Configure StreamSpeaker. An AudioSource component will appear in the object, there are lots of settings here but I'd just recommend changing Doppler Level to 0. For the VRC_VideoSpeaker settings, set the target of "Video Stream" to StreamParent and make sure Channel Type is set to StereoMix.
After that's all done, either test or publish a new build of your world and load into it. The stream you specified in the StreamParent object will begin playing, both video and audio.
Credit to Noe#5687 for assisting with the guide test process.
Updated about 1 year ago