Skip to content

Instantly share code, notes, and snippets.

@aullman
Created August 27, 2014 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aullman/084e1508f957cfa4e868 to your computer and use it in GitHub Desktop.
Save aullman/084e1508f957cfa4e868 to your computer and use it in GitHub Desktop.
Sample code for blocking IE in an OpenTok Application
// Detect whether this browser is IE
var isNotIE = function isIE () {
var userAgent = window.navigator.userAgent.toLowerCase(),
appName = window.navigator.appName;
return !( appName === 'Microsoft Internet Explorer' || // IE <= 10
(appName === 'Netscape' && userAgent.indexOf('trident') > -1) ); // IE >= 11
};
// If the browser is not IE, and it meets the minimum system requirements for the OpenTok platform,
// then create your app
if (isNotIE() && OT.checkSystemRequirements()) {
var session = OT.initSession('your apiKey', 'your sessionId');
// ... continue with your OpenTok application
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment