Class: Device

Phaser. Device

Phaser.Device

new Device()

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

Source:

Members

android

Properties:
Name Type Description
android boolean

Is running on android?

Default Value:
  • false
Source:

arora

Properties:
Name Type Description
arora boolean

Is running in arora?

Default Value:
  • false
Source:

audioData

Properties:
Name Type Description
audioData boolean

Are Audio tags available?

Default Value:
  • false
Source:

canvas

Properties:
Name Type Description
canvas boolean

Is canvas available?

Default Value:
  • false
Source:

chrome

Properties:
Name Type Description
chrome boolean

Is running in chrome?

Default Value:
  • false
Source:

chromeOS

Properties:
Name Type Description
chromeOS boolean

Is running on chromeOS?

Default Value:
  • false
Source:

css3D

Properties:
Name Type Description
css3D boolean

Is css3D available?

Default Value:
  • false
Source:

desktop

Properties:
Name Type Description
desktop boolean

Is running desktop?

Default Value:
  • false
Source:

epiphany

Properties:
Name Type Description
epiphany boolean

Is running in epiphany?

Default Value:
  • false
Source:

file

Properties:
Name Type Description
file boolean

Is file available?

Default Value:
  • false
Source:

fileSystem

Properties:
Name Type Description
fileSystem boolean

Is fileSystem available?

Default Value:
  • false
Source:

firefox

Properties:
Name Type Description
firefox boolean

Is running in firefox?

Default Value:
  • false
Source:

ie

Properties:
Name Type Description
ie boolean

Is running in ie?

Default Value:
  • false
Source:

ieVersion

Properties:
Name Type Description
ieVersion number

Version of ie?

Default Value:
  • 0
Source:

iOS

Properties:
Name Type Description
iOS boolean

Is running on iOS?

Default Value:
  • false
Source:

iPad

Properties:
Name Type Description
iPad boolean

Is running on iPad?

Default Value:
  • false
Source:

iPhone

Properties:
Name Type Description
iPhone boolean

Is running on iPhone?

Default Value:
  • false
Source:

iPhone4

Properties:
Name Type Description
iPhone4 boolean

Is running on iPhone4?

Default Value:
  • false
Source:

linux

Properties:
Name Type Description
linux boolean

Is running on linux?

Default Value:
  • false
Source:

localStorage

Properties:
Name Type Description
localStorage boolean

Is localStorage available?

Default Value:
  • false
Source:

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:

macOS

Properties:
Name Type Description
macOS boolean

Is running on macOS?

Default Value:
  • false
Source:

midori

Properties:
Name Type Description
midori boolean

Is running in midori?

Default Value:
  • false
Source:

mobileSafari

Properties:
Name Type Description
mobileSafari boolean

Is running in mobileSafari?

Default Value:
  • false
Source:

mp3

Properties:
Name Type Description
mp3 boolean

Can this device play mp3 files?

Default Value:
  • false
Source:

mspointer

Properties:
Name Type Description
mspointer boolean

Is mspointer available?

Default Value:
  • false
Source:

ogg

Properties:
Name Type Description
ogg boolean

Can this device play ogg files?

Default Value:
  • false
Source:

opera

Properties:
Name Type Description
opera boolean

Is running in opera?

Default Value:
  • false
Source:

opus

Properties:
Name Type Description
opus boolean

Can this device play opus files?

Default Value:
  • false
Source:

patchAndroidClearRectBug

An optional 'fix' for the horrendous Android stock browser bug https://code.google.com/p/android/issues/detail?id=39247

Properties:
Name Type Description
patchAndroidClearRectBug boolean

Description.

Default Value:
  • false
Source:

pixelRatio

Properties:
Name Type Description
pixelRatio number

PixelRatio of the host device?

Default Value:
  • 0
Source:

pointerLock

Properties:
Name Type Description
pointerLock boolean

Is Pointer Lock available?

Default Value:
  • false
Source:

safari

Properties:
Name Type Description
safari boolean

Is running in safari?

Default Value:
  • false
Source:

touch

Properties:
Name Type Description
touch boolean

Is touch available?

Default Value:
  • false
Source:

wav

Properties:
Name Type Description
wav boolean

Can this device play wav files?

Default Value:
  • false
Source:

webAudio

Properties:
Name Type Description
webAudio boolean

Is the WebAudio API available?

Default Value:
  • false
Source:

webGL

Properties:
Name Type Description
webGL boolean

Is webGL available?

Default Value:
  • false
Source:

webm

Properties:
Name Type Description
webm boolean

Can this device play webm files?

Default Value:
  • false
Source:

windows

Properties:
Name Type Description
windows boolean

Is running on windows?

Default Value:
  • false
Source:

worker

Properties:
Name Type Description
worker boolean

Is worker available?

Default Value:
  • false
Source:

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
Phaser Copyright © 2012-2013 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Fri Oct 25 2013 16:16:44 GMT+0100 (BST) using the DocStrap template.