TV.INFO
tv.info class provides device information of TV. For example, a country code, a language code that is shown UI.
Add the following line for tv.info class into a html file your own : <script type="text/javascript" src="$MANAGER_WIDGET/Common/webapi/1.0/webapis.js"></script> |
You can declare tv.info class like this : ex) var tvInfo = webapis.tv.info; |
Contents
Constants
Name | Value | Description |
TIMEZONE_USA_NEWFOUNDLAND | 0 | Time zone identifier for USA Newfoundland |
TIMEZONE_USA_ATLANTIC | 1 | Time zone identifier for USA Atlantic |
TIMEZONE_USA_EASTERN | 2 | Time zone identifier for USA Eastern |
TIMEZONE_USA_CENTRAL | 3 | Time zone identifier for USA Central |
TIMEZONE_USA_MOUNTAIN | 4 | Time zone identifier for USA Mountain |
TIMEZONE_USA_PACIFIC | 5 | Time zone identifier for USA Pacific |
TIMEZONE_USA_ALASKA | 6 | Time zone identifier for USA Alaska |
TIMEZONE_USA_HAWAII | 7 | Time zone identifier for USA Hawaii |
TIMEZONE_KOR_SEOUL | 8 | Time zone identifier for USA Seoul |
TIMEZONE_DVB_REGION_0 | 9 | DVB Time Zone Offset (Region 0) - Australia: Use in a country that does not have multiple time zones |
TIMEZONE_DVB_REGION_1 | 10 | The identifier for time zone offset DVB (Region 1) - Australia: reserved, Spain |
TIMEZONE_DVB_REGION_2 | 11 | The identifier for time zone offset DVB (Region 2) - Australia: New South Wales / ACT, Spain |
TIMEZONE_DVB_REGION_3 | 12 | The identifier for time zone offset DVB (Region 3) - Australia: Victoria |
TIMEZONE_DVB_REGION_4 | 13 | The identifier for time zone offset DVB (Region 4) - Australia: Queensland |
TIMEZONE_DVB_REGION_5 | 14 | The identifier for time zone offset DVB (Region 5) - Australia: South Australia |
TIMEZONE_DVB_REGION_6 | 15 | The identifier for time zone offset DVB (Region 6) - Australia: Western Australia |
TIMEZONE_DVB_REGION_7 | 16 | The identifier for time zone offset DVB (Region 7) - Australia: Tasmania |
TIMEZONE_DVB_REGION_8 | 17 | The identifier for time zone offset DVB (Region 8) - Australia: Northern Territory |
PRODUCT_TYPE_TV | 0 | The identifier for TV product. |
PRODUCT_TYPE_BD | 1 | The identifier for Blu-ray player product. |
PRODUCT_TYPE_MONITOR | 2 | The identifier for monitor product |
TIMEZONE_DST_ON | 1 | The identifier for Daylight Saving Time is on. |
TIMEZONE_DST_OFF | 2 | The identifier for Daylight Saving Time is off. |
TIMEZONE_DST_AUTO | 3 | The identifier for Daylight Saving Time setting is auto. |
Methods
getCountry | ||
Description | ||
This function returns the country code in which the device is located | ||
Parameters | none | |
Return | ■DOMString - Country Code | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var countryCode = deviceapis.tv.info.getCountry(); |
getLanguage | ||
Description | ||
Returns the language code in which the User Interface is displayed. | ||
Parameters | none | |
Return | ■DOMString - Language Code | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var languageCode = deviceapis.tv.info.getLanguage(); |
getDeviceID | ||
Description | ||
Gets the device id. The device ID should be unique across all devices for a given product. It is useful for unique device identification | ||
Parameters | none | |
Return | ■DOMString - Unique device ID of the device | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
console.log("Device ID is " + webapis.tv.info.getDeviceID()); |
getFirmware | ||
Description | ||
Returns the current Firmware version | ||
Parameters | none | |
Return | ■String - Model Name - format : [model code]_[region code] * LN40D7500_KOR | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var firmware = deviceapis.tv.info.getFirmware(); |
getModel | ||
Description | ||
Returns the model name of the product. | ||
Parameters | none | |
Return | ■String - Model Name - format : [model code]_[region code] * LN40D7500_KOR | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var modelName = deviceapis.tv.info.getModel(); |
getProduct | ||
Description | ||
Returns the current product type (TV or BD or Monitor) on successReturns the current product type (TV or BD or Monitor) on success | ||
Parameters | none | |
Return | ■Product Type - PRODUCT_TYPE_TV - PRODUCT_TYPE_BD - PRODUCT_TYPE_MONITOR | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var productType = deviceapis.tv.info.getProduct(); |
getVersion | ||
Description | ||
Returns the Smart HUB Version | ||
Parameters | none | |
Return | ■DOMString - SmartHub Version | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var smartHubVersion = deviceapis.tv.info.getVersion(); |
convertEpochToTime | ||
Description | ||
function converts the epoch time given in the parameter to local time and returns it in the form of a Date object. | ||
Parameters | ■epochTime - Unsigned long - The current Epoch time. Epoch time should be a positive number which is greater than zero. | |
Return | ■Date - Date object which is converted from epoch time | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var epochTime = webapis.tv.info.getEpochTime(); var date = webapis.tv.info.covertEpochToTIme(epochTime); alert(date.toUTC()); |
convertTimeToEpoch | ||
Description | ||
This function converts the Date Oject given in the parameter to epoch time | ||
Parameters | ■time - Date Object | |
Return | ■Unsigned long - EpochTime - Current Epoch Time | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var time = new Date(); var epochTime = deviceapis.tv.info.covertTimeToEpoch(time); alert("EpochTime : " + epochTime); |
getEpochTime | ||
Description | ||
Returns the current Epoch Time. | ||
Parameters | none | |
Return | ■ Number - Current Epoch Time | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var epochTime = deviceapis.tv.info.getEpochTime(); |
getTick | ||
Description | ||
Returns the current tick count. | ||
Parameters | none | |
Return | ■ Number - Current Tick Count | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var tickCount = deviceapis.tv.info.getTick(); |
getTimeZone | ||
Description | ||
Gets the information of timezone. | ||
Parameters | none | |
Return | ■TimeZone - Timezone information. | |
Emulator Support | Y | |
SDK Constraint | None | |
Example | ||
var timezone = deviceapis.tv.info.getTimeZone(); alert("time zone index :"+timezone.timezone); alert("time zone offset :"+timezone.offset); alert("time zone dst :"+timezone.dst); |