Jump to content

Does the Emby Roku app support ECP and deep linking?


roaku

Recommended Posts

I'd like to be able to launch the Emby Roku app by http request and immediately load a movie landing page or start movie playback depending on the included query parameters.

Does Emby Roku support this and if not, could it be considered as a new feature?

https://developer.roku.com/docs/developer-program/debugging/external-control-api.md

-----

My use case is a homegrown solution where I index movie metadata and streaming urls from my UPNP server to SOLR which is then read by an electron app running on a Pi touchscreen to provide a simple thumbnail browser to launch movies by sending the streaming url over ECP to the custom Roku playback app.

I'd like to expand the Java indexing app to read from the Emby API and the electron app to launch to Emby Roku.

 

Link to comment
Share on other sites

Yes. Emby on Roku fully supports DIAL and ECP including full support for deep linking.

Voice control (Enhanced voice control) is also supported: https://developer.roku.com/docs/features/voice/overview.md

You need to send the "launch" command to the Roku IP address with the app-id of the Emby Roku app along with parameters the Emby app expects. If the Emby app is already running on the Roku you just send it ECP commands no need to launch.

I can give you examples later today. I just don't have them handy at the moment off the cuff.

Edited by speechles
Link to comment
Share on other sites

That's great news. And thanks for the fast response.

 

I should be able to get the emby app id from :

http://{ipaddress}:8060/query/apps

Then something like this to launch and start playback:

http://{ipaddress}:8060/launch/{emby-app-id}?mediaType=movie&contentID={movieIdOrUrlOrSomething}

I'd love a list of supported parameters when you have time. There's no rush from my end.

Thanks again.

Link to comment
Share on other sites

@cayars  I will build up a list of examples tonight for the knowledge base. I don't want to paraphrase those Roku documents. Those should be referenced. Users should use those to understand how this works so none of that has to be explained just referenced.

The Emby App-ID's for both the regular Store and the private Beta are needed. Then how to create a URL to send containing the Type and ID together with a resume point or bare. In both forms: To launch and play, and to just play. I will create examples for all those to show how to make them. Sharing is caring. ^_~

This will only work on a local LAN it does not work across the internet.

Edit: Did not have time yesterday to complete this. Will try to get this done today. ;)

Edited by speechles
  • Like 2
Link to comment
Share on other sites

Any updates on the KB article?
 

I was able to get the app ids from "http://{ipaddress}:8060/query/apps"

    <app id="44191" type="appl" version="4.0.4">Emby</app>
    <app id="43157" type="appl" version="4.0.12">Emby Beta</app>

And launch them with "curl -v -XPOST http://{ipaddress}:8060/launch/43157"

But I haven't had any luck guessing what the parameters to launch to a movie landing page or start playback might be.

Plugging movie ids and serverIds into random parameters just isn't doing the trick for me. :)

Edited by roaku
my roku's internal ip address is the most secret thing in my life
Link to comment
Share on other sites

18 minutes ago, roaku said:

Any updates on the KB article?

Not yet, sorry. It will take a little time.

Link to comment
Share on other sites

Thanks. I'll definitely spend some time with that.

I know that I'd prefer to get the launch and playback done in one http request to Roku, though.

That's the set up I have now and it allows my browse app to be completely agnostic and ignorant about what's happening on the other side of the http request. The dumber the better in this case.

 

Link to comment
Share on other sites

  • 2 weeks later...

I don't mean to be impatient on this, but all I really need is the query parameters to initiate playback and the query parameters to hit the movie landing page.

I don't need a full knowledge base article to complete this last step of my project.

@speechles if it's possible to just drop those parameters in a reply here, I'd really appreciate it.

Link to comment
Share on other sites

 

To get you started. They are the same as the Emby remote control API.

"MoveUp"
"MoveRight"
"MoveLeft"
"MoveDown"
"Select"
"GoHome"
"Back"
"GoToSettings"
"GoToSearch"
"SendString"
"ShowNowPlaying"
"Ping"
"ServerRestarting"
"ServerShuttingDown"
"RestartRequired"
"Stop"
"Pause"
"PlayPause"
"Unpause"
"NextTrack"
"PreviousTrack"
"Seek"
"Rewind"
"FastForward"
"DisplayContent"
"DisplayMessage"
"LibraryChanged"
"PlayNow"
"PlayNext"
"PlayLast"
"SetAudioStreamIndex"
"SetSubtitleStreamIndex"

