top

CAPH.PLATFORM.DTV.WIDGET

Widget is an object which provides various kinds of methods related to WidgetEngine. The main APIs of Widget are 'setReady', 'setExit' and 'jumpToSamsungApps.' Using Widget.setReady(), a user can send 'ready' message to WidgetEngine. Using Widget.setExit(), a user can exit the application and return to Smart Hub or TV's main screen. Also, using Widget, a user can Samsung Apps screen of the application.


Methods

jumpToSamsungApps

Description
Jump to Samsung Apps for specified application page.
Parameters
■options
  - Object
  - An object that contains
   * Object : options Options for jumping to Samsung Apps
   * String : options.appid Application ID to be shown at the Samsung Apps page
   * String : options.category Application Category to be shown at the Samsung Apps page
   * String : (options.returnparam="") Parameter to be passed to the application after installing in Samsung Apps page.
Return■Void
Emulator SupportY
SDK Constraintnone
Example
// Let's say that FACEBOOK_APP_ID and FACEBOOK_APP_CATEGORY are given.
caph.platform.dtv.Widget.jumpToSamsungApps({
    appid: FACEBOOK_APP_ID,
    category: FACEBOOK_APP_CATEGORY
});

setExit

Description
Sends exit event. Appication is ended and returns to TV or SmartHub.
Parameters
■bEsc
  - Boolean
   * true : application will end and return to TV. 
   * false : application will end and return to SmartHub. 
  - [default: false]
Return■Void
Emulator SupportY
SDK Constraintnone
Example
caph.platform.dtv.Widget.setExit(false);

setReady

Description
Sets the preference of current widget for ready.
Parameters
■Void
Return■Void
Emulator SupportY
SDK Constraintnone
Example
caph.platform.dtv.Widget.setReady();