Udon Video Decoder is a library for loading videos generated by Pixel Proxy, allowing you to load arbitrary API calls into VRChat.
See VideoDecodeExample.cs for a complete usage example.
Some demos are available in the Udon Video Decode Demo VRChat world.
- VRCSDK3
- UdonSharp
- Optionally UdonDecodeLib and UdonXML for decoding the received data.
- Create an empty GameObject in your scene and attach the
VideoDecoder.cs
script to it. - Pick a Render Texture and Blank Texture in the Video Decoder settings. Some preset ones are provided with this package. If you make your own, make sure that:
- These textures match in size.
- The blank texture has Read/write enable.
- The Blank Texture has Compression disabled.
- In your own program, define a variable like
public VideoDecoder videoDecoder
. - Assign the Video Decoder GameObject to this variable.
- You can now call
videoDecoder.LoadURL
to load your data.
LoadURL
LoadURL(VRCUrl url, UdonSharpBehaviour callbackBehaviour, string callbackField, string callbackMethod, string callbackErrorField, string callbackErrorMethod)
Loads the specified URL asynchronously.
callbackBehaviour
: The UdonSharpBehaviour that the following callbacks reside in.callbackField
: Name of field to put the returned data on. Type of this field should bebyte[]
.callbackMethod
: Name of method to call on success.callbackErrorField
Name of field to put load error code in. Type of this field should beVRC.SDK3.Components.Video.VideoError
.callbackErrorMethod
: Method to call on failure.
Any of the callback*
parameters can be set to null
if you don't need them.
CancelLoad
CancelLoad()
Stops the internal video player, cancelling any currently loading data.