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

3.6K
Visualizações
Clicking screen share pop up cancel button gives Unhandled Runtime Error

I'm implementing a video chat app with the OpenTokjs library with react using Next.js, when I tried to add the screen sharing feature before start sharing the screen the browser asks for permission and when the user click on the cancel button and refuse to give permission
it throws OT_USER_MEDIA_ACCESS_DENIED and even though I'm handling this error in the opentok callback error it still broke my Next.js App with Unhandled Runtime Error:

enter image description here

According to my research, this error is thrown by the browser because I tried it in Firefox and didn't face this issue here is similar issue reported here.

Here is the code:

publisherHelperRef.current = OT.initPublisher(
    publisherProperties,
    (error) => {
      if (error?.name === "OT_USER_MEDIA_ACCESS_DENIED") {
        setIsScreenShared(false)
        return  publishStream(getStreamSize())
      } 
      else if (error) {
        message.error(error?.name)
      }          
    }
)
    
sessionHelperRef.current?.publish(
    publisherHelperRef.current,
    (error) => {
      if (error) {
        message.error(error?.name)
      }    
    }
)   
about 4 years ago · Juan Pablo Isaza
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