Jump to content

Improve Roku remote control function


Recommended Posts

Posted

Roku seems to be the most lacking in terms of its remote control functionality (controlling sessions remotely via dashboard, using the remote control in the mobile apps) 

 

Right now, the remote commands are sent to Roku via ECP (External Communication Protocol). This protocol is limited to local networks only, so you are limited to controlling sessions that are on the same network as your server. In my case I can't even control my local Rokus because of the way my network is set up, Roku is on a separate VLAN and I don't allow ECP port 8060. 

 

I believe this can be improved by using websockets (are they available on Roku?), or some sort of HTTP long polling to allow Roku devices to receive remote commands from the server in a wider range of environments.

Posted

Hi, right there are no web sockets on Roku.

Posted

@Lukehttps://github.com/MediaBrowser/Emby.Roku/tree/master/source/webserver

We used to use this library to create the webserver on the Roku so we could send things to it. Then Roku forced us to make an implementation of the Dial/Launch/ECP interface to continue to certify the app. It would be possible to build something to make this happen. It also would have to be weighed against priority like everything else. But we could have a custom webserver running on the Roku to intercept requests from an external Emby server IP. There would then be two ports to control the Roku. One for a Roku on the same LAN as the Emby server. Then another for a Roku on WAN.

Posted (edited)
2 hours ago, speechles said:

@Lukehttps://github.com/MediaBrowser/Emby.Roku/tree/master/source/webserver

We used to use this library to create the webserver on the Roku so we could send things to it. Then Roku forced us to make an implementation of the Dial/Launch/ECP interface to continue to certify the app. It would be possible to build something to make this happen. It also would have to be weighed against priority like everything else. But we could have a custom webserver running on the Roku to intercept requests from an external Emby server IP. There would then be two ports to control the Roku. One for a Roku on the same LAN as the Emby server. Then another for a Roku on WAN.

Well that kind of sucks... So in that case I would have to port forward my Roku to have external remote control access.. You said it would be possible to build something like this... was that in reference to HTTP long-polling? That is something I have used before to develop for some game platforms that didn't have websocket support, but I don't know what Roku allows and doesn't allow as they seem pretty strict.

 

I am curious what's going to happen here because this is something that needs to get improved on if recently hinted at watch party feature is actually close to becoming a reality for us... 

Edited by rechigo
Posted

I’m not really sure. Rokus have such limited resources available that I’m not sure embedding a web server is sustainable.

Posted (edited)
31 minutes ago, Luke said:

I’m not really sure. Rokus have such limited resources available that I’m not sure embedding a web server is sustainable.

Well http long polling wouldn't require a web server on the Roku. It's kind of a niche method so idk if you know about it but a good explanation is here. It's a good alternative for when websockets aren't available.

 

My bad long polling example: Client (roku) makes request to embyserver -> embyserver waits to respond until it has data to send to roku (ex pause command performed via server dash) -> server closes request, sending over command data with it -> client makes a request again and the previous steps repeat... 

 

I imagine long polling could be implemented with the Roku http client? Obviously would require some new endpoints on the server as well.. @speechles

Edited by rechigo
Posted

It’s possible but we’d have to build some infrastructure for that.

 It would likely degrade browsing performance of the app though. Every device’s network layer will have a max concurrent connections per host. I don’t know what it is on Roku but let’s just say it’s 4. So as you’re scrolling through that’s one less available to fetch posters. Or when you click on a detail screen and it sends out 10 requests for data those will end up taking longer.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...