Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

3.6K
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!