Phaser.Device

Audio

<static> 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.

nametypeoptionaldescription
audioDatabooleanNoCan this device play HTML Audio tags?
dolbybooleanNoCan this device play EC-3 Dolby Digital Plus files?
m4abooleanNoCan this device can play m4a files.
aacbooleanNoCan this device can play aac files.
flacbooleanNoCan this device can play flac files.
mp3booleanNoCan this device play mp3 files?
oggbooleanNoCan this device play ogg files?
opusbooleanNoCan this device play opus files?
wavbooleanNoCan this device play wav files?
webAudiobooleanNoDoes this device have the Web Audio API?
webmbooleanNoCan this device play webm files?

Type: object

Member of: Phaser.Device

Source: src/device/Audio.js#L9
Since: 3.0.0


Browser

<static> 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.

nametypeoptionaldescription
chromebooleanNoSet to true if running in Chrome.
edgebooleanNoSet to true if running in Microsoft Edge browser.
firefoxbooleanNoSet to true if running in Firefox.
iebooleanNoSet to true if running in Internet Explorer 11 or less (not Edge).
mobileSafaribooleanNoSet to true if running in Mobile Safari.
operabooleanNoSet to true if running in Opera.
safaribooleanNoSet to true if running in Safari.
silkbooleanNoSet to true if running in the Silk browser (as used on the Amazon Kindle)
tridentbooleanNoSet to true if running a Trident version of Internet Explorer (IE11+)
chromeVersionnumberNoIf running in Chrome this will contain the major version number.
firefoxVersionnumberNoIf running in Firefox this will contain the major version number.
ieVersionnumberNoIf running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion.
safariVersionnumberNoIf running in Safari this will contain the major version number.
tridentVersionnumberNoIf running in Internet Explorer 11 this will contain the major version number. See {@link http://msdn.microsoft.com/en-us/library/ie/ms537503(v=vs.85).aspx}

Type: object

Member of: Phaser.Device

Source: src/device/Browser.js#L9
Since: 3.0.0


CanvasFeatures

<static> 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.

nametypeoptionaldescription
supportInverseAlphabooleanNoSet to true if the browser supports inversed alpha.
supportNewBlendModesbooleanNoSet to true if the browser supports new canvas blend modes.

Type: object

Member of: Phaser.Device

Source: src/device/CanvasFeatures.js#L9
Since: 3.0.0


Features

<static> 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.

nametypeoptionaldescription
canvasbooleanNoIs canvas available?
canvasBitBltShiftbooleanNoTrue if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap.
filebooleanNoIs file available?
fileSystembooleanNoIs fileSystem available?
getUserMediabooleanNoDoes the device support the getUserMedia API?
littleEndianbooleanNoIs the device big or little endian? (only detected if the browser supports TypedArrays)
localStoragebooleanNoIs localStorage available?
pointerLockbooleanNoIs Pointer Lock available?
stableSortbooleanNoIs Array.sort stable?
support32bitbooleanNoDoes the device context support 32bit pixel manipulation using array buffer views?
vibrationbooleanNoDoes the device support the Vibration API?
webGLbooleanNoIs webGL available?
workerbooleanNoIs worker available?

Type: object

Member of: Phaser.Device

Source: src/device/Features.js#L11
Since: 3.0.0


Fullscreen

<static> 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.

nametypeoptionaldescription
availablebooleanNoDoes the browser support the Full Screen API?
keyboardbooleanNoDoes the browser support access to the Keyboard during Full Screen mode?
cancelstringNoIf the browser supports the Full Screen API this holds the call you need to use to cancel it.
requeststringNoIf the browser supports the Full Screen API this holds the call you need to use to activate it.

Type: object

Member of: Phaser.Device

Source: src/device/Fullscreen.js#L7
Since: 3.0.0


Input

<static> 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.

nametypeoptionaldescription
wheelTypestringNoThe newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'
gamepadsbooleanNoIs navigator.getGamepads available?
mspointerbooleanNoIs mspointer available?
touchbooleanNoIs touch available?

Type: object

Member of: Phaser.Device

Source: src/device/Input.js#L9
Since: 3.0.0


OS

<static> 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.

nametypeoptionaldescription
androidbooleanNoIs running on android?
chromeOSbooleanNoIs running on chromeOS?
cordovabooleanNoIs the game running under Apache Cordova?
crosswalkbooleanNoIs the game running under the Intel Crosswalk XDK?
desktopbooleanNoIs running on a desktop?
ejectabooleanNoIs the game running under Ejecta?
electronbooleanNoIs the game running under GitHub Electron?
iOSbooleanNoIs running on iOS?
iPadbooleanNoIs running on iPad?
iPhonebooleanNoIs running on iPhone?
kindlebooleanNoIs running on an Amazon Kindle?
linuxbooleanNoIs running on linux?
macOSbooleanNoIs running on macOS?
nodebooleanNoIs the game running under Node.js?
nodeWebkitbooleanNoIs the game running under Node-Webkit?
webAppbooleanNoSet to true if running as a WebApp, i.e. within a WebView
windowsbooleanNoIs running on windows?
windowsPhonebooleanNoIs running on a Windows Phone?
iOSVersionnumberNoIf running in iOS this will contain the major version number.
pixelRationumberNoPixelRatio of the host device?

Type: object

Member of: Phaser.Device

Source: src/device/OS.js#L7
Since: 3.0.0


Video

<static> 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.

In Phaser 3.20 the properties were renamed to drop the 'Video' suffix.

nametypeoptionaldescription
h264booleanNoCan this device play h264 mp4 video files?
hlsbooleanNoCan this device play hls video files?
mp4booleanNoCan this device play h264 mp4 video files?
m4vbooleanNoCan this device play m4v (typically mp4) video files?
oggbooleanNoCan this device play ogg video files?
vp9booleanNoCan this device play vp9 video files?
webmbooleanNoCan this device play webm video files?
getVideoURLfunctionNoReturns the first video URL that can be played by this browser.

Type: object

Member of: Phaser.Device

Source: src/device/Video.js#L9
Since: 3.0.0


Updated on