hello
I have a problem, I want to connect a camera through a video capturer (ELGATO Capturer) to the USB C port of an Oculus Quest 3
and I can’t see the camera, when I look at it from the unity editor it is displayed and the camera detects me, but when I’m in the oculus or an android phone it doesn’t work, this is the code I use:
public Dropdown webcamDropdown; // Dropdown para seleccionar la cámara
public RawImage webcamDisplay; // RawImage para mostrar el feed
private WebCamTexture currentWebcamTexture; // Para guardar la instancia de WebCamTexture
void Start()
{
// Obtener todas las cámaras web conectadas
WebCamDevice[ ] devices = WebCamTexture.devices;
// Rellenar el dropdown con los nombres de las cámaras
webcamDropdown.options.Clear();
foreach (WebCamDevice device in devices)
{
webcamDropdown.options.Add(new Dropdown.OptionData(device.name));
}
// Suscribirse al evento de cambio del dropdown
webcamDropdown.onValueChanged.AddListener(OnWebcamSelected);
// Seleccionar la primera cámara por defecto
if (devices.Length > 0)
{
SelectWebcam(0);
}
}
void OnWebcamSelected(int index)
{
// Detener la cámara actual si está en uso
if (currentWebcamTexture != null)
{
currentWebcamTexture.Stop();
}
// Seleccionar la nueva cámara
SelectWebcam(index);
}
void SelectWebcam(int index)
{
// Iniciar la nueva WebCamTexture
WebCamDevice device = WebCamTexture.devices[index];
currentWebcamTexture = new WebCamTexture(device.name);
// Asignar el WebCamTexture al RawImage
webcamDisplay.texture = currentWebcamTexture;
// Iniciar el feed
currentWebcamTexture.Play();
}
Can somebody help me