top

SF.ENV

** This class will not be supported in 2015.

   All functionalities of sf.env class are more improved, integrating with CAPH. Therefore sf.env class is not supported since 2015 Smart TV. To use functions of sf.env class, refer to here.


This class defines the environment functions.

Add the following line for sf.env class into a html file your own :

  script type="text/javascript" src="$MANAGER_WIDGET/Common/af/2.0.0/loader.js">/script>

You can declare sf.env class like this :

  ex) var env = sf.env;


Methods

getAppVersion

Description
This function returns current application version.
Parameters
none
Return■String
  - Appliction version defined in config.xml.
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
  "App Version:  + sf.env.getAppVersion()
);

getBrowser

Description
This function returns current browser information.
Parameters
none
Return■String
  - current browser information
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
  "Browser:  + sf.env.getBrowser() 
 );

getCountryCode

Description
This function returns the product type.
Parameters
none
Return■String
  - indicates current country setting 
   * (e.g) 'kr’, ‘us’, ‘uk’, ‘fr’, ‘it’
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
 "Country Code: " + sf.env.getCountryCode()
 );

getFirmwareVer

Description
This function returns current firmware version.
Parameters
none
Return■Object
  - indicates firmware version. 
  - The example of the object is as follows:
   * version: 'T-INFOLINK2012-1000',
   * year: '2012',
   * num: '1000'
Emulator SupportN
SDK ConstraintNone
Example
var firmware = sf.env.getFirmwareVer();

getGestureRecogAvailable

Description
This fuction checks gesture recognition is available on the device or not and returns the result.
Parameters
none
Return■Boolean
  - true : gesture recognition is available
  - false : gesture recognition is not available
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Gesture recognition available : " + sf.env.getGestureRecogAvailable()
 );

getLanguageCode

Description
This function returns current language setting.
Parameters
none
Return■String
  - indicates current language setting 
   * (e.g) ‘en’, ‘en-GB’, ‘fr’, ‘it’, ‘ko’
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Language Code: " + sf.env.getLanguageCode()
 );

getModelID

Description
This function returns model ID.
Parameters
none
Return■String
  - model ID
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Model ID: " + (sf.env.getModelID() || "Unknown")
 );

getMouseEventAvailable

Description
This function checks mouse event is available on the device or not and returns the result.
Parameters
none
Return■Boolean
  - true : mouse is available
  - false : mouse is not available
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Mouse event available and supported : " + sf.env.getMouseEventAvailable()
 );

getPopupOpacity

Description
This function returns popup opacity.
Parameters
none
Return■String
  - popup opacity
Emulator SupportN
SDK ConstraintNone
Example
var opacity = sf.env.getPopupOpacity();

getProductType

Description
This function returns the product type.
Parameters
none
Return■Number
  - indicates the product type.
   * sf.env.PRODUCTTYPE_TV : TV
   * sf.env.PRODUCTTYPE_MONITOR : Monitor (with TV)
   * sf.env.PRODUCTTYPE_BD : Blu-ray disc player, Home theater system, PVR.
Emulator SupportN
SDK ConstraintNone
Example
var producttype = productMap[sf.env.getProductType()];

getResolution

Description
This function returns current resolution of screen.
Parameters
none
Return■String
  - indicates resolution 
   * (e.g) ‘540p’, ‘720p’, ‘1080p’
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Resolution: " + sf.env.getResolution()
 );

getScreenSize

Description
This function returns current resolution of screen.
Parameters
none
Return■String
  - Contains size of screen. 
  - The example of the object is as follows:
   * width: 960,
   * height: 540
Emulator SupportN
SDK ConstraintNone
Example
var screensize = sf.env.getScreenSize();

getTargetLocation

Description
This function returns Target(TV) location.
Parameters
none
Return■Number
  - Target location enumeration number.
Emulator SupportN
SDK ConstraintNone
Example
var target = sf.env.getTargetLocation();
if(target === sf.env.TARGETLOCATION_USA) {
    // TV for US
}

getVoiceRecogAvailable

Description
This function checks voice recognition is available on the device or not and returns the result.
Parameters
none
Return■Boolean
  - true : voice recognition is available
  - false : voice recognition is not available
Emulator SupportN
SDK ConstraintNone
Example
$("#EnvInfos").html(""+       
"Voice recognition available : " + sf.env.getVoiceRecogAvailable()
 );