CVR Video Player
A networked video player with playlists, audio playback modes, and lifecycle events you can hook into.
General
Section titled “General”Network Sync
Section titled “Network Sync”Enables network sync of the video player. Syncs the current video URL and time to others so they can watch together.
Play On Awake
Section titled “Play On Awake”Plays the Play On Awake Object on start if no other video is playing. If no Play On Awake Object is set, the first video of the first playlist is used instead.
Use Interactive Library UI
Section titled “Use Interactive Library UI”Enables the default video player UI. UI Position/Parent must be set for this to work.
UI Position/Parent
Section titled “UI Position/Parent”Parent transform of the video player UI. Moving this transform also moves the UI, since the UI is a child of it. Must be set for the UI to work. An empty GameObject is fine.
Playback Speed
Section titled “Playback Speed”How fast the video plays back.
Projection Texture
Section titled “Projection Texture”RenderTexture used to display the video output. Using the render texture generated by the Create Sample Render Texture button is recommended.
Playback Volume
Section titled “Playback Volume”Current playback volume. Used to change the volume at runtime or to set a start/default volume.
Audio Playback Mode
Section titled “Audio Playback Mode”Audio output mode. Heavily changes the way audio is output.
Options:
Direct
Section titled “Direct”Outputs audio in a direct way using 2D audio sources. No special setup required.
Audio Source
Section titled “Audio Source”Uses the provided Custom Audio Source to determine settings such as falloff range (min, max) and more.
Room Scale
Section titled “Room Scale”The Room Scale mode should only be used when playing 5.1 or 7.1 audio. Specific speaker and audio-source setups are required for good results. Stereo audio degrades in Room Scale.
Custom Audio Source
Section titled “Custom Audio Source”Reference audio source used by the Audio Source Playback Mode.
Room Scale Audio Sources
Section titled “Room Scale Audio Sources”List of speaker audio sources used by the Room Scale mode. You can define as many as you want, but each must be assigned a role/type.
Playlists
Section titled “Playlists”Play On Awake Object
Section titled “Play On Awake Object”Set by clicking Set as Play On Awake Object on a specific video. Used to play this video on start if no other video is playing and Play On Awake is enabled. Remove via the Remove Play On Awake Object button.
Events
Section titled “Events”Hook into player lifecycle events.
Started Playback
Section titled “Started Playback”Fires when playback starts.
Finished Playback
Section titled “Finished Playback”Fires when a video finishes playing.
Paused Playback
Section titled “Paused Playback”Fires when the video is paused.
Set Url
Section titled “Set Url”Fires when a new video URL is set.
Set Url
Section titled “Set Url”Fires when a new video URL is set.
Subtitle Change
Section titled “Subtitle Change”Fires when the active subtitle line changes.
Supported Media
Section titled “Supported Media”All supported media formats and codecs are listed here: Renderheads AVPro Supported Media.
Scripting API
Section titled “Scripting API”A subset of the player is exposed to Lua under CVR.CCK with object context WORLD. All getters return null if the underlying player hasn’t been initialized yet.
| Member | Description |
|---|---|
ControlPermission | Get/set which players may control the video. Propagates changes to the player UIs. |
IsPlaying | Bool, true while the player is actively playing. |
PlayerState | Current PlayerState enum. |
Time | Current playback position in seconds. |
CurrentVideoUrl | Last network-synced URL, or null. |
CurrentPlaylist | Currently selected playlist object. |
CurrentPlaylistVideo | Currently selected playlist entry. |
Play() / Pause() | Start or pause playback. Broadcast to the room when sync is enabled. |
Previous() / Next() | Navigate within the currently selected playlist. |
SetUrl(string) | Set a video URL. |
SetBuiltinWhitelistUrl(string) | Set a URL, but throws if the URL isn’t on the built-in whitelist. |
SetVideo(playlist, video) | Select a specific entry in a playlist. |
SetTime(double) | Seek. |
SetControlPermission(permission) | Change the ControlPermission. |
Networking is routed through DarkRift: play/pause (10501/10502), timestamp broadcast (10503), URL change (10504), seek (10505), and permission change (10550). Network sync is gated on syncEnabled and a connected GameNetwork.
Rate limits apply: SetVideoUrl is limited to 10 calls per 20 seconds per client via RateLimiter when the call originates locally.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRVideoPlayer.cs