[Udon] Video playback speed/rate
Synergiance
Since video players can have their playback speed/rate changed in SDK 2, why not allow this in Udon?
Also of note, video players in Unity need to have canSetPlaybackSpeed enabled in order to change speed:
For AVPro:
Log In
techanon
Necroing because it's still needed!
We need a canonical API for manipulating the playback speed.
Currently in order to manipulate the playback speed of the video player engines, we have to utilize an Animator to change the fields.
This may work for UnityVideo, but it fails for AVPro due to the available field only being data and the actual setter being inaccessible from Udon (player component not being whitelisted), UI Events (due to the player component being runtime-added) AND Animations (AVPro has a setter with side effect that causes the update, animation can only updates the serialized field which doesn't trigger the side-effect required).
Plus, having a canonical API would simplify the udon logic greatly.
UnityVideo has the
VideoPlayer.playbackSpeed
field.AVPro has the
MediaPlayer.PlaybackSpeed
property getter/setter.The API implementation could be a simple property that looks like image attached.
Yodokoro
I noted here a VRC Unity VideoPlayer attaches the Video Player component at runtime and tried to see if I could manipulate Playback Speed using Animator instead of Udon and it worked.
Needed Animator.Rebind() before change value.
This solution is still hacky so I need this feature as official yet.
And I did'n tried for streaming and AVPro. Someone please try it if you interested.
Synergiance
Yodokoro: This is an undesirable workaround, as I wouldn't be surprised if vrchat began scanning animators and removing references to video players there.