0

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.

Lucas Huang
  • 3,998
  • 3
  • 20
  • 29
shyamkarthick
  • 499
  • 1
  • 4
  • 17

2 Answers2

2

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 .');
    }
});
Uday Reddy
  • 1,337
  • 3
  • 16
  • 38
1

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

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
rajansoft1
  • 1,336
  • 2
  • 18
  • 38