# Namespace hcap.preloadedApplication

hcap.preloadedApplication

- Defined in: hcap-1.24.6.5901.js

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| hcap.preloadedApplication

## Method Summary

## Namespace Detail

hcap.preloadedApplication

## Method Detail

- <static> hcap.preloadedApplication.destroyPreloadedApplication(param)
  Terminates the preloaded application.

      hcap.preloadedApplication.destroyPreloadedApplication({
           "id" : "15265",
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {String} param.id - preloaded application id to destroy (0 ~ 2^64 - 1).
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function()
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.19.0
  See:
    hcap.preloadedApplication.getPreloadedApplicationList()
    hcap.preloadedApplication.launchPreloadedApplication()
- <static> hcap.preloadedApplication.getPreloadedApplicationList(param)
  Gets the preloaded application list.

      hcap.preloadedApplication.getPreloadedApplicationList({
           "onSuccess" : function(s) {
               console.log("onSuccess : list length = " + s.list.length);
               for (var i = 0; i < s.list.length; i++) {
                   console.log(
                       "list[" + i + "].id = " + s.list[i].id +
                       "list[" + i + "].title = " + s.list[i].title +
                       "list[" + i + "].iconFilePath = " + s.list[i].iconFilePath
                   );
               }
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function (param)
                // {Array} param.list - preloaded application list supported by TV.
                //         {String} param.list[].id - preloaded application id (0 ~ 2^64 - 1)
                //         {String} param.list[].title - preloaded application title
                //         {String} param.list[].iconFilePath - file path of icon for the preloaded application
                //                 param.list example -
                //                     "list" :  [
                //                     { "id" : "13324", "title" : "YouTube", "iconFilePath" : "/icon/youtube.png" },
                //                     { "id" : "15265", "title" : "Facebook", "iconFilePath" : "/icon/facebook.png" }
                //                     ]
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.5.0
  See:
    hcap.preloadedApplication.launchPreloadedApplication()
    hcap.preloadedApplication.destroyPreloadedApplication()
- <static> hcap.preloadedApplication.launchPreloadedApplication(param)
  Launches a preloaded application.
  Following table specifies preloaded applications, their ids and parameters. (Supported preloaded applications are different according to TV model, but App IDs of preloaded applications should be same)

  Application | id | parameters
  --- | --- | ---
  3 Cats | 244115188075859005 |
  AccuWeather | 144115188075855876 |
  Amazon | 144115188075859015 |
  Arirang TV | 144115188075859001 |
  AR-Browser | 201604201053010001 | "{'params':{ 'target':string, // launch url ex) 'http://url.com/adc3f' 'noiframe':string // This parameter is required when using 'target'. For security reasons, hotel TV is not allowed to use iframe. 'true': disable iframe, 'false': enable iframe }, 'appDesc':{ 'resolution':string, // ex) 'resolution':'1920x1080' or 'resolution':'1280x720' 'disableBackHistoryAPI':string, // 'true': The BACK key will be passed to CP App, 'false': The BACK key will be handled by webOS system browser for History Back operation 'vendorExtension':{'enableKeyboard':string} // 'true': The screen keyboard will be shown up when the input or textarea tag get focus, 'false': disable screen keyboard }}"
  Balda | 144115188075859004 |
  BBC-iPlayer | 201604021129030008 |
  BBC-Sports | 201609281937030001 |
  BBC-News | 201609281937030002 |
  Bluetooth Sound Sync | 244115188075859015 |
  Browser | 144115188075855877 | "{'params':{ 'target':string, // url string. default is empty. ex) 'www.lge.com' 'fullMode':string, // full mode. default is 'false'. 'true' : full page mode, 'false' : general web browser mode 'newtab':string // default is 'true'. 'true' : new page is loaded on the new tab, 'false' : new page is loaded on the current tab. }}"
  Color Bridge | 244115188075859012 |
  Crackle | 144115188075859014 |
  Cutter Pillars | 244115188075859011 |
  External Connector | 244115188075859007 |
  Facebook | 144115188075855874 |
  Google Maps | 144115188075855875 |
  Gravity Ball | 244115188075859009 |
  Hulu | 144115188075859017 |
  K-Browser | 244115188075859021 | "{'params':{ 'target':string, // launch url ex) 'http://url.com/adc3f' 'noiframe':string // This parameter is required when using 'target'. For security reasons, hotel TV is not allowed to use iframe. 'true': disable iframe, 'false': enable iframe }, 'appDesc':{ 'resolution':string, // ex) 'resolution':'1920x1080' or 'resolution':'1280x720' 'disableBackHistoryAPI':string, // 'true': The BACK key will be passed to CP App, 'false': The BACK key will be handled by webOS system browser for History Back operation 'vendorExtension':{'enableKeyboard':string} // 'true': The screen keyboard will be shown up when the input or textarea tag get focus, 'false': disable screen keyboard }}"
  Mainstream | 244115188075859010 |
  Mobile Connector | 244115188075859006 |
  Netflix | 244115188075859013 |
  NK-Browser | 244115188075859022 | "{'params':{ 'target':string, // launch url ex) 'http://url.com/adc3f' 'noiframe':string // This parameter is required when using 'target'. For security reasons, hotel TV is not allowed to use iframe. 'true': disable iframe, 'false': enable iframe }, 'appDesc':{ 'resolution':string, // ex) 'resolution':'1920x1080' or 'resolution':'1280x720' 'disableBackHistoryAPI':string, // 'true': The BACK key will be passed to CP App, 'false': The BACK key will be handled by webOS system browser for History Back operation 'vendorExtension':{'enableKeyboard':string} // 'true': The screen keyboard will be shown up when the input or textarea tag get focus, 'false': disable screen keyboard }}"
  PC Connector | 244115188075859008 |
  Picasa | 144115188075859003 |
  Rhapsody | 144115188075859018 |
  Screen Share | 144115188075855880 |
  Skype | 144115188075855878 |
  SmartShare | 144115188075855882 |
  Tanks | 144115188075859005 |
  The Associated Press | 144115188075859011 |
  TV Hockey | 244115188075859004 |
  Twitter | 144115188075855873 |
  Ustream | 144115188075859012 |
  vTuner | 144115188075859000 |
  Wasu(TV) | 244115188075859014 |
  Wasu(DRAMA) | 244115188075859016 |
  Wasu(ENTERTAINMENT) | 244115188075859017 |
  Wasu(HD) | 244115188075859018 |
  Wasu(MOVIE) | 244115188075859019 |
  Wasu(SPORTS) | 244115188075859020 |
  YouTube | 144115188075859002 |

      hcap.preloadedApplication.launchPreloadedApplication({
           "id" : "244115188075859022", // NK-Browser
           "parameters" : "{
               'target':'http://www.lge.com'
           }",
           "onSuccess" : function() {
               console.log("onSuccess");
           },
           "onFailure" : function(f) {
               console.log("onFailure : errorMessage = " + f.errorMessage);
           }
      });

  Parameters:
  {Object} param
    - {String} param.id - preloaded application id to launch (0 ~ 2^64 - 1).
    - {String} param.parameters [Optional] - parameters in JSON type string for the preloaded application to be launched.
    - {Function} param.onSuccess [Optional] - success callback function.

            param.onSuccess = function()
                // No Parameter.
            }

    - {Function} param.onFailure [Optional] - failure callback function.

            param.onFailure = function (param) {
                // {String} param.errorMessage - in case of failure, this message provides the details.
            }

  Since:
    1.5.0
  See:
    hcap.preloadedApplication.getPreloadedApplicationList()
    hcap.preloadedApplication.destroyPreloadedApplication()