$wp.device: Device Properties (W Player API)
This interface provides APIs required for obtaining resource information related to devices such as W Player and Tizen.
getProperty()
- Description
Find the property value of the device.
- Syntax
function getProperty(‘name’);
- Parameter
View the names of provided properties from the table below, and enter the property name of the information you need as a parameter.
name: Property name
| name | Return value | |
|---|
| Type | Description | |
| string | value: w player version | |
| string | value: firmware version | |
| array | value: tag list | |
| string | value: MagicInfo Server ip address | |
| string | value: mac address | |
| string | value: ip address | |
| object | { width: 1920, height: 1080 } | |
- Return value
Type: Refer to the table above
If API has been run successfully: Normal value
If API has not been run successfully: undefined Type: bool
- Code example
$wp.device.getProperty(‘mac’);
getPropertyType()
- Description
Import the names of properties provided in the device interface.
| Property name | Return value |
|---|
| PLAYER_VERSION | 'player_version' |
| FIRMWARE_VERSION | 'fw_version' |
| VARIABLE_TAG | 'variable_tag' |
| MIS_IP | 'mis_ip' |
| MACADDRESS | 'mac' |
| IPADDRESS | 'ipaddress' |
| RESOLUTION | 'resolution' |
| ORIENTATION | 'orientation' |
- Syntax
function getPropertyType();
- Parameter
None
- Return value
Success: object (property name), fail: Always successful
- Code example
$wp.device.getPropertyType();
- Others
If you convert objects returned from $wp.device.getPropertyType(); to variables, typos can be prevented.
var devicePropertyType = $wp.device.getPropertyType();
$wp.device.getProperty(devicePropertyType.MACADDRESS);