# Class: Device

## Phaser. Device

Phaser.Device

#### new Device()

  Detects device support capabilities. Using some elements from System.js by MrDoob and Modernizr

  Source:
    - system/Device.js, line 14

### Members

#### android

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `android` | boolean | Is running on android?

  Default Value:
    - false
  Source:
    - system/Device.js, line 57

#### arora

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `arora` | boolean | Set to true if running in Arora.

  Default Value:
    - false
  Source:
    - system/Device.js, line 181

#### audioData

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `audioData` | boolean | Are Audio tags available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 267

#### cancelFullscreen

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `cancelFullscreen` | string | If the browser supports the Full Screen API this holds the call you need to use to cancel it.

  Source:
    - system/Device.js, line 366

#### canvas

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `canvas` | boolean | Is canvas available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 95

#### chrome

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `chrome` | boolean | Set to true if running in Chrome.

  Default Value:
    - false
  Source:
    - system/Device.js, line 187

#### chromeOS

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `chromeOS` | boolean | Is running on chromeOS?

  Default Value:
    - false
  Source:
    - system/Device.js, line 63

#### cocoonJS

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `cocoonJS` | boolean | Is the game running under CocoonJS?

  Default Value:
    - false
  Source:
    - system/Device.js, line 39

#### crosswalk

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `crosswalk` | boolean | Is the game running under the Intel Crosswalk XDK?

  Default Value:
    - false
  Source:
    - system/Device.js, line 51

#### css3D

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `css3D` | boolean | Is css3D available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 143

#### desktop

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `desktop` | boolean | Is running desktop?

  Default Value:
    - false
  Source:
    - system/Device.js, line 27

#### ejecta

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ejecta` | boolean | Is the game running under Ejecta?

  Default Value:
    - false
  Source:
    - system/Device.js, line 45

#### epiphany

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `epiphany` | boolean | Set to true if running in Epiphany.

  Default Value:
    - false
  Source:
    - system/Device.js, line 193

#### file

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `file` | boolean | Is file available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 101

#### fileSystem

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `fileSystem` | boolean | Is fileSystem available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 107

#### firefox

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `firefox` | boolean | Set to true if running in Firefox.

  Default Value:
    - false
  Source:
    - system/Device.js, line 199

#### fullscreen

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `fullscreen` | boolean | Does the browser support the Full Screen API?

  Default Value:
    - false
  Source:
    - system/Device.js, line 354

#### fullscreenKeyboard

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `fullscreenKeyboard` | boolean | Does the browser support access to the Keyboard during Full Screen mode?

  Default Value:
    - false
  Source:
    - system/Device.js, line 372

#### game

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `game` | Phaser.Game | A reference to the currently running game.

  Source:
    - system/Device.js, line 19

#### getUserMedia

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `getUserMedia` | boolean | Does the device support the getUserMedia API?

  Default Value:
    - false
  Source:
    - system/Device.js, line 167

#### ie

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ie` | boolean | Set to true if running in Internet Explorer.

  Default Value:
    - false
  Source:
    - system/Device.js, line 205

#### ieVersion

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ieVersion` | number | If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Device.trident and Device.tridentVersion.

  Default Value:
    - 0
  Source:
    - system/Device.js, line 211

#### iOS

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `iOS` | boolean | Is running on iOS?

  Default Value:
    - false
  Source:
    - system/Device.js, line 33

#### iPad

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `iPad` | boolean | Is running on iPad?

  Default Value:
    - false
  Source:
    - system/Device.js, line 330

#### iPhone

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `iPhone` | boolean | Is running on iPhone?

  Default Value:
    - false
  Source:
    - system/Device.js, line 318

#### iPhone4

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `iPhone4` | boolean | Is running on iPhone4?

  Default Value:
    - false
  Source:
    - system/Device.js, line 324

#### linux

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `linux` | boolean | Is running on linux?

  Default Value:
    - false
  Source:
    - system/Device.js, line 69

#### littleEndian

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `littleEndian` | boolean | Is the device big or little endian? (only detected if the browser supports TypedArrays)

  Default Value:
    - false
  Source:
    - system/Device.js, line 342

#### localStorage

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `localStorage` | boolean | Is localStorage available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 113

#### m4a

  Can this device play m4a files?

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `m4a` | boolean | True if this device can play m4a files.

  Default Value:
    - false
  Source:
    - system/Device.js, line 304

#### macOS

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `macOS` | boolean | Is running on macOS?

  Default Value:
    - false
  Source:
    - system/Device.js, line 75

#### midori

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `midori` | boolean | Set to true if running in Midori.

  Default Value:
    - false
  Source:
    - system/Device.js, line 235

#### mobileSafari

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `mobileSafari` | boolean | Set to true if running in Mobile Safari.

  Default Value:
    - false
  Source:
    - system/Device.js, line 229

#### mp3

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `mp3` | boolean | Can this device play mp3 files?

  Default Value:
    - false
  Source:
    - system/Device.js, line 291

#### mspointer

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `mspointer` | boolean | Is mspointer available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 137

#### ogg

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ogg` | boolean | Can this device play ogg files?

  Default Value:
    - false
  Source:
    - system/Device.js, line 279

