Samsung Smart TV Html5 App Sample (Real App)

Michel Borges picture Michel Borges · Nov 6, 2012 · Viewed 7.6k times · Source

I'm looking for an real application for Samsung Smart Tv using html5 + javascript + plugins.

I found BrightCove and some examples on Samsung forum but they have only one page or are working with Scene.

I would like to know:

1) Ho to navigate between pages, parameters, etc; 2) What patterns and frameworks can be used;

Thanks.

Answer

Adam Lukaszczyk picture Adam Lukaszczyk · Nov 7, 2012

Answering your first question, you have two choices:

While creating SmartTV app you need to look at it like on AJAX driven website. 100% of data transfer is done by asynchronous connections. Once main index.html file of the application is loaded at application start it remains not-reloaded until app exit.

So here are few steps to create your basic "scene" manager:

  • Add AJAX library to the project (jQuery is best choice in my opinion)
  • Prepare DIV container for data received from AJAX
  • Prepare some kind of menu with onClick events handler
  • Create kind of history stack (urls array) to handle "go back" functionality

There's a lot of other problems to develop:

  • Remote control key handling
  • Handling focuses navigation through active elements

And if you want do download data from remote server you need to remember about the cross-domain policy, so you'll need to set some headers on your remote server or use JSONP to jump over it.

I hope I gave you some light in the darkness ;)