webOS
The webOS API provides methods for retrieving TV-specific information and settings.
Methods of this API is compatible with methods of the webOS.js library used on the previous versions of webOS TV. If you have used methods of webOS.js to implement your app, we recommend that you replace the webOS.js library with the webOSTV.js library.
Methods
Type |
Name |
Description |
---|---|---|
Member |
Holds properties representing the build version of the webOSTV.js library. |
|
Holds properties representing the platform identification of webOS variants. |
||
Method |
Returns the device-specific information. |
|
Returns the app ID of the caller app. |
||
Returns the appinfo.json data of the caller app with a cache saved to webOS.appInfo. |
||
Returns the full URI path of the caller app. |
||
Emulates the back key of the remote controller to move backward 1 level. |
||
Returns the system-specific information. |
||
Checks whether the virtual keyboard is visible. |
||
Creates and sends a service request to the system of the webOS TV. |
-
Open
-
- deviceInfo
-
Description
Returns the device-specific information regarding the TV model, OS version, SDK version, screen size, and resolution.
Syntax
webOS.deviceInfo(devicecallback(info))
Parameters
Name
Type
Description
Required
devicecallback(info)
Function
The function to call once the information is collected.
-
info: JSON object containing the device information details
PropertiesName
Type
Description
Required
modelName
String
The model name of the device in UTF-8 format.
Yes
version
String
The full name of OS firmware version.
Yes
versionMajor
Number
The subset of OS version: Major version number.
Yes
versionMinor
Number
The subset of OS version: Minor version number.
Yes
versionDot
Number
The subset of OS version: Revision version number.
Yes
sdkVersion
String
The webOS SDK version.
Yes
screenWidth
Number
The screen width in pixels.
Yes
screenHeight
Number
The screen Height in pixels.
Yes
uhd
Boolean
Indicates whether the device supports Ultra HD resolution.
-
true: The device supports Ultra HD resolution.
-
false: The device does not support Ultra HD resolution.
Optional
uhd8K
Boolean
Indicates whether the device supports 8K UHD resolution.
-
true: The device supports 8K UHD resolution.
-
false: The device does not support 8K UHD resolution.
Optional
oled
Boolean
Indicates whether the display type of device is OLED or not.
-
true: The display type is OLED.
-
false: The display type is LCD.
On the previous version of webOS TV that does not support this property, return undefined.
Optional
ddrSize
String
The size of DDR DRAM in Bytes. For example, if the size of DDR DRAM is 3G, the return value is '3G'.
On the previous version of webOS TV that does not support this property, return undefined.
Optional
hdr10
Boolean
Indicate whether the device supports HDR10.
-
true: The device supports HDR10.
-
false: The device does not support HDR10.
Optional
dolbyVision
Boolean
Indicate whether the device supports Dolby Vision.
-
true: The device supports Dolby Vision.
-
false: The device does not support Dolby Vision.
Optional
dolbyAtmos
Boolean
Indicate whether the device supports Dolby Atmos.
-
true: The device supports Dolby Atmos.
-
false: The device does not support Dolby Atmos.
Optional
-
Yes
Call Returns
Returns undefined.
Example
webOS.deviceInfo(function (device) { if (device.modelName.indexOf('32LB') > -1) { // do something } var version = device.version.split('.'); if (Number(version[0]) > 3 || Number(device.versionMajor) > 3) { // do something if (Number(version[1]) > 2 || Number(device.versionMinor) > 2) { // do something if (Number(version[2]) > 13 || Number(device.versionDot) > 13) { // do something } } } var sdkVersion = device.sdkVersion.split('.'); if (sdkVersion[0] === '3') { // do something } if (device.screenWidth === 1920 && device.screenHeight === 1080) { // do something } if (device.uhd && device.uhd === true) { // shows UHD contents } if (device.uhd8K && device.uhd8K === true) { // shows 8K UHD contents } if (device.oled && device.oled === true) { // do something } if (device.ddrSize) { var ddrSize = device.ddrSize.split('G')[0] // do something } if (device.hdr10 && device.hdr10 === true) { // play HDR10 contents } if (device.dolbyVision && device.dolbyVision === true) { // play Dolby Vision contents } if (device.dolbyAtmos && device.dolbyAtmos === true) { // play Dolby ATMOS contents } });
See Also
-