简体   繁体   English

转换三星智能电视应用程序以在浏览器中工作

[英]Transform Samsung smart TV app to work in browser

We have the package of an app built for a Samsung SmartTV. 我们具有为Samsung SmartTV构建的应用程序包。 Since we need to preview the app and for some reason we cannot install the emulator on workplace computers we thought of transforming the app in a proper web app to be run in the browser. 由于我们需要预览应用程序,并且由于某种原因我们无法在工作场所计算机上安装模拟器,因此我们考虑将应用程序转换为可在浏览器中运行的适当Web应用程序。

I noticed from the code that this should not be impossible. 我从代码中注意到,这并非不可能。 Just some functions should be disabled and mouse and keywords should work instead of remote. 仅应禁用某些功能,并且鼠标和关键字应起作用而不是远程起作用。

But converting it manually it's a troublesome work. 但是手动转换它是一项麻烦的工作。

We were therefore wondering if there is some kit that wraps the samsung API and let the app work on a browser with minor changes. 因此,我们想知道是否存在一些用于包装三星API的工具包,并允许该应用程序在浏览器中进行较小的更改。

Thanks 谢谢

If you want your app start work in browser - i recommend manual refactor your code to works in browser. 如果您希望您的应用在浏览器中开始工作-我建议手动重构您的代码以使其在浏览器中工作。 Use "try catch" where you call samsung api. 在您称为三星api的地方使用“ try catch”。 Like that: 像那样:

$(document).ready(function () {

    var widgetAPI;

    try {

        widgetAPI = new Common.API.Widget();
        widgetAPI.sendReadyEvent();

    } catch (e) {

        // do something in browser version
    }

    Backbone.history.start();
});

And you can use CSS pseudo classes like :hover. 您可以使用CSS伪类,例如:hover。 Don't forget, that apps working with 1280x720px default resolutions, but browser works in different resolution. 别忘了,这些应用程序的默认分辨率为1280x720px,但浏览器的分辨率却不同。

I have not seen any snippet for this. 我还没有看到任何摘要。 But basicaly you should: 但基本上,您应该:

  1. Remap keyCode in keydown events (Samsung's keyCode's different from browsers) 在keydown事件中重新映射keyCode(三星的keyCode与浏览器不同)
  2. Make placeholder objects for Samsung's Common.API.Widget and Common.API.Plugin 为三星的Common.API.WidgetCommon.API.Plugin占位符对象

If you use player object, it will not work in browser. 如果使用播放器对象,它将无法在浏览器中使用。

If your app uses Samsung UI Framework elements, not sure if it can be launched in browser. 如果您的应用程序使用Samsung UI Framework元素,则不确定是否可以在浏览器中启动它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM