- 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.audiofrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/Audio.js (Line 9)
Properties:
Name Type Description audioDataboolean Can this device play HTML Audio tags?
dolbyboolean Can this device play EC-3 Dolby Digital Plus files?
m4aboolean Can this device can play m4a files.
mp3boolean Can this device play mp3 files?
oggboolean Can this device play ogg files?
opusboolean Can this device play opus files?
wavboolean Can this device play wav files?
webAudioboolean Does this device have the Web Audio API?
webmboolean Can this device play webm files?
-
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.browserfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/Browser.js (Line 9)
Properties:
Name Type Description chromeboolean Set to true if running in Chrome.
edgeboolean Set to true if running in Microsoft Edge browser.
firefoxboolean Set to true if running in Firefox.
ieboolean Set to true if running in Internet Explorer 11 or less (not Edge).
mobileSafariboolean Set to true if running in Mobile Safari.
operaboolean Set to true if running in Opera.
safariboolean Set to true if running in Safari.
silkboolean Set to true if running in the Silk browser (as used on the Amazon Kindle)
tridentboolean Set to true if running a Trident version of Internet Explorer (IE11+)
chromeVersionnumber If running in Chrome this will contain the major version number.
firefoxVersionnumber If running in Firefox this will contain the major version number.
ieVersionnumber If running in Internet Explorer this will contain the major version number. Beyond IE10 you should use Browser.trident and Browser.tridentVersion.
safariVersionnumber If running in Safari this will contain the major version number.
tridentVersionnumber 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
-
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.canvasFeaturesfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/CanvasFeatures.js (Line 9)
Properties:
Name Type Description supportInverseAlphaboolean Set to true if the browser supports inversed alpha.
supportNewBlendModesboolean Set to true if the browser supports new canvas blend modes.
-
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.featuresfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/Features.js (Line 11)
Properties:
Name Type Argument Description canvasBitBltShiftboolean <nullable>
True if canvas supports a 'copy' bitblt onto itself when the source and destination regions overlap.
canvasboolean Is canvas available?
fileboolean Is file available?
fileSystemboolean Is fileSystem available?
getUserMediaboolean Does the device support the getUserMedia API?
littleEndianboolean Is the device big or little endian? (only detected if the browser supports TypedArrays)
localStorageboolean Is localStorage available?
pointerLockboolean Is Pointer Lock available?
support32bitboolean Does the device context support 32bit pixel manipulation using array buffer views?
vibrationboolean Does the device support the Vibration API?
webGLboolean Is webGL available?
workerboolean Is worker available?
-
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.fullscreenfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/Fullscreen.js (Line 7)
Properties:
Name Type Description availableboolean Does the browser support the Full Screen API?
keyboardboolean Does the browser support access to the Keyboard during Full Screen mode?
cancelstring If the browser supports the Full Screen API this holds the call you need to use to cancel it.
requeststring If the browser supports the Full Screen API this holds the call you need to use to activate it.
-
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.inputfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/Input.js (Line 9)
Properties:
Name Type Argument Description wheelTypestring <nullable>
The newest type of Wheel/Scroll event supported: 'wheel', 'mousewheel', 'DOMMouseScroll'
gamepadsboolean Is navigator.getGamepads available?
mspointerboolean Is mspointer available?
touchboolean Is touch available?
-
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.osfrom within any Scene.Type:
- object
- Since: 3.0.0
- Source: src/device/OS.js (Line 7)
Properties:
Name Type Description androidboolean Is running on android?
chromeOSboolean Is running on chromeOS?
cordovaboolean Is the game running under Apache Cordova?
crosswalkboolean Is the game running under the Intel Crosswalk XDK?
desktopboolean Is running on a desktop?
ejectaboolean Is the game running under Ejecta?
electronboolean Is the game running under GitHub Electron?
iOSboolean Is running on iOS?
iPadboolean Is running on iPad?
iPhoneboolean Is running on iPhone?
kindleboolean Is running on an Amazon Kindle?
linuxboolean Is running on linux?
macOSboolean Is running on macOS?
nodeboolean Is the game running under Node.js?
nodeWebkitboolean Is the game running under Node-Webkit?
webAppboolean Set to true if running as a WebApp, i.e. within a WebView
windowsboolean Is running on windows?
windowsPhoneboolean Is running on a Windows Phone?
iOSVersionnumber If running in iOS this will contain the major version number.
pixelRationumber PixelRatio of the host device?
-
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.videofrom within any Scene.In Phaser 3.20 the properties were renamed to drop the 'Video' suffix.
Type:
- object
- Since: 3.0.0
- Source: src/device/Video.js (Line 7)
Properties:
Name Type Description h264boolean Can this device play h264 mp4 video files?
hlsboolean Can this device play hls video files?
mp4boolean Can this device play h264 mp4 video files?
oggboolean Can this device play ogg video files?
vp9boolean Can this device play vp9 video files?
webmboolean Can this device play webm video files?
