Updating your Code to the latest VideoKit

VideoKit is currently in alpha, meaning that its C# API is very fluid and can change quite drastically between consecutive releases.

VideoKit being in alpha does not mean that its functionality is unstable. It just means that the C# API will change a lot.

Migrating to 0.0.15

Here are changes needed to upgrade your project to VideoKit 0.0.15:

Dropping the CameraFrame struct

The CameraFrame struct has been removed. The preview texture can now be accessed directly from the camera manager:

// Access the preview texture
Texture previewTexture = cameraManager.texture;
// Access the latest pixel buffer
NativeArray<byte> pixelBuffer = cameraManager.pixelBuffer;
// Access the human texture
Texture humanTexture = cameraManager.humanTexture;

Using the VideoKitCameraManager.OnCameraFrame event

The VideoKitCameraManager.OnCameraFrame event has been made parameterless:

void Start () {
    // Listen for camera frames

void OnCameraFrame () {
    // Do stuff

Using the VideoKitAudioManager.OnSampleBuffer event

The VideoKitAudioManager.OnSampleBuffer has been removed, replaced with VideoKitAudioManager.OnAudioBuffer which accepts an AudioBuffer instance directly from the streaming AudioDevice:

void Start () {
    // Listen for audio buffers

void OnAudioBuffer (AudioBuffer audioBuffer) {
    // Do stuff

Last updated