MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

Firefox OS for TV での hello world の例

この記事では、シンプルな hello world の例を紹介し、TVアプリを作って、シミュレータでテストするのがどんなに簡単なのかをお見せします。この記事では WebIDE を使って行きます。

hello world を作成する

Let's build up a test app.

  1. To open the WebIDE in Firefox Desktop, select Tools > Web Developer > WebIDE from the main menu:

  2. Now click Open App in the upper-left corner of WebIDE and choose New App… from the menu:

  3. Select HelloWorld, enter the Project Name and click OK:

  4. After specifying the directory to save the project in, WebIDE generates an app for you containing simple template code:

  5. Now you can program your app directly within WebIDE, or use any other editor that you prefer to edit your code.

TV でアプリを実行する

If you have a Panasonic VIERA Firefox OS TV, you can find out how to run your apps on the TV via WebIDE by reading How to connect WebIDE to TV (VIErA CX/CR series). If not, read on.

  1. Follow the instructions in Simulating Firefox OS for TV on your desktop to launch the TV environment inside the Firefox OS simulator.
  2. If you are using the available Firefox 2.6 simulator, simply skip to step 5. If you are using your own custom build, read on.
  3. In WebIDE, click Select Runtime in the upper-right corner then select Remote Runtime from the menu.
  4. Enter localhost:6000 in the dialog box and click OK:
  5. Click the Install and Run icon (the "Play" icon) in the WebIDE. You should now see your app running inside the Firefox OS Simulator:
  6. Click the Debug App icon (the "Tool" icon) in WebIDE to debug your app directly on the simulator using the DevTools Toolbox:

Note: Find out more about debugging your apps by reading Debugging apps.

次に移動する場所

Building web apps for TV mostly requires the same skills as building web apps generally; there are a few extra considerations to bear in mind, which are discussed in other articles linked from our TVs and connected devices page.

In terms of getting inspiration from existing apps, your can look at the apps that come with Gaia. Gaia 2.1 and above contains facilities for running on TV, and you can find apps for smart TVs in the gaia/tv_apps directory. smart-home and app-deck are good apps to use as starter templates for your own apps, or to get ideas and inspiration from.

ドキュメントのタグと貢献者

 このページの貢献者: chrisdavidmills, hamasaki, Uemmra3
 最終更新者: chrisdavidmills,