Let platform be a self-invoked function
This commit is contained in:
parent
07983e5999
commit
d7db764361
1 changed files with 84 additions and 80 deletions
|
@ -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
|
||||
})()
|
||||
|
|
Loading…
Reference in a new issue