top

SF.SERVICE

** This class will not be supported in 2015.

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


This class defines the functions for the TV control. For more information on the class features, see Service API (Core).

Add the following line for sf.service 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.service class like this :

  ex) var service = sf.service;


Methods

checkAppInstalled

Description
This function checks the App is installed or not.
Parameters
■appid
  - String
  - Application ID to check
■callback
  - Function
  - callback function of this operation.
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.checkAppInstalled('123456', function (binstalled) {
    binstalled ? alert('the application is installed') : alert('the application is not installed');

hideSetting

Description
This function hides Picture/Sound setting popup.
Parameters
none
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.showSetting(1);
setTimeout(function () {
    sf.service.hideSetting();
}, 5000);  // hides the menu after 5 seconds

setChannelControl

Description
This function enables or disables the TV channel control. The source must be the TV and not Media or computer.
Parameters
■enable/disable 
  - Boolean
  - Enables or disables the TV channel control
  - [default: disabled]
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.setChannelControl(true); // Enables the default channel control.

setScreenSaver

Description
This function enables or disables the screen saver.
Parameters
■enable/disable 
  - Boolean
  - Enables or disables the screen saver. The screen saver time varies with the product type (LCD/PDP/BDP and so on).
  - [default: enabled]
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.setScreenSaver(true); // Enables the ScreenSaver.

setVolumeControl

Description
This function enables or disables the TV volume control.
Parameters
■enable/disable 
  - Boolean
  - [default: disabled] Enables or disables the TV volume control
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.setVolumeControl(true); // Enables the default volume control.

showSetting

Description
This function shows Picture/Sound setting popup.
Parameters
■mode
  - Number
  - 0: Sound setting, 1: Picture setting
    * callback (function) Function to be called when the popup is closed.
Return■Void
Emulator SupportN
SDK ConstraintNone
Example
sf.service.showSetting(0); // Shows the Sound Setting of OSD menu