greno
15 years agoVisitor
GetInfo() and external control Input command
Hi all. I'm the developer of the Roku Remote app for Android, and have been working with the external controls commands for a while. But now I'm jumping into channel development and could use some help.
Basically, I want to create a very simple channel that accepts URLs passed to it from my app using external control. For example, I'd like to send something like:
The channel should accept the input argument "url" and use the value to start playback. This should be possible from the external controls document:
I do have the audioapp sample working, so I'm really just looking at how to be notified that the message was received and to pull the URL value from the message.
I also see the launchparams example, but that's not what I'm looking for. I want to send the URLs while the channel is running, not at startup.
Any help would be appreciated.
Thanks,
-Gregg Reno
Basically, I want to create a very simple channel that accepts URLs passed to it from my app using external control. For example, I'd like to send something like:
http://192.168.1.5:8060/input?url=http://www.someserver.com/somemusicfile.mp3
The channel should accept the input argument "url" and use the value to start playback. This should be possible from the external controls document:
input enables a developer to send custom events to their Brightscript application. It takes a user defined list of name-value pairs sent as query string uri parameters. The external control server places these name-value pairs into a BrightScript associative array and passes them directly through to the currently executing channel script via a Message Port attached to a created roInput object. Please refer to Section 3.1 below for more detailed recommendations on how to pass your data. Messages of type roInputEvent have a GetInfo() method that will obtain the associative array. The arguments must be URL-encoded. This command is sent via a POST with no body.
Example: POST /input?acceleration.x=0.0&acceleration.y=0.0&acceleration.z=9.8
I do have the audioapp sample working, so I'm really just looking at how to be notified that the message was received and to pull the URL value from the message.
I also see the launchparams example, but that's not what I'm looking for. I want to send the URLs while the channel is running, not at startup.
Any help would be appreciated.
Thanks,
-Gregg Reno