Not all of these presently will work. Some of these are stubbed in the Roku app. They have not been fully extended to support all of these commands. But the Roku app will interpret these commands.

The PlayNow and/or DisplayContent command will work for the purposes you need. PlayNow can attach to it a list of itemIds. DisplayContent needs a single itemIds. The parameter must always be ItemIds even if you just have one item id.

Using:
"curl -v -XPOST http://{ipaddress}:8060/launch/43157?ControlCommand=PlayNow&ItemIds=1,2,..." attached to the URL used to start the ECP process with the Roku. That "should" be all you need. But I could be wrong.

Let me know if that works or doesn't. It should.

Once the Roku app is up and running you can grab the session ID and use the remote control API to control everything. The Roku ECP is really only used to launch the app into something. Not to control it once launched.

https://github.com/MediaBrowser/Emby/wiki/Remote-control

 

  

48 minutes ago, roaku said:

I don't mean to be impatient on this, but all I really need is the query parameters to initiate playback and the query parameters to hit the movie landing page.

I don't need a full knowledge base article to complete this last step of my project.

@speechles if it's possible to just drop those parameters in a reply here, I'd really appreciate it.


Please hold us accountable. If we forget.. rattle the chains. Bang on the pipes. Make some noise. Do not be afraid to get loud if we miss a reply. I didn't forget about this. It is just incomplete information and I was afraid you would get upset. But since I cannot know more at this time. Best to give you what I have so far. Apologies for the late reply. Happy Holidays. ^_^

 

 

 

Edited by speechles
  • Thanks 1
Link to comment
Share on other sites

Thanks so much for sharing that.

I've tried both of these commands on both the standard Emby app (44191) and the beta  (43157):

curl -v -XPOST http://{rokuIP}:8060/launch/43157?ControlCommand=DisplayContent&ItemIds={itemId}
curl -v -XPOST http://{rokuIP:8060/launch/43157?ControlCommand=PlayNow&ItemIds={itemId}

Unfortunately, the Emby app and beta both launch to the home page for both commands. This matches the behavior when the launch url is uses without any parameters (I have 'remember me' enabled. Without that, the app opens to the server selection screen).


I've experimented with parameter capitalization and encoding the PlayNow and ItemIds portion of the query string, on the off chance those two are meant to be passed as a single argument for ControlCommand:

curl -v -XPOST http://192.168.1.143:8060/launch/43157?ControlCommand=PlayNow%26ItemIds%3D22520

 

Thanks again for following up on this.

Edited by roaku
Link to comment
Share on other sites

Let me take another swing at this. I will get the exact logic later today.

  • Thanks 1
Link to comment
Share on other sites

Well, good news. This url works to launch and immediately start playback by id:
 

curl -v -XPOST "http://{roku ip}/launch/43157?Command=PlayNow&ItemIds={itemId}"

I had to cheat by finally realizing this feature exists in the web app and turning on debug logging to watch how it pulls it off.

The first problem was that it's 'Command', not 'ControlCommand'.

The second was that I forgot (again) how finicky curl is about quotes around urls. It likes to silently drop query parameters off urls when they aren't quoted.

Once both of those were corrected, all was well.

 

That being said, the 'DisplayContent' Command still doesn't work for me. It still just launches to the home page. I hope that can be figure out eventually, but that's not as important to me as playback.

Edit:
It also seems to ignore the SetAudioStreamIndex parameter, which I'm interested in for launching playback with Commentary tracks or Isolated Scores pre-selected, so I'd like to vote for that to be next up for  implementation if it's not yet. :)

Edited by roaku
Link to comment
Share on other sites

Glad you got it figured out. The command bit I got wrong because we call it ControlCommand inside the Roku app. I can look into extending the command set Roku actually interprets.

The application must make use of the Roku Discovery and Launch (DIAL) and External Control Protocol (ECP). For Roku to certify your application it must allow launching into the application and playing an item using both DIAL and ECP. That is what was done. But lots of the functionality is not handled because what you send the Roku is not being interpreted  It is just being discarded as it is just skeleton code for some (many) commands. Because it was just necessary to provide the functionality so Roku would certify the application.

We can look into extending this as the web app remote control also suffers when controlling the Roku session because these are not  implemented entirely yet.

The "voice commands" on Roku when you tell it something when holding down the microphone button breaks it down into DIAL and ECP commands that arrive back to the Roku device. So everything you can do "by voice" you can already do by ECP. Voice control is fully implemented as that is a Roku certification requirement. Try saying "Fast Forward 5 minutes" while holding down the microphone button on the Roku remote as video plays. It will show you what it is about to do (the text of what you said appears on screen) then do it.

https://support.roku.com/en-gb/article/360009552694

Look under the "Control Playback" section at the URL above. All of those can be spoken to the remote and Emby will do exactly as the command on that page says it will do.

I can make sure the audio stream and subtitle stream changing works via DIAL and ECP. Right now the video player is not aware of those parameters nor is the way to pass them into the video player yet built. This weekend I will deep dive and go through that section and see where we can improve it and at the same time make the web app remote control more robust when dealing with the Roku. The voice commands pass parameters through to the video player so it should be easy to extend this to passing more fields through as well.

 

@cayars https://support.roku.com/en-gb/article/360009552694  - All of those under "Control Playback" are supported by Emby when using a remote control with a microphone button. You might want to update the knowledge base. Every command you see under control playback and referenced is supported right now and has been for some time.

The URL will mention "When watching content on The Roku Channel, you can also use the advanced playback commands below." and Emby on Roku also supports those same exact commands. Everything except Global Roku Search as that isn't useful in the Emby app as it launches into a search page of streaming choices which is not what we desire nor do users.

Edited by speechles
Link to comment
Share on other sites

Wow, really good information speechles. I added this to my list and will get the KB updated with that info!

Link to comment
Share on other sites

@cayars No rush I know it is Turkey Time! I just know not enough people know we support this as fully as the Roku Channel itself has. Everything they can do we can do too. I do not think people are using that microphone button inside the Emby Roku app. Instead they pound buttons to rewind 15 minutes. When they could just speak into the microphone their desire. Which is easier? Pound buttons or press one button and speak an intent? It isn't up to us to decide. We just need users to understand they have choice. They do not always need to pound buttons while a movie plays and invoke an OSD. Just speak it and this will avoid the OSD as well as any UI and cleanly move you to where you want to go. This works as well with music as it does with video. It is also possible to say "Go ahead one hour five minutes and twenty seconds" and it will jump precisely 1h 5m 20s.

Edited by speechles
  • Like 1
Link to comment
Share on other sites

This would make an excellent tip/tile/popup inside the app like what they have started doing on Android.

Link to comment
Share on other sites

1 hour ago, speechles said:

The application must make use of the Roku Discovery and Launch (DIAL) and External Control Protocol (ECP). For Roku to certify your application it must allow launching into the application and playing an item using both DIAL and ECP.

I'm familiar with that policy....and the only exception to it I'm aware of is the one Roku made for its own Roku Media Player app. 😆 Fittingly, that exception along with realizing that Roku does not and will never fully support Roku Media Player is what led me to finally try out Emby in the first place.

I really appreciate the attentiveness you guys have shown, particularly you @speechles with the Roku app-endage.

When my budget allows, I'll become a lifetime premiere member because of it.

Edited by roaku
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hey @speechles Did you get a chance to look at audio stream selection or expanded ECP parameter set yet? Thanks.

 

Quote

I can make sure the audio stream and subtitle stream changing works via DIAL and ECP. Right now the video player is not aware of those parameters nor is the way to pass them into the video player yet built. This weekend I will deep dive and go through that section and see where we can improve it and at the same time make the web app remote control more robust when dealing with the Roku. The voice commands pass parameters through to the video player so it should be easy to extend this to passing more fields through as well.

 

Link to comment
Share on other sites

And also, just FYI, any efforts on ECP expansion will first be made to fully support the full gamut of remote control commands supported by emby server, so I would suggest reviewing the server's api docs.

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