Hosted Web App
webOS TV app has two types. Packaged app is launched using the installed app resources on your webOS TV.
Hosted app is executed by URL redirection with a local dummy app and remote app resources server.
Creating hosted webOS TV web apps essentially involves the following:
- Creating a basic webOS TV web app that includes files such as index.html, appinfo.json, and the required key app assets. See Basic HTML App, Creating a Web App and Key App Assets for more details.
- Redirecting the default web page of the hosted webOS TV web app to the default web page of the web app on the remote server.
The following example shows how to redirect the hosted webOS TV web app's index.html to the index.html of the web app the remote server.
<html> <head> <meta http-equiv="refresh" content="0;url=http://www.example.com/index.html"> </head> </html>
<html> <script>location.href='http://www.example.com/index.html';</script> </html>
The default web page of the hosted webOS TV web app can be changed from index.html to any other HTML file. In order to change the default web page of the hosted webOS TV web app, modify the main property in the appinfo.json file of the hosted webOS TV web app. For more information, see appinfo.json.
You can deploy the hosted webOS TV web app on webOS TV emulator or LG Smart+ TV. See Deploying a Web App with CLI for more information.
For your understanding on the hosted app, you can download the sample code and its IPK file at the below link for free.
Result in the webOS TV Emulator
You can install the sample app and see the sample app result in the webOS TV emulator as below image.
Do's and Don'ts
- Do change the URL for your application
- Do check network connection again before testing