FetchVideoInputs (Unreal Engine)

- Declaration

static void FetchVideoInputs(CavrnusAvailableVideoInputDevices OnReceiveDevices);

Delegates Types:

DECLARE_DYNAMIC_DELEGATE_OneParam(FCavrnusAvailableVideoInputDevices, const TArray<FCavrnusVideoInputDevice>&, VideoInputDevices);

typedef TFunction<void(const TArray<FCavrnusVideoInputDevice>&)> CavrnusAvailableVideoInputDevices;

- Description

Fetches the available cameras & screenshare-sources from which the user can stream their video. This function is basically only useful if you wished to build your own version of the default voice/video UI.

- Blueprint Sample

FetchVideoInputs.png
Audio Video Selection Widget

- Code Sample

#include "CavrnusFunctionLibrary.h" #include "Types/CavrnusCallbackTypes.h" #include "Types/CavrnusVideoInputDevice.h" void UClassName::Initialize() { // Member is FCavrnusAvailableVideoInputDevices VideoInputDevicesDelegate; VideoInputDevicesDelegate.BindUFunction(this, GET_FUNCTION_NAME_CHECKED(UClassName, OnVideoInputDevicesReceived)); } void UClassName::OnVideoInputDevicesReceived(const TArray<FCavrnusVideoInputDevice>& VideoInputDevices) { // Member is TMap<FString, FCavrnusVideoInputDevice> VideoInputDeviceList; VideoInputDeviceList.Empty(VideoInputDevices.Num()) for (auto VideoInputDevice : VideoInputDevices) { VideoInputDeviceList.Add(VideoInputDevice.DeviceId, VideoInputDevice); } }