Namespace: Device

Phaser. Device

Since: 3.0.0
Source: src/device/index.js (Line 12)

Type Definitions


Audio

Determines the audio playback capabilities of the device running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.audio from within any Scene.

Type:
  • object
Properties:
Name Type Description
audioData boolean

Can this device play HTML Audio tags?

dolby boolean

Can this device play EC-3 Dolby Digital Plus files?

m4a boolean

Can this device can play m4a files.

mp3 boolean

Can this device play mp3 files?

ogg boolean

Can this device play ogg files?

opus boolean

Can this device play opus files?

wav boolean

Can this device play wav files?

webAudio boolean

Does this device have the Web Audio API?

webm boolean

Can this device play webm files?

Since: 3.0.0
Source: src/device/Audio.js (Line 9)

Browser

Determines the browser type and version running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.browser from within any Scene.

Type:
  • object
Properties:
Name Type Description
chrome boolean

Set to true if running in Chrome.

edge boolean

Set to true if running in Microsoft Edge browser.

firefox boolean

Set to true if running in Firefox.

ie boolean

Set to true if running in Internet Explorer 11 or less (not Edge).

mobileSafari boolean

Set to true if running in Mobile Safari.

opera boolean

Set to true if running in Opera.

safari boolean

Set to true if running in Safari.

silk boolean

Set to true if running in the Silk browser (as used on the Amazon Kindle)

trident boolean

Set to true if running a Trident version of Internet Explorer (IE11+)

chromeVersion number

If running in Chrome this will contain the major version number.

firefoxVersion number

If running in Firefox this will contain the major version number.

ieVersion number

If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion.

safariVersion number

If running in Safari this will contain the major version number.

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

Since: 3.0.0
Source: src/device/Browser.js (Line 9)

CanvasFeatures

Determines the canvas features of the browser running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.canvasFeatures from within any Scene.

Type:
  • object
Properties:
Name Type Description
supportInverseAlpha boolean

Set to true if the browser supports inversed alpha.

supportNewBlendModes boolean

Set to true if the browser supports new canvas blend modes.

Since: 3.0.0
Source: src/device/CanvasFeatures.js (Line 9)

Features

Determines the features of the browser running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.features from within any Scene.

Type:
  • object
Properties:
Name Type Argument Description
canvasBitBltShift boolean <nullable>

True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap.

canvas boolean

Is canvas available?

file boolean

Is file available?

fileSystem boolean

Is fileSystem available?

getUserMedia boolean

Does the device support the getUserMedia API?

littleEndian boolean

Is the device big or little endian? (only detected if the browser supports TypedArrays)

localStorage boolean

Is localStorage available?

pointerLock boolean

Is Pointer Lock available?

support32bit boolean

Does the device context support 32bit pixel manipulation using array buffer views?

vibration boolean

Does the device support the Vibration API?

webGL boolean

Is webGL available?

worker boolean

Is worker available?

Since: 3.0.0
Source: src/device/Features.js (Line 11)

Fullscreen

Determines the full screen support of the browser running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.fullscreen from within any Scene.

Type:
  • object
Properties:
Name Type Description
available boolean

Does the browser support the Full Screen API?

keyboard boolean

Does the browser support access to the Keyboard during Full Screen mode?

cancel string

If the browser supports the Full Screen API this holds the call you need to use to cancel it.

request string

If the browser supports the Full Screen API this holds the call you need to use to activate it.

Since: 3.0.0
Source: src/device/Fullscreen.js (Line 7)

Input

Determines the input support of the browser running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.input from within any Scene.

Type:
  • object
Properties:
Name Type Argument Description
wheelType string <nullable>

The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'

gamepads boolean

Is navigator.getGamepads available?

mspointer boolean

Is mspointer available?

touch boolean

Is touch available?

Since: 3.0.0
Source: src/device/Input.js (Line 9)

OS

Determines the operating system of the device running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.os from within any Scene.

Type:
  • object
Properties:
Name Type Description
android boolean

Is running on android?

chromeOS boolean

Is running on chromeOS?

cordova boolean

Is the game running under Apache Cordova?

crosswalk boolean

Is the game running under the Intel Crosswalk XDK?

desktop boolean

Is running on a desktop?

ejecta boolean

Is the game running under Ejecta?

electron boolean

Is the game running under GitHub Electron?

iOS boolean

Is running on iOS?

iPad boolean

Is running on iPad?

iPhone boolean

Is running on iPhone?

kindle boolean

Is running on an Amazon Kindle?

linux boolean

Is running on linux?

macOS boolean

Is running on macOS?

node boolean

Is the game running under Node.js?

nodeWebkit boolean

Is the game running under Node-Webkit?

webApp boolean

Set to true if running as a WebApp, i.e. within a WebView

windows boolean

Is running on windows?

windowsPhone boolean

Is running on a Windows Phone?

iOSVersion number

If running in iOS this will contain the major version number.

pixelRatio number

PixelRatio of the host device?

Since: 3.0.0
Source: src/device/OS.js (Line 7)

Video

Determines the video support of the browser running this Phaser Game instance. These values are read-only and populated during the boot sequence of the game. They are then referenced by internal game systems and are available for you to access via this.sys.game.device.video from within any Scene.

Type:
  • object
Properties:
Name Type Description
h264Video boolean

Can this device play h264 mp4 video files?

hlsVideo boolean

Can this device play hls video files?

mp4Video boolean

Can this device play h264 mp4 video files?

oggVideo boolean

Can this device play ogg video files?

vp9Video boolean

Can this device play vp9 video files?

webmVideo boolean

Can this device play webm video files?

Since: 3.0.0
Source: src/device/Video.js (Line 7)