EnTerr
12 years agoRoku Guru
REP NB1: Add ECP /query/channel = channel# tuned to now
Background: I remember requesting this in the past but have not heard any comment back. It took me a while to dig it down and in retrospect i realize my suggestions often come in side note form. Yet here it is, almost three years ago:
The former part materialized as ECP command /input by the end of 2011 (either fw 3.0 or 4.1 - ECP doc and release notes differ on that). And i don't think there is way to do the latter part yet. So i decided to write it down as an only request and even give it pompously a formal designation as in the PEPs (Python Enhancement Proposals) and since this ain't no Python, "REP" it is.
REP NB1: Implement ECP "/query/channel" to return the current channel#
As simple as that, when ECP client sends http GET /query/channel,
Discussion: the purpose of this is to allow external control app to recognize if they can use channel-specific commands (like /input or direct socket connection). /input alone is only part of the picture, since the app does not even know if it is trying to shove the command in the right channel. Imagine audio/video channels eventually adding remote feedback, like sending what's playing title/author/info. So if my remote app checks /query/channel and sees say Pandora is on, it may start using Pandora-specific means of communication. The fact that it tried to launch it with /launch/28 earlier does not mean that channel is still running - someone might have exited already with physical remote or another app or the player might have spontaneously rebooted. Which is awful out-of-sync user experience - but with this help from ECP, it can know now when "/input" is talking to a brick-wall ("air talking").
Security concern: very low. Note all that is returned is the current channel#, it only allows ECP client app to know what's on screen, something that human already sees. It is not expected to return any additional params used during /launch. Thus the privacy inside individual channels is left to their implementors. Also, other vendors already do that - for example DirecTV protocol returns current channel as well as show info (and no, one does not have to authenticate to be able to use their protocol).

I am requesting consideration of this by RokuCo - as well as dev.community voices in support (hopefully).
"EnTerr" wrote:
It will be best if this can be incorporated in ECP and when received as particular http request passed as message in the event loop in the way isRemoteKeyPressed() is (new isEcpRequest()?) together will additional path and parameters. The only twist remains how to send back data for the http response. It's so simple to implement i would sort of expect it to show in the next SDK release π
And one more thing remaining is figuring out what's the current channel on Roku (as to know what queries it can handle if any). That in analogy to "query/apps" and "query/icon" will be something like "query/channel" and simply return ID of the running channel (e.g. "12" for Netflix)
The former part materialized as ECP command /input by the end of 2011 (either fw 3.0 or 4.1 - ECP doc and release notes differ on that). And i don't think there is way to do the latter part yet. So i decided to write it down as an only request and even give it pompously a formal designation as in the PEPs (Python Enhancement Proposals) and since this ain't no Python, "REP" it is.
REP NB1: Implement ECP "/query/channel" to return the current channel#
As simple as that, when ECP client sends http GET /query/channel,
- return the app ID of the channel that player is currently "tuned to". E.g. '12' for Netflix, '15985' for Play-on-Roku, 'dev' for side-loaded etc. No XML nor JSON since there is no other meaningful info to return; quotes used only for readability in previous sentence.
- return '0' when player is in the home screen, '-1' if cannot give clear answer - in particular, if it is in the process of loading a channel (subject to discussion; http status 204/205?; situations: booting? in transition?)
- current behavior: since command is not implemented, return http status 400
Discussion: the purpose of this is to allow external control app to recognize if they can use channel-specific commands (like /input or direct socket connection). /input alone is only part of the picture, since the app does not even know if it is trying to shove the command in the right channel. Imagine audio/video channels eventually adding remote feedback, like sending what's playing title/author/info. So if my remote app checks /query/channel and sees say Pandora is on, it may start using Pandora-specific means of communication. The fact that it tried to launch it with /launch/28 earlier does not mean that channel is still running - someone might have exited already with physical remote or another app or the player might have spontaneously rebooted. Which is awful out-of-sync user experience - but with this help from ECP, it can know now when "/input" is talking to a brick-wall ("air talking").
Security concern: very low. Note all that is returned is the current channel#, it only allows ECP client app to know what's on screen, something that human already sees. It is not expected to return any additional params used during /launch. Thus the privacy inside individual channels is left to their implementors. Also, other vendors already do that - for example DirecTV protocol returns current channel as well as show info (and no, one does not have to authenticate to be able to use their protocol).

I am requesting consideration of this by RokuCo - as well as dev.community voices in support (hopefully).

