tokbox how to detect if browser supports or not

940 views Asked by At

In tokbox , Is it possible to detect browsers and throw a not supported page.

But in tokbox demo ideo page they are doing this but i searched on their document but can't find how to do this stuff. can anyone help me on this.

2

There are 2 answers

0
Uday Reddy On

Opentok has better APIs now:

You can use network-test.

otNetworkTest.testQuality(null, function updateCallback() {
    // process intermediate results
}).then(results) {
    // Display UI based on results
}).catch(error, results) {
    switch (error.name) {
        case ErrorNames.UNSUPPORTED_BROWSER:
        // Display UI message about unsupported browser
        break;
        case ErrorNames.CONNECT_TO_SESSION_NETWORK_ERROR:
        // Display UI message about network error
        break;

        default:
        console.error('Unknown error .');
    }
});
1
rajansoft1 On

I think you might be looking for the below code

OT.checkScreenSharingCapability(function(response) {
  if (!response.supported || response.extensionRegistered === false) {
    // This browser does not support screen sharing
  } else if (response.extensionInstalled === false) {
    // prompt to install the response.extensionRequired extension
  } else {
    // Screen sharing is available
  }
});

Let me know if you need further help