© 2013 Samsung Electronics Co., Ltd. All rights reserved.
This API provides the system information for a device associated with a TV.
A webapis.tv.info object that provides access to the functionality of the TV info API.
For more information on the TV Info features, see TV Info Guide.
Interface | Method |
---|---|
WebAPIsTVInfoManager | |
TimeZone | |
TVInfoManager | unsigned short getProduct() DOMString getModel() DOMString getFirmware() DOMString getVersion() DOMString getCountry() DOMString getLanguage() DOMString getDeviceID() unsigned long getTick() unsigned long getEpochTime() Date convertEpochToTime(unsigned long epoch) unsigned long convertTimeToEpoch(Date time) TimeZone getTimeZone() |
Defines what is instantiated in the webapis object.
[NoInterfaceObject] interface WebAPIsTVInfoManager { readonly attribute TVInfoManager info; };
TV implements WebAPIsTVInfoManager;
A webapis.tv.info object that provides access to the functionality of the info module.
Time zone object
[NoInterfaceObject] interface TimeZone { readonly attribute unsigned short timezone; readonly attribute long offset; readonly attribute unsigned short dst; };
var timeZoneObj = webapis.tv.info.getTimeZone(); switch (timeZoneObj.timezone) { case webapis.tv.info.TIMEZONE_USA_ATLANTIC : console.log("current time zone is atlantic, USA."); break; case webapis.tv.info.TIMEZONE_KOR_SEOUL : console.log("current time zone is seoul, Korea."); break; } console.log("time zone offset is " + timeZoneObj.offset); switch (timeZoneObj.dst) { case webapis.tv.info.TIMEZONE_DST_ON : console.log("current daylight saving time is on."); break; case webapis.tv.info.TIMEZONE_DST_OFF : console.log("current daylight saving time is off."); break; case webapis.tv.info.TIMEZONE_DST_AUTO : console.log("current daylight saving time is auto."); break; }
readonly
unsigned short timezone
Time zone.
readonly
long offset
Time zone offset value
readonly
unsigned short dst
Daylight Saving Time mode
The TVInfoManager interface provides access to the specific information for a Smart TV.
[NoInterfaceObject] interface TVInfoManager { const unsigned short TIMEZONE_USA_NEWFOUNDLAND = 0; const unsigned short TIMEZONE_USA_ATLANTIC = 1; const unsigned short TIMEZONE_USA_EASTERN = 2; const unsigned short TIMEZONE_USA_CENTRAL = 3; const unsigned short TIMEZONE_USA_MOUNTAIN = 4; const unsigned short TIMEZONE_USA_PACIFIC = 5; const unsigned short TIMEZONE_USA_ALASKA = 6; const unsigned short TIMEZONE_USA_HAWAII = 7; const unsigned short TIMEZONE_KOR_SEOUL = 8; const unsigned short TIMEZONE_DVB_REGION_0 = 9; const unsigned short TIMEZONE_DVB_REGION_1 = 10; const unsigned short TIMEZONE_DVB_REGION_2 = 11; const unsigned short TIMEZONE_DVB_REGION_3 = 12; const unsigned short TIMEZONE_DVB_REGION_4 = 13; const unsigned short TIMEZONE_DVB_REGION_5 = 14; const unsigned short TIMEZONE_DVB_REGION_6 = 15; const unsigned short TIMEZONE_DVB_REGION_7 = 16; const unsigned short TIMEZONE_DVB_REGION_8 = 17; const unsigned short PRODUCT_TYPE_TV = 0; const unsigned short PRODUCT_TYPE_BD = 1; const unsigned short PRODUCT_TYPE_MONITOR = 2; const unsigned short TIMEZONE_DST_ON = 1; const unsigned short TIMEZONE_DST_OFF = 2; const unsigned short TIMEZONE_DST_AUTO = 3; unsigned short getProduct(); DOMString getModel(); DOMString getFirmware(); DOMString getVersion(); DOMString getCountry(); DOMString getLanguage(); DOMString getDeviceID(); unsigned long getTick(); unsigned long getEpochTime(); Date convertEpochToTime(unsigned long epoch); unsigned long convertTimeToEpoch(Date time); TimeZone getTimeZone(); };
This manager interface exposes the TV System information for basic TV functions.
unsigned short TIMEZONE_USA_NEWFOUNDLAND
Time zone identifier for USA New found land
unsigned short TIMEZONE_USA_ATLANTIC
Time zone identifier for USA Atlantic
unsigned short TIMEZONE_USA_EASTERN
Time zone identifier for USA Eastern
unsigned short TIMEZONE_USA_CENTRAL
Time zone identifier for USA Central
unsigned short TIMEZONE_USA_MOUNTAIN
Time zone identifier for USA Mountain
unsigned short TIMEZONE_USA_PACIFIC
Time zone identifier for USA Pacific
unsigned short TIMEZONE_USA_ALASKA
Time zone identifier for USA Alaska
unsigned short TIMEZONE_USA_HAWAII
Time zone identifier for USA Hawaii
unsigned short TIMEZONE_KOR_SEOUL
Time zone identifier for USA Seoul
unsigned short TIMEZONE_DVB_REGION_0
The identifier for time zone offset DVB (Region 0) - Australia : Use in a country that does not have multiple time zones.
unsigned short TIMEZONE_DVB_REGION_1
The identifier for time zone offset DVB (Region 1) - Australia: reserved, Spain
unsigned short TIMEZONE_DVB_REGION_2
The identifier for time zone offset DVB (Region 2) - Australia: New South Wales / ACT, Spain
unsigned short TIMEZONE_DVB_REGION_3
The identifier for time zone offset DVB (Region 3) - Australia: Victoria
unsigned short TIMEZONE_DVB_REGION_4
The identifier for time zone offset DVB (Region 4) - Australia: Queensland
unsigned short TIMEZONE_DVB_REGION_5
The identifier for time zone offset DVB (Region 5) - Australia: South Australia
unsigned short TIMEZONE_DVB_REGION_6
The identifier for time zone offset DVB (Region 6) - Australia: Western Australia
unsigned short TIMEZONE_DVB_REGION_7
The identifier for time zone offset DVB (Region 7) - Australia: Tasmania
unsigned short TIMEZONE_DVB_REGION_8
The identifier for time zone offset DVB (Region 8) - Australia: Northern Territory
unsigned short PRODUCT_TYPE_TV
The identifier for TV product.
unsigned short PRODUCT_TYPE_BD
The identifier for Blu-ray player product.
unsigned short PRODUCT_TYPE_MONITOR
The identifier for monitor product
unsigned short TIMEZONE_DST_ON
The identifier for Daylight Saving Time is on.
unsigned short TIMEZONE_DST_OFF
The identifier for Daylight Saving Time is off.
unsigned short TIMEZONE_DST_AUTO
The identifier for Daylight Saving Time setting is auto.
getProduct
Gets the product type.
unsigned short getProduct();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
var product = webapis.tv.info.getProduct(); switch (product) { case webapis.tv.info.PRODUCT_TYPE_TV : console.log("product is a TV"); break; case webapis.tv.info.PRODUCT_TYPE_BD : console.log("product is a blue-ray player"); break; case webapis.tv.info.PRODUCT_TYPE_MONITOR : console.log("product is a monitor"); break; }
getModel
Gets the model name.
DOMString getModel();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("model name is " + webapis.tv.info.getModel());
getFirmware
Gets the firmware version.
DOMString getFirmware();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("firmware version is " + webapis.tv.info.getFirmware());
getVersion
Gets Smart Hub Version.
DOMString getVersion();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("Smart Hub version is " + webapis.tv.info.getVersion());
getCountry
Gets the country code in which device is located.
DOMString getCountry();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("country code is " + webapis.tv.info.getCountry());
getLanguage
Gets the language code.
DOMString getLanguage();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("current language is " + webapis.tv.info.getLanguage());
getDeviceID
Gets the device id. The device ID should be unique across all devices for a given product. It is useful for unique device identification.
DOMString getDeviceID();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("Device ID is " + webapis.tv.info.getDeviceID());
getTick
Gets tick count.
unsigned long getTick();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("current tick time is " + webapis.tv.info.getTick());
getEpochTime
Gets current epoch time.
unsigned long getEpochTime();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
console.log("current epoch time is " + webapis.tv.info.getEpochTime());
convertEpochToTime
Converts epoch time to time. The epoch time is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (ISO 8601: 1970-01-01T00:00:00Z)
Date convertEpochToTime(unsigned long epoch);
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
with error type InvalidValuesError if the input attributes do not contain a valid value
with error type TypeMismatchError if any of the input attributes are of the wrong type
console.log("current epoch time is " + webapis.tv.info.getEpochTime());
convertTimeToEpoch
Converts time to epoch time.
unsigned long convertTimeToEpoch(Date time);
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
with error type TypeMismatchError if any of the input attributes are of the wrong type
var date = new Date(); console.log("current epoch time is " + webapis.tv.info.convertTimeToEpoch(date));
getTimeZone
Gets a timezone information
TimeZone getTimeZone();
with error type UnknownError In the case of any other error
with error type NotSupportedError if the feature is not supported.
with error type SecurityError if this functionality is not allowed.
var timeZoneObj = webapis.tv.info.getTimeZone(); switch (timeZoneObj.timezone) { case webapis.tv.info.TIMEZONE_USA_ATLANTIC : console.log("current time zone is atlantic, USA."); break; case webapis.tv.info.TIMEZONE_KOR_SEOUL : console.log("current time zone is seoul, Korea."); break; }
module Info { [NoInterfaceObject] interface WebAPIsTVInfoManager { readonly attribute TVInfoManager info; }; TV implements WebAPIsTVInfoManager; [NoInterfaceObject] interface TimeZone { readonly attribute unsigned short timezone; readonly attribute long offset; readonly attribute unsigned short dst; }; [NoInterfaceObject] interface TVInfoManager { const unsigned short TIMEZONE_USA_NEWFOUNDLAND = 0; const unsigned short TIMEZONE_USA_ATLANTIC = 1; const unsigned short TIMEZONE_USA_EASTERN = 2; const unsigned short TIMEZONE_USA_CENTRAL = 3; const unsigned short TIMEZONE_USA_MOUNTAIN = 4; const unsigned short TIMEZONE_USA_PACIFIC = 5; const unsigned short TIMEZONE_USA_ALASKA = 6; const unsigned short TIMEZONE_USA_HAWAII = 7; const unsigned short TIMEZONE_KOR_SEOUL = 8; const unsigned short TIMEZONE_DVB_REGION_0 = 9; const unsigned short TIMEZONE_DVB_REGION_1 = 10; const unsigned short TIMEZONE_DVB_REGION_2 = 11; const unsigned short TIMEZONE_DVB_REGION_3 = 12; const unsigned short TIMEZONE_DVB_REGION_4 = 13; const unsigned short TIMEZONE_DVB_REGION_5 = 14; const unsigned short TIMEZONE_DVB_REGION_6 = 15; const unsigned short TIMEZONE_DVB_REGION_7 = 16; const unsigned short TIMEZONE_DVB_REGION_8 = 17; const unsigned short PRODUCT_TYPE_TV = 0; const unsigned short PRODUCT_TYPE_BD = 1; const unsigned short PRODUCT_TYPE_MONITOR = 2; const unsigned short TIMEZONE_DST_ON = 1; const unsigned short TIMEZONE_DST_OFF = 2; const unsigned short TIMEZONE_DST_AUTO = 3; unsigned short getProduct(); DOMString getModel(); DOMString getFirmware(); DOMString getVersion(); DOMString getCountry(); DOMString getLanguage(); DOMString getDeviceID(); unsigned long getTick(); unsigned long getEpochTime(); Date convertEpochToTime(unsigned long epoch); unsigned long convertTimeToEpoch(Date time); TimeZone getTimeZone(); }; };