The JavaScript TV API provides access to Platform objects through a generated JavaScript wrapper interface.
The TVSystem object enables the apps to directly interact with the device hardware and get system specific information. Most functions
are read-only.
When using the Simulator, the TV API porting layer has been implemented to emulate the TV device on the app developer's PC
using a local properties file.
The TVSystem properties which would normally come from the partner's device are stored in the file $HOME/YCTV-ADK/YCTV-SIM-XXX/TVSystemProperties.txt so
that app developers can test these properties without the TV device. This file is only used in conjunction with the Simulator.
Certain tv.system properties are also provided by the specialSettings.get() function. Yahoo! recommends that app developers use the
specialSettings.get() function in lieu of the tv.system properties when available. These include:
Properties
Properties returned from the specialSettings.get() function. Be sure to test for valid values. Not all properties are implemented by all device partners.
|
Property |
Type |
Description |
|---|---|---|
|
|
|
Returns the two character continent code ('AF' for Africa, 'AS' for Asia, 'EU' for Europe, 'NA' for North America, 'SA' for South America, 'OC' for Oceania, and 'AN' for Antarctica) obtained from the user of the device. |
|
|
|
Returns the two character country code (ISO 3166) obtained from the user of the device. |
|
|
|
Returns the five character postal/zip code integer where the device is located. Obtained from the user of the device. The code is interpreted by country. |
|
|
|
Returns the time zone code blob. Obtained from the user of the device. For example, |
You can use the tv.system global namespace to acces the device hardware interface for apps. Be sure to test for valid values. Not all properties are implemented by all device partners.
The TVSystem object is found in the global TVMasterControl object.
Example
The aspect ratio of the display.
|
Name |
Description |
|---|---|
|
|
The aspect is not available. |
|
|
The aspect is not defined. |
|
|
The video aspect ratio is square. |
|
|
The video aspect ration is standard video or 4x3. |
|
|
The video aspect ration is widescreen or 16x9. |
Specifies the type of the display. This information is often used by apps for determining capabilities for screensavers.
|
Name |
Description |
|---|---|
|
|
The display type is not available. |
|
|
The display type is |
|
|
The display type is |
|
|
The display type is |
|
|
The display type is |
|
|
The display type is not defined by this list. |
V-chips read information encoded in the rated program and block programs from the device based upon the selected rating. This status indicates the availability and status of a V-Chip in the device.
|
Name |
Description |
|---|---|
|
|
The device is not equipped with the VChip. |
|
|
The VChip control has been enabled by the user. |
|
|
The VChip control has not been enabled by the user. |
Indicates the status of the device's connection to the network.
|
Name |
Description |
|---|---|
|
|
The network status is not available. |
|
|
The network is disconnected. No uplink and no associated wireless network is available. |
|
|
The network status is connected. The uplink is available. |
Properties
|
Property |
Type |
Description |
|---|---|---|
|
|
|
The name of the Device Partner or Original Equipment Manufacturer (OEM) returns an empty string if not available. It can be used for device partner identification and specific customizations. |
|
|
|
Returns a basic short description of the device provided by the device partner, returns an empty string if not available. |
|
|
|
Device partner determined device ID. The ID should be unique across all devices for a given device partner, returns and empty string if not available. It is useful for unique device identification. |
|
|
|
Device partner determined device version number, returns and empty string if not available. It is useful for device/version specific customizations. |
|
|
|
Device partner software version. Returns an empty string if not available. It is useful for software specific customizations. |
|
|
|
Returns the clock time (in seconds since 1970). This function returns the real time acquired from time data sent by the guide tables, which may differ from time returned by the OS. Returns the OS time, if guide specified time is not available. |
|
|
|
Returns the current aspect ratio constant (e.g. |
|
|
|
Returns the language tag (IETF BCP 47) in which the user interface will be displayed (for example “es-MX” for Mexican Spanish and “fr-CA” for Canadian French). This property may not be implemented by all device partners. |
|
|
|
Returns the country code (ISO 3166) in which the device is located, returns an empty string when not available. Country is
obtained from the user of the device. This property may not be implemented by all device partners.
Use the |
|
|
|
Returns a string that specifies the device model as defined by the device partner. Returns an empty string when not available. |
|
|
|
Returns a string that specifies the device class as defined by the device partner (e.g. Large Screen, Small Screen). Returns an empty string when not available. |
|
|
|
Returns a string with the brand name (e.g. PAVV, Scientific Atlanta). Returns an empty string when not available. |
|
|
|
Returns a string with the available network interfaces. The string is a list of strings separated by ampersands (e.g. |
|
|
|
Returns a string with the signal strength value within the range 0 to 100. Decimal points are not supported. Returns an empty string when not available. |
|
|
|
Returns the display type of the TV. Display type values are defined constants. |
|
|
|
Returns the current status of the VChip. VChip status types are defined constants. |
|
|
|
Returns the TV rating system string (e.g. US TV RATINGS). The valid list of TV rating system strings is defined in a configuration file. Returns an empty string when not available. The setting of the VChip rating is performed by a device partner specific API and is not exposed to apps. |
|
|
|
Postal/zip code string where the device is located. The code is interpreted by country. Returns an empty string if not available.
This property may not be implemented by all device partners.
Use the |
|
|
|
Returns a generic string that specifies device specific name-value pairs. The format is:
The names/values are device partner specific. The maximum number of characters in the string is 256. Returns an empty string when not available. |
|
|
|
Current state and previous state of the device's power status. |
|
|
|
Callback function triggered when aspect ratio changes. |
|
|
|
Callback function triggered when menu language has changed. |