Skip to content

CVR Video Player

A networked video player with playlists, audio playback modes, and lifecycle events you can hook into.

Enables network sync of the video player. Syncs the current video URL and time to others so they can watch together.

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.

Enables the default video player UI. UI Position/Parent must be set for this to work.

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.

How fast the video plays back.

RenderTexture used to display the video output. Using the render texture generated by the Create Sample Render Texture button is recommended.

Current playback volume. Used to change the volume at runtime or to set a start/default volume.

Audio output mode. Heavily changes the way audio is output.

Options:

Outputs audio in a direct way using 2D audio sources. No special setup required.

Uses the provided Custom Audio Source to determine settings such as falloff range (min, max) and more.

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.

Reference audio source used by the Audio Source Playback Mode.

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.

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.

Hook into player lifecycle events.

Fires when playback starts.

Fires when a video finishes playing.

Fires when the video is paused.

Fires when a new video URL is set.

Fires when a new video URL is set.

Fires when the active subtitle line changes.

All supported media formats and codecs are listed here: Renderheads AVPro Supported Media.

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.

MemberDescription
ControlPermissionGet/set which players may control the video. Propagates changes to the player UIs.
IsPlayingBool, true while the player is actively playing.
PlayerStateCurrent PlayerState enum.
TimeCurrent playback position in seconds.
CurrentVideoUrlLast network-synced URL, or null.
CurrentPlaylistCurrently selected playlist object.
CurrentPlaylistVideoCurrently 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.

  • CVR-GameFiles/ABI.CCK.Components/CVRVideoPlayer.cs