Let platform be a self-invoked function

This commit is contained in:
Christoph Diehl 2017-06-08 15:46:46 +02:00
parent 07983e5999
commit d7db764361

View file

@ -45,7 +45,7 @@ utils.platform = (function () {
platform.current =
platform.msie ? 'msie' : platform.mozilla ? 'mozilla' : platform.chrome ? 'chrome' : platform.safari ? 'safari' : platform.opera ? 'opera' : platform.mobileSafari ? 'mobile-safari' : platform.android ? 'android' : 'unknown'
function platformName (candidates) {
function platformName(candidates) {
for (let i = 0; i < candidates.length; i++) {
if (candidates[i] in window) {
return 'window.' + candidates[i]
@ -88,10 +88,14 @@ utils.platform = (function () {
platform.WebGL2 = 'webgl2' // findWebGLContextName(["webgl2", "experimental-webgl2"]);
platform.captureStreamUntilEnded = 'captureStreamUntilEnded'
if (platform.isMozilla) { platform.captureStreamUntilEnded = 'mozCaptureStreamUntilEnded' }
if (platform.isMozilla) {
platform.captureStreamUntilEnded = 'mozCaptureStreamUntilEnded'
}
platform.srcObject = 'srcObject'
if (platform.isMozilla) { platform.srcObject = 'mozSrcObject' }
if (platform.isMozilla) {
platform.srcObject = 'mozSrcObject'
}
return platform
})()