DEV Community

Discussion on: React JS for Smart TV - discussion

Collapse
 
pdrmdrs profile image
Pedro Paulo Paiva de Medeiros

Hi!

First of all, thanks for showing intersting in this Smart TV development area, :D

So, to start develop with React, there isn't any source about it, unfornatelly.

What I did to maintain a single code to the two platform was to develop a single project and use the 'yarn build' command, and then, put this build project on other two projects (each one created to be a Tizen project and webOS project).

With that, you can test on the TVs and test.

Other thing I do is to avoid using too much specific code. An example is the video that I use. I prefer to use a custom HTML5 video player react component that I've built for the platforms and use in the projects instead of using the Tizen or webOS specific code.

Just keep in mind that testing in a real device is a need.

To maintain retrocompatibility you will need some polyfills for new features or build to a older js version using the Babel.

It's really an area that has almost nothing about it on the internet, :(, but just keep searching and asking for help that you will gain knowledge and experience to deal with new problems that will appear :D

Collapse
 
farnaziifz profile image
Farnaziifz

thanks a lot, for remote control event what can I do?

Thread Thread
 
pdrmdrs profile image
Pedro Paulo Paiva de Medeiros

To control the remote control events I use the onKeyDown event that the React give to me. Just put the event on your app's root component and handle the focus and where the user should go when some key is pressed.

The onKeyDown event will send an object that I usually call 'event'.

The event dispatched is this: developer.mozilla.org/en-US/docs/W...

You can use the 'key' attribute or others if you want it.

Thread Thread
 
farnaziifz profile image
Farnaziifz

thanks a milion.