#### opera

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `opera` | boolean | Set to true if running in Opera.

  Default Value:
    - false
  Source:
    - system/Device.js, line 241

#### opus

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `opus` | boolean | Can this device play opus files?

  Default Value:
    - false
  Source:
    - system/Device.js, line 285

#### pixelRatio

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `pixelRatio` | number | PixelRatio of the host device?

  Default Value:
    - 0
  Source:
    - system/Device.js, line 336

#### pointerLock

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `pointerLock` | boolean | Is Pointer Lock available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 149

#### quirksMode

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `quirksMode` | boolean | Is the browser running in strict mode (false) or quirks mode? (true)

  Default Value:
    - false
  Source:
    - system/Device.js, line 173

#### requestFullscreen

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `requestFullscreen` | string | If the browser supports the Full Screen API this holds the call you need to use to activate it.

  Source:
    - system/Device.js, line 360

#### safari

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `safari` | boolean | Set to true if running in Safari.

  Default Value:
    - false
  Source:
    - system/Device.js, line 247

#### silk

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `silk` | boolean | Set to true if running in the Silk browser (as used on the Amazon Kindle)

  Default Value:
    - false
  Source:
    - system/Device.js, line 259

#### support32bit

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `support32bit` | boolean | Does the device context support 32bit pixel manipulation using array buffer views?

  Default Value:
    - false
  Source:
    - system/Device.js, line 348

#### touch

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `touch` | boolean | Is touch available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 131

#### trident

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `trident` | boolean | Set to true if running a Trident version of Internet Explorer (IE11+)

  Default Value:
    - false
  Source:
    - system/Device.js, line 217

#### tridentVersion

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `tridentVersion` | number | If running in Internet Explorer 11 this will contain the major version number. See http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx

  Default Value:
    - 0
  Source:
    - system/Device.js, line 223

#### typedArray

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `typedArray` | boolean | Does the browser support TypedArrays?

  Default Value:
    - false
  Source:
    - system/Device.js, line 155

#### vibration

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `vibration` | boolean | Does the device support the Vibration API?

  Default Value:
    - false
  Source:
    - system/Device.js, line 161

#### wav

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `wav` | boolean | Can this device play wav files?

  Default Value:
    - false
  Source:
    - system/Device.js, line 297

#### webApp

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `webApp` | boolean | Set to true if running as a WebApp, i.e. within a WebView

  Default Value:
    - false
  Source:
    - system/Device.js, line 253

#### webAudio

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `webAudio` | boolean | Is the WebAudio API available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 273

#### webGL

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `webGL` | boolean | Is webGL available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 119

#### webm

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `webm` | boolean | Can this device play webm files?

  Default Value:
    - false
  Source:
    - system/Device.js, line 310

#### windows

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `windows` | boolean | Is running on windows?

  Default Value:
    - false
  Source:
    - system/Device.js, line 81

#### windowsPhone

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `windowsPhone` | boolean | Is running on a Windows Phone?

  Default Value:
    - false
  Source:
    - system/Device.js, line 87

#### worker

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `worker` | boolean | Is worker available?

  Default Value:
    - false
  Source:
    - system/Device.js, line 125

### 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:
    - system/Device.js, line 808

  ##### Returns:

  True if the given file type is supported by the browser, otherwise false.

  Type
    boolean

#### checkFullScreenSupport()

  Checks for support of the Full Screen API.

  Source:
    - system/Device.js, line 488

#### isConsoleOpen() → {boolean}

  Check whether the console is open. Note that this only works in Firefox with Firebug and earlier versions of Chrome. It used to work in Chrome, but then they removed the ability: http://src.chromium.org/viewvc/blink?view=revision&revision=151136

  Source:
    - system/Device.js, line 841

  ##### Returns:

  True if the browser dev console is open.

  Type
    boolean