Jump to content

Remote control API for roku


speechles

Recommended Posts

@@Luke

 

So I knew this was coming since it was mentioned earlier. Ditched the web-server, in favor of direct ECP on the roku using DIAL. This is great, but... how far along is this? It doesn't appear to work, or if it does, it doesn't recognize my roku ultra is sitting there. Is this incomplete? It doesn't notice the official app or official beta is installed on my roku when on the roku homescreen. Is this not able to launch an app outside of the app running on the roku yet?

 

Also.. once it is working, how will you launch via DIAL into ECP into third party applications? By this I mean when using DIAL with ECP you need an application id to send the parameters to. How does one give the server this application-id? Will it know if there are multiple emby applications on the roku and these show separately on the devices section of the server as deep linkable?

 

ie, you make the DIAL request and discover the roku. Once you have this, you can directly interact with it using ECP from the server. What I am asking is obviously this will be tied to the emby applications id and not any others. How are you going to allow third parties to access the roku DIAL/ECP process?

 

I am just asking since I recently noticed the old remote control methods do not work at all anymore. How to proceed? Is there a way?

Edited by speechles
Link to comment
Share on other sites

Are you testing with the distributed server install package? it should work with our official app, both the public and beta.

 

To make it work with yours, try adding an AppId property to your client capabilities object that the app is reporting.

Link to comment
Share on other sites

Windows 10 Home - Version 1803 - Build 17134.165 with Emby Server - Version 3.5.0.0

 

Okay, some oddities... The official and BETA cannot be launched separately. They appear to be using the same appID parameter to use with launch. Also on the roku homescreen, freshly loaded up dashboard in chrome. Go to little cast icon and roku isn't anywhere in the list. Launch the app, and suddenly it is. So there is something not working with SSDP correctly.

 

It should use SSDP to find the roku supports ECP that way. Then using ECP the server can use roku DIAL to start the app with parameters from the server entirely. No roku remote required. As the roku comes to life it signals the TV to turn on via HDMI-CEC and all of this with just touching the cast button and using play on the dashboard server screen. This is how its expected to work.

 

It isn't there yet. Thanks for the info about the appID property. I will start to getting that added and do some deep linking tests.. :)

Edited by speechles
Link to comment
Share on other sites

It depends on the app first reporting itself to the server, not ssdp. When you restart the server, the server needs to remember the session and recreate it, this part is what's currently missing.

 

If you want to test launching the app, first sign into the app, then shut it down. The Roku will stay in the server's remote control targets list.

Link to comment
Share on other sites

Maybe its something with the fact, you must first start the app once. So the server is fed its appID into the devices.json and now ever after it can launch from the homescreen? Okay, yep this is why. So it isn't using query/apps to build a database to know the apps are installed. Because its a catch-22 I understand that part. How to know the appID ahead of time, without alienate every third party app in existence. So the first launch of the app with the new DIAL method has to be done by roku remote once, to cache the device appID. This allows third parties and others to participate and I applaud that decision. Noted.. the DIAL does discover and launch with parameters and it does work.. I will get to adding this to the BN (BN-ONE) app today since exactly as its done in that will be directly portable to BN-TWO.  :)

 

EDIT: lol.. you beat me to it.. yeah.. its to allow others to participate and not lock down the roku to select appID I understand. :)

Edited by speechles
Link to comment
Share on other sites

Yea that's basically right, except we don't do discovery on the server, we just wait for the app to connect once and then from there we have all the information we need - roku ip address, app id, etc.

Link to comment
Share on other sites

The other issue is not being able to distinguish between the beta or the release version of the official app within the list. This might be an oversight, but as the two apps appear uniquely on the roku homescreen (clearly two separate apps) one would think they would appear as such on the cast list. Without this, you can't be sure which app is intercepting.

Edited by speechles
Link to comment
Share on other sites

@@Luke

 

Here is a fun one. Now don't get discouraged. Just ironic that this now happens after the work was just done to get this into emby.

 

As of firmware 8.1.x the roku ecp will no longer allow remote ip addresses access and will present those addresses with the appropriate 403 message.

 

https://www.tomsguide.com/us/roku-sonos-dns-rebinding-attack,news-27485.html

 

Because of the chance someone outside your network can jack your roku, recent firmware changed some things. So basically, any roku using a server remotely.. is uncontrollable via ECP if it happens to be on 8.1.x firmware. The same way, the web-server method would be uncontrollable, if the user didn't forward port 8324 on their router towards their roku. But even then it would only work right on that "one roku" not any others, you can only forward the port to 1 ip. So isn't like you've lost anything really in that regard. The only thing lost is now you can't control that 1 roku in that household if that user did all the forwarding correctly. How many did that forwarding correctly? I can guess tha answer would be pretty close to 0 (or in my case 1 as I know to do this, but only did it once for testing). So if the amount of users using the option remotely was 0, the loss isn't such as no one was using it anyways. Its a quality loss because now you cant do it even if you wanted to.

 

My point is, you can still launch from the app not running on the roku as long as the app has contacted the server from the roku at least once. This is far better IMO than the web-server option. But you need to perhaps remove those controls and such in the remote control section when the user is using a roku remotely on that server. They user running the server cannot control the remote roku even if they wanted to. Having the controls show as if they can is just asking for complaints.

 

Just a heads up in advance. :)

 

EDIT: Here is the official roku explanation:

https://forums.roku.com/viewtopic.php?f=34&t=116457&sid=aa53b22df4537f83ca09d8daef8d2c3f

Edited by speechles
Link to comment
Share on other sites

I think that's OK. The majority of usage will be in-network anyway. Thanks for the information.

Link to comment
Share on other sites

I think that's OK. The majority of usage will be in-network anyway. Thanks for the information.

 

This affects all apps too, so people used to playing youtube over the internet to their roku. Nope. That doesn't cut it neither. So emby wasn't the only one falling on the sword. Youtube, Netflix, every app suffers the same. Some malicious ad on some website you visit might try a dns rebinding attack and start every roku in your house playing their advertisements/videos for revenue. Keeps an even playing field. Everybody suffers.

 

<Mom> So the rokuTV just turned itself on again.. started playing videos all by itself.. does it all the time.

<You> Ghosts?

<Mom> It's always these inappropriate commercials

<Mom> take for example right now

<Mom> why am i watch an advertisement for some darknet onion router drug website? WTF..

<You> they hacked your gibson

<You> update your roku mom.. jeez..

<Mom> It's a rokuTV though..

<Mom> where is the gibson?

<You> yeah, some of those get 8.1 late.. have fun with those ads, maybe unplug the tv when not in use.

<You> the gibson is hacked. you need to tell whoever made that TV.

<Mom> I will call TCL up and complain

*** 3 days later

<Mom> Finally TCL updated and I can leave the TV alone when not in use.. YAY!!!

<You> maybe stop browsing websites with malicious code in the advertisements

<Mom> How can you tell what ones?

<You> Use Adblock.. jeez

<Mom> Downloading it. You are so sweet.

<You> Well I'm going out now.

<Mom> Wear a sweater.

 

LOL.. I can write a movie about it.. 

Edited by speechles
Link to comment
Share on other sites

It's on my to do list to have the server try and connect to the roku so that we can detect if it will work or not, and then be able to hide the remote control functions when it can't connect. That will at least cut down on our "not working" troubleshooting.

Link to comment
Share on other sites

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...