new Device()
Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr
- Source:
Members
-
android
-
- Default Value:
- false
- Source:
Properties:
Name Type Description android
boolean Is running on android?
-
arora
-
- Default Value:
- false
- Source:
Properties:
Name Type Description arora
boolean Is running in arora?
-
audioData
-
- Default Value:
- false
- Source:
Properties:
Name Type Description audioData
boolean Are Audio tags available?
-
canvas
-
- Default Value:
- false
- Source:
Properties:
Name Type Description canvas
boolean Is canvas available?
-
chrome
-
- Default Value:
- false
- Source:
Properties:
Name Type Description chrome
boolean Is running in chrome?
-
chromeOS
-
- Default Value:
- false
- Source:
Properties:
Name Type Description chromeOS
boolean Is running on chromeOS?
-
css3D
-
- Default Value:
- false
- Source:
Properties:
Name Type Description css3D
boolean Is css3D available?
-
desktop
-
- Default Value:
- false
- Source:
Properties:
Name Type Description desktop
boolean Is running desktop?
-
epiphany
-
- Default Value:
- false
- Source:
Properties:
Name Type Description epiphany
boolean Is running in epiphany?
-
file
-
- Default Value:
- false
- Source:
Properties:
Name Type Description file
boolean Is file available?
-
fileSystem
-
- Default Value:
- false
- Source:
Properties:
Name Type Description fileSystem
boolean Is fileSystem available?
-
firefox
-
- Default Value:
- false
- Source:
Properties:
Name Type Description firefox
boolean Is running in firefox?
-
ie
-
- Default Value:
- false
- Source:
Properties:
Name Type Description ie
boolean Is running in ie?
-
ieVersion
-
- Default Value:
- 0
- Source:
Properties:
Name Type Description ieVersion
number Version of ie?
-
iOS
-
- Default Value:
- false
- Source:
Properties:
Name Type Description iOS
boolean Is running on iOS?
-
iPad
-
- Default Value:
- false
- Source:
Properties:
Name Type Description iPad
boolean Is running on iPad?
-
iPhone
-
- Default Value:
- false
- Source:
Properties:
Name Type Description iPhone
boolean Is running on iPhone?
-
iPhone4
-
- Default Value:
- false
- Source:
Properties:
Name Type Description iPhone4
boolean Is running on iPhone4?
-
linux
-
- Default Value:
- false
- Source:
Properties:
Name Type Description linux
boolean Is running on linux?
-
localStorage
-
- Default Value:
- false
- Source:
Properties:
Name Type Description localStorage
boolean Is localStorage available?
-
m4a
-
Can this device play m4a files?
- Default Value:
- false
- Source:
Properties:
Name Type Description m4a
boolean True if this device can play m4a files.
-
macOS
-
- Default Value:
- false
- Source:
Properties:
Name Type Description macOS
boolean Is running on macOS?
-
midori
-
- Default Value:
- false
- Source:
Properties:
Name Type Description midori
boolean Is running in midori?
-
mobileSafari
-
- Default Value:
- false
- Source:
Properties:
Name Type Description mobileSafari
boolean Is running in mobileSafari?
-
mp3
-
- Default Value:
- false
- Source:
Properties:
Name Type Description mp3
boolean Can this device play mp3 files?
-
mspointer
-
- Default Value:
- false
- Source:
Properties:
Name Type Description mspointer
boolean Is mspointer available?
-
ogg
-
- Default Value:
- false
- Source:
Properties:
Name Type Description ogg
boolean Can this device play ogg files?
-
opera
-
- Default Value:
- false
- Source:
Properties:
Name Type Description opera
boolean Is running in opera?
-
opus
-
- Default Value:
- false
- Source:
Properties:
Name Type Description opus
boolean Can this device play opus files?
-
patchAndroidClearRectBug
-
An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247
- Default Value:
- false
- Source:
Properties:
Name Type Description patchAndroidClearRectBug
boolean Description.
-
pixelRatio
-
- Default Value:
- 0
- Source:
Properties:
Name Type Description pixelRatio
number PixelRatio of the host device?
-
pointerLock
-
- Default Value:
- false
- Source:
Properties:
Name Type Description pointerLock
boolean Is Pointer Lock available?
-
safari
-
- Default Value:
- false
- Source:
Properties:
Name Type Description safari
boolean Is running in safari?
-
touch
-
- Default Value:
- false
- Source:
Properties:
Name Type Description touch
boolean Is touch available?
-
wav
-
- Default Value:
- false
- Source:
Properties:
Name Type Description wav
boolean Can this device play wav files?
-
webAudio
-
- Default Value:
- false
- Source:
Properties:
Name Type Description webAudio
boolean Is the WebAudio API available?
-
webGL
-
- Default Value:
- false
- Source:
Properties:
Name Type Description webGL
boolean Is webGL available?
-
webm
-
- Default Value:
- false
- Source:
Properties:
Name Type Description webm
boolean Can this device play webm files?
-
windows
-
- Default Value:
- false
- Source:
Properties:
Name Type Description windows
boolean Is running on windows?
-
worker
-
- Default Value:
- false
- Source:
Properties:
Name Type Description worker
boolean Is worker available?
Methods
-
canPlayAudio(type) → {boolean}
-
Check whether the host environment can play audio.
Parameters:
Name Type Description type
string One of 'mp3, 'ogg', 'm4a', 'wav', 'webm'.
- Source:
Returns:
True if the given file type is supported by the browser, otherwise false.
- Type
- boolean
-
isConsoleOpen() → {boolean}
-
Check whether the console is open.
- Source:
Returns:
True if the browser dev console is open.
- Type
- boolean