top

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;


Constants

NameValueDescription
TIMEZONE_USA_NEWFOUNDLAND 0Time zone identifier for USA Newfoundland
TIMEZONE_USA_ATLANTIC 1Time zone identifier for USA Atlantic
TIMEZONE_USA_EASTERN2Time zone identifier for USA Eastern
TIMEZONE_USA_CENTRAL3Time zone identifier for USA Central
TIMEZONE_USA_MOUNTAIN4Time zone identifier for USA Mountain
TIMEZONE_USA_PACIFIC5Time zone identifier for USA Pacific
TIMEZONE_USA_ALASKA6Time zone identifier for USA Alaska
TIMEZONE_USA_HAWAII7Time zone identifier for USA Hawaii
TIMEZONE_KOR_SEOUL8Time zone identifier for USA Seoul
TIMEZONE_DVB_REGION_09DVB Time Zone Offset (Region 0) - Australia: Use in a country that does not have multiple time zones
TIMEZONE_DVB_REGION_110The identifier for time zone offset DVB (Region 1) - Australia: reserved, Spain
TIMEZONE_DVB_REGION_2 11The identifier for time zone offset DVB (Region 2) - Australia: New South Wales / ACT, Spain
TIMEZONE_DVB_REGION_312The identifier for time zone offset DVB (Region 3) - Australia: Victoria
TIMEZONE_DVB_REGION_413The identifier for time zone offset DVB (Region 4) - Australia: Queensland
TIMEZONE_DVB_REGION_514The identifier for time zone offset DVB (Region 5) - Australia: South Australia
TIMEZONE_DVB_REGION_615The identifier for time zone offset DVB (Region 6) - Australia: Western Australia
TIMEZONE_DVB_REGION_716The identifier for time zone offset DVB (Region 7) - Australia: Tasmania
TIMEZONE_DVB_REGION_817The identifier for time zone offset DVB (Region 8) - Australia: Northern Territory
PRODUCT_TYPE_TV 0The identifier for TV product.
PRODUCT_TYPE_BD 1The identifier for Blu-ray player product.
PRODUCT_TYPE_MONITOR 2The identifier for monitor product
TIMEZONE_DST_ON 1The identifier for Daylight Saving Time is on.
TIMEZONE_DST_OFF 2The identifier for Daylight Saving Time is off.
TIMEZONE_DST_AUTO3The 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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
Example
var productType = deviceapis.tv.info.getProduct();

getVersion

Description
Returns the Smart HUB Version
Parameters
none
Return■DOMString
  - SmartHub Version
Emulator SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
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 SupportY
SDK ConstraintNone
Example
var epochTime = deviceapis.tv.info.getEpochTime();

getTick

Description
Returns the current tick count.
Parameters
none
Return■ Number
  - Current Tick Count
Emulator SupportY
SDK ConstraintNone
Example
var tickCount = deviceapis.tv.info.getTick();

getTimeZone

Description
Gets the information of timezone.
Parameters
none
Return■TimeZone
  - Timezone information.
Emulator SupportY
SDK ConstraintNone
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);