Created
August 27, 2014 04:28
-
-
Save aullman/084e1508f957cfa4e868 to your computer and use it in GitHub Desktop.
Sample code for blocking IE in an OpenTok Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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