Your Digital Media Has Never Looked So Good

 
ashishtr
Topic Author
Posts: 4
Joined: Fri Aug 04, 2017 7:22 pm

Help required for ECP Command 'input'

Sat Aug 05, 2017 9:15 am

Hi All,

I'm coding a roku app which will play videos and it's remote is written on android, from where you can control the videos to play.

I'm able to run it using ECP command 'launch' to open the app & play the desired url. but it reopens the every time. It is working As Expected, but I don't want it to reload.

So I tried to use the ECP command 'input', it opens & plays for the first time, but later it doesn't do anything when the app is running.

Do I need to do some special handling in my Roku app to handle 'input' command?

Thanks in advance for all the comments/suggestions and inputs.

----
Ashish
 
User avatar
RokuKC
Posts: 274
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Help required for ECP Command 'input'

Sun Aug 06, 2017 10:05 am

ashishtr wrote:
...
So I tried to use the ECP command 'input', it opens & plays for the first time, but later it doesn't do anything when the app is running.

Do I need to do some special handling in my Roku app to handle 'input' command?


It is admittedly cryptic, but this is described in the documentation:
https://sdkdocs.roku.com/display/sdkdoc ... ontrol+API

"The external control server places these name-value pairs into an associative array, and passes them directly through to the currently executing channel script using a Message Port attached to a created roInput object."
...
"Messages of type roInputEvent have a GetInfo() method that will obtain the associative array."

To paraphrase, your application needs to create a global roInput object, and set its message port to one that your application is always monitoring (whether it be in a main event loop or in a task event loop).

When the ECP input command for your app is processed by the firmware, if your app is already running it will be sent an roInputEvent event with the parameters in the event, equivalent to the main launch parameters.

It's then up to your app to handle roInputEvent appropriately, e.g. navigating to the target content springboard in the browse UI.
 
ashishtr
Topic Author
Posts: 4
Joined: Fri Aug 04, 2017 7:22 pm

Re: Help required for ECP Command 'input'

Sun Aug 06, 2017 11:53 am

Thanks for the reply, I'll look into this direction. Meanwhile is there any example or sample code to implement it.
 
ashishtr
Topic Author
Posts: 4
Joined: Fri Aug 04, 2017 7:22 pm

Re: Help required for ECP Command 'input'

Sun Aug 06, 2017 6:53 pm

Finally I implemented it correctly by adding a roInputEvent. Now my code has started responding to the inputs. Thanks for the clue...

But now I got another problem regarding video component.
As soon as I change the stream url of the running video component, it doesn't retrieves the stream & stucks in between.

Do I need to create a new scene/screen to fix this problem. 


Thanks in advance for solution to this problem. Thanks.
 
User avatar
RokuKC
Posts: 274
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Help required for ECP Command 'input'

Wed Aug 09, 2017 11:36 am

ashishtr wrote:
...

But now I got another problem regarding video component.
As soon as I change the stream url of the running video component, it doesn't retrieves the stream & stucks in between.

Do I need to create a new scene/screen to fix this problem. 


Thanks in advance for solution to this problem. Thanks.


I suggest you start a new thread for this question, since it's not related to the ECP command.

Also, you will probably need to add more information about the problem to get any useful advice.

Who is online

Users browsing this forum: manishDev and 7 guests