opentok / opentok-react

React components for OpenTok.js
https://www.npmjs.com/package/opentok-react
MIT License
107 stars 105 forks source link

On click of Screen share pop up's cancel button gives an fatal error #180

Open rohanrana opened 3 years ago

rohanrana commented 3 years ago

On-screen share, popup cancel am getting this error _Unhandled Rejection (OT_USER_MEDIA_ACCESSDENIED): End-user denied permission to hardware devices (getUserMedia error: NotAllowedError)

please help me out @enricop89 Here is my issue video https://www.loom.com/share/0a2e1e849433433da42ab795904cd608

enricop89 commented 3 years ago

you can listen to that error using the event accessDenied. It's not really an error though, it's just how the browser handle it.

this.publisherEventHandlers = {
      accessDenied: event => {
        console.log('Publisher Screen press cancel');
      }
    };
  }

  render() {
    return (
      <OTSession apiKey="your-api-key" sessionId="your-session-id" token="your-session-token">
        <OTPublisher
          properties={this.publisherProperties}
          eventHandlers={this.publisherEventHandlers}
        />
      </OTSession>
    );
  }
rohanrana commented 3 years ago

@enricop89 well I have done the same still getting the error and strange thing is that am.not getting this error in Firefox am getting this error only in chrome

alanRiveros commented 3 years ago

Same issue

SumitAgarwal1993 commented 3 years ago

On-screen share, popup cancel am getting this error Unhandled Rejection (OT_USER_MEDIA_ACCESS_DENIED): End-user denied permission to hardware devices (getUserMedia error: NotAllowedError)

please help me out @enricop89 @alanRiveros @rohanrana