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

101
Visualizações
Is this possible to record the audio tracks only if video is also enabled with MediaRecorder?

I am working on a scenario where I will ask for the camera and mic permissions before joining the session. so I applied the following constraints in navigator.mediaDevices.getUserMedia

const constraints = {
    audio: true,
    video: {
        width: 1280, height: 720
    }
};

Everything works fine till here. But now I want to record the audio tracks only by using MediaRecorder. Other users can see the other peer's video but in the current session, I just want to record the audio content only for all users.

I tried setting up the MimeType but it still records the video content as well. I think MimeType is just for setting up the mime type for each track.

Do I need to do something on the server side where the blob data is uploaded?

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

0

You can create a new MediaStream object on which you'll add only the audio tracks from your current MediaStream:

const recording_stream = new MediaStream();
for (const track of gum_stream.getAudioTracks()) {
  recording_stream.addTrack(track);
}
const recorder = new MediaRecorder(recording_stream);
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