Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

482
Visualizações
Twilio : How to grant access to camera once for all?

I have a meeting app using Twilio Video.

The app has a requirement such that when a user wants to join a room, it's not immediate. That means : A user sends a request to the app server to join, immediately he will see his local webcam, then he will wait for sometime until the server responds with a token to join the room. It may be 10 or 20 minutes.

The communication between the client and the server is done through WebSockets.

Here is the process :

Step 1: Client sends a request to the app server to join a room

Step 2: Request access and show the client local camera as follows :

// Get the track from twilio
const Track = await Twilio.Video.createLocalVideoTrack();

// Add track to HTML        
LocalMediaContainer.appendChild(Track.attach());

Step 3: Client waits for the server to respond (let's say 10 minutes)

Step 4: The server responds with the token to join Twilio video room

Step 5: Client joins room using the token sent by the server as follows

Twilio.Video.connect(Token, { name:RoomName }).then(room => {
    console.log('Successfully joined a Room');

    room.on('participantConnected', participant => {
      console.log('A remote Participant connected ');
    });
  }, error => {
    console.error('Unable to connect to Room');
  });

The process works fine. The problem I'm getting however, is that in Step 5, when the client is trying to join a room, twilio asks him again to grant access to camera.

Basically, even though the access has already been granted, the method Twilio.Video.connect asks again for access.

I was wondering if there is a way to use the authorization previously granted to use the camera and avoid asking for it again if it has already been granted.

Thanks Cheers,

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Twilio developer evangelist here.

When you call Twilio.Video.connect you can pass an array of tracks with the user's media that you already have.

Twilio.Video.connect(Token, { name: RoomName, tracks: [VideoTrack, AudioTrack] }).then(...);

This uses your existing tracks instead of making a new permissions request to getUserMedia.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda