Configuration

Dependencies

Dana builds for WebOS are browser-based, therefore no specific WebOS renderers exists in the framework. Instead, Lightning or CSS renderers must be imported (depending on your device capabilities and performances). In addition, a specific WebOS vendor should be used to communicate with specific System APIs.

The following dependencies must be added in your package.json:

"devDependencies": {
    "@dana/vendor-webos-lightning": "7.xx", // or "@dana/vendor-webos-css": "7.xx",
    "@dana/tools-smarttv-grunt": "7.xx"
}

Profile

To create a WebOS profile, all necessary vendors and a specific device configuration must be added in your app.config.json:

"base-webos": {
    "vendors": [
        "@dana/vendor-webos-lightning", // or @dana/vendor-webos-css
    ],
    "device": {
        "type": "webos",
        "appId": "com.wiztivi.ui",
        "appVendor": "Wiztivi",
        "appTitle": "Dana UI",
        "icon": "images/1080p/components/logo/wiztivi.png",
        "largeIcon": "images/1080p/components/logo/wiztivi.png",
        "disableBackHistoryAPI": true
    }
}
  • type: must be "webos"
  • appId: id of the app that will run on the lg device (eg: "com.yourname.ui")
  • appVendor: who the app is developed for ? (your company or customer name)
  • appTitle: App title displayed on store and WebOS devices
  • icon / largeIcon: path to a local image , it will be used by the TV to show the app in the menu (can be the same image)
  • disableBackHistoryAPI: true if your app handles the back button manually.

More information here: WebOS appinfo.json.

Template

During the first build, a new file will be copied in your templates directory: appinfo.json.tpl. This file aims at configuring an app when deploying it to WebOS device. This is important to keep it and version it.

This file can be kept as it is and will be completed at build time with the information given in your profile.

Additional configuration can be added according to this documentation: WebOS appinfo.json.

Index.html

In order to communicate with the WebOS APIs, a specific JS library needs to be included at runtime.

Please, add the following line in both files index.html.tpl and remoteHttpIndex.html.tpl:

<% if(globalOptions.isWebOS) { %><script type="text/javascript" src="<%= globalOptions.srcDir %>/WebOSTV.js"></script><% } %>