firefox os
One of my responsibilities in my new role in Partner Engineering at Mozilla is testing HTML5-powered apps and games on Panasonic televisions. The television in my office, a beautiful 60" 4K Ultra HD beast, is the perfect device for the job. But how do I get the app from my local computer to the television for testing? This blog post will walk you through the process of testing your HTML5 app on Firefox OS-powered televisions.
在Mozilla合作伙伴工程部门担任新职务时,我的职责之一是在松下电视上测试基于HTML5的应用和游戏。 我办公室的电视是一台漂亮的60英寸4K Ultra HD野兽,是完成这项工作的完美设备。但是,如何将应用程序从本地计算机下载到电视上进行测试?这篇博客文章将引导您完成以下过程:在基于Firefox OS的电视上测试HTML5应用。
It's important to note before we get started that using the browser app to view a URL isn't the same, as the app isn't in "highlight mode" and the browser chrome takes up real estate.
在开始之前,请务必注意,使用浏览器应用程序查看URL并不相同,因为该应用程序未处于“突出显示模式”,并且浏览器镶边占用了资源。
步骤1:使用Firefox Web Developer WebIDE连接到电视 (Step 1: Use the Firefox Web Developer WebIDE to Connect to Television)
Firefox's awesome Developer Tools provides a WebIDE which features a "Remote Runtime" functionality. This remote runtime allows you to connect your desktop computer to your Firefox OS television via IP. I wont repeat the documentation on how to do connect to the TV, I'll instead point you to this article on MDN: How to connect WebIDE to TV. The article on MDN walks you through, with screenshots, how to connect to the TV.
Firefox强大的开发人员工具提供了一个WebIDE,该WebIDE具有“远程运行时”功能。 这个远程运行时允许您通过IP将台式计算机连接到Firefox OS电视。 我不会重复有关如何连接到电视的文档,而是将您指向MDN上的这篇文章: 如何将WebIDE连接到电视 。 MDN上的文章通过屏幕截图引导您如何连接电视。
步骤2:将应用程序作为打包的应用程序侧载 (Step 2: Sideload the App as a Packaged App)
Firefox OS TVs only allow for "hosted" apps (you provide a URL where the app lives) and not "packaged" apps (a .zip file with all of the app's assets), however to test your app on the TV, you'll need to load the app a packaged app within the WebIDE. Weird, right? The packaged app will be incredibly simple and I'll even provide you the template:
Firefox OS电视仅允许“托管”应用程序(您提供应用程序所在的URL),而不允许“打包”应用程序(包含所有应用程序资产的.zip文件),但是要在电视上测试您的应用程序,将需要在WebIDE中将应用程序加载为打包的应用程序。 奇怪吧? 打包的应用程序将非常简单,我什至为您提供模板:
You only need to make a few changes:
您只需要进行一些更改:
-
Open
app.js
and change the window.location address to the address of your hosted app打开
app.js
并将window.location地址更改为托管应用程序的地址 -
Open
webapp.manifest
and provide an app name as you'd like it to appear on the TV打开
webapp.manifest
并提供您想要在电视上显示的应用名称
That's all you need to do, though you may also want to also provide a real app icon image.
这就是您需要做的,尽管您可能还想提供一个真实的应用程序图标图像。
With the packaged app in place, and assuming you've connected the WebIDE Remote Runtime to the TV, click "Open Packaged App..." and select your app directory. You'll see the information loaded like this:
在打包的应用程序就位的情况下,并假设您已将WebIDE远程运行时连接到电视,请单击“打开打包的应用程序...”,然后选择您的应用程序目录。 您将看到这样加载的信息:
Once the app information has loaded in WebIDE, you can click the "play" icon to "push" the app to your TV. The app will instantly launch on the television when you press the play icon. If you go to the Firefox OS home screen for the TV, you will see the app name and icon; you can open the app on the TV from that point forward. If you make changes to the app, simple press the "play" icon again and the app will be re-installed on your TV!
将应用程序信息加载到WebIDE中后,您可以单击“播放”图标以将应用程序“推送”到电视上。 按下播放图标时,该应用程序将立即在电视上启动。 如果转到电视的Firefox OS主屏幕,则会看到应用程序名称和图标。 您可以从那时开始在电视上打开该应用。 如果您对应用程序进行了更改,只需再次按“播放”图标,该应用程序就会重新安装在电视上!
firefox os