casolorz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2017
11:56 AM
Is it possible to run a server inside a Roku channel?
I have an Android app that sends videos to streaming devices. I would like to hire someone to write a Roku channel for it, the Roku channel would need to receive a command to play a video and return back to the app whether it succeeded, and also send to the app some playback state events like when the video is paused, buffering, etc, as well as let the app query the current position and duration of the video.
For this I was hoping to run a web server on the Roku but on my initial conversations with Roku developers (still interviewing) it seems like brightscript might not allow that? Is that the case? And if so, what is the preferred way to have communication between the mobile app and the Roku? I can easily run a web server on the mobile app (already do) but then the Roku would have to open a connection to the mobile app and wait for the command, is that possible?
Thank you.
For this I was hoping to run a web server on the Roku but on my initial conversations with Roku developers (still interviewing) it seems like brightscript might not allow that? Is that the case? And if so, what is the preferred way to have communication between the mobile app and the Roku? I can easily run a web server on the mobile app (already do) but then the Roku would have to open a connection to the mobile app and wait for the command, is that possible?
Thank you.
10 REPLIES 10
ioan
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2018
11:43 AM
Re: Is it possible to run a server inside a Roku channel?
"casolorz" wrote:
I have an Android app that sends videos to streaming devices. I would like to hire someone to write a Roku channel for it, the Roku channel would need to receive a command to play a video and return back to the app whether it succeeded, and also send to the app some playback state events like when the video is paused, buffering, etc, as well as let the app query the current position and duration of the video.
For this I was hoping to run a web server on the Roku but on my initial conversations with Roku developers (still interviewing) it seems like brightscript might not allow that? Is that the case? And if so, what is the preferred way to have communication between the mobile app and the Roku? I can easily run a web server on the mobile app (already do) but then the Roku would have to open a connection to the mobile app and wait for the command, is that possible?
Thank you.
You CAN have a web server inside a Roku application, my channel IP Camera Viewer Pro does just that for the "Easy Add" feature (aka the user uses their browser on the computer or phone to enter the camera info).
See echo server here: https://sdkdocs.roku.com/display/sdkdoc/roStreamSocket
https://github.com/e1ioan/
http://rokucam.com
http://rokucam.com
casolorz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2018
11:50 AM
Re: Is it possible to run a server inside a Roku channel?
"ioan" wrote:
You CAN have a web server inside a Roku application, my channel IP Camera Viewer Pro does just that for the "Easy Add" feature (aka the user uses their browser on the computer or phone to enter the camera info).
See echo server here: https://sdkdocs.roku.com/display/sdkdoc/roStreamSocket
Thank you for that info, I had seen that but it seems like it is just a socket, so the developer I hire would need to implement an HTTP server on top of that. I was hoping there was some Roku provided or Open Source library that already did that. Is there one?
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2018
02:37 PM
Re: Is it possible to run a server inside a Roku channel?
"casolorz" wrote:
I was hoping there was some Roku provided or Open Source library that already did that. Is there one?
From the old Roku SDK examples: https://forums.roku.com/viewtopic.php?t=64930
casolorz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
01:43 AM
Re: Is it possible to run a server inside a Roku channel?
"belltown" wrote:"casolorz" wrote:
I was hoping there was some Roku provided or Open Source library that already did that. Is there one?
From the old Roku SDK examples: https://forums.roku.com/viewtopic.php?t=64930
Awesome, thank you for those links.
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
09:42 AM
Re: Is it possible to run a server inside a Roku channel?
"casolorz" wrote:
... what is the preferred way to have communication between the mobile app and the Roku? I can easily run a web server on the mobile app (already do) but then the Roku would have to open a connection to the mobile app and wait for the command, is that possible?
your use case does not require a Roku-side server.
if i were implementing this, i'd have the external app launch the Roku channel via ECP, passing URL to be contacted back. Then Roku do a long-poll http to the Android app - while it sounds counter-intuitive for reversing the implementation of who the client and who the server is, that's lower level implementation detail; the mobile app can still control the Roku play.
casolorz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
09:53 AM
Re: Is it possible to run a server inside a Roku channel?
"RokuNB" wrote:"casolorz" wrote:
... what is the preferred way to have communication between the mobile app and the Roku? I can easily run a web server on the mobile app (already do) but then the Roku would have to open a connection to the mobile app and wait for the command, is that possible?
your use case does not require a Roku-side server.
if i were implementing this, i'd have the external app launch the Roku channel via ECP, passing URL to be contacted back. Then Roku do a long-poll http to the Android app - while it sounds counter-intuitive for reversing the implementation of who the client and who the server is, that's lower level implementation detail; the mobile app can still control the Roku play.
That is exactly what I'm currently discussing with the developers I'm interviewing. Is long-poll pretty easy to do on the Roku?
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
10:15 AM
Re: Is it possible to run a server inside a Roku channel?
"casolorz" wrote:
That is exactly what I'm currently discussing with the developers I'm interviewing. Is long-poll pretty easy to do on the Roku?
Yes. "Long poll" is just a normal HTTP call, the twist is that the web server is "holding the ball" till it has a command to send back. i.e. it's a way to reverse control.
Think Roku periodically, repeatedly asking the phone "got any orders for me?" - "no", till eventually app says "ok, play this" or "ok, pause". That's "polling".
If inclined, that can be optimized to the server holding on response to the request till it has new info to send. That's long polling.
casolorz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
10:27 AM
Re: Is it possible to run a server inside a Roku channel?
"RokuNB" wrote:"casolorz" wrote:
That is exactly what I'm currently discussing with the developers I'm interviewing. Is long-poll pretty easy to do on the Roku?
Yes. "Long poll" is just a normal HTTP call, the twist is that the web server is "holding the ball" till it has a command to send back. i.e. it's a way to reverse control.
Think Roku periodically, repeatedly asking the phone "got any orders for me?" - "no", till eventually app says "ok, play this" or "ok, pause". That's "polling".
If inclined, that can be optimized to the server holding on response to the request till it has new info to send. That's long polling.
Yeap I've done it before with other projects, I was hoping to avoid that since the mobile app is likely to have less resources than the roku (I'm guessing) but sounds like it will be my best option. Thanks for the help.
Would a combination of the mobile app having a server and roInput make sense? or is roInput going away someday?
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2018
12:23 PM
Re: Is it possible to run a server inside a Roku channel?
"casolorz" wrote:
Would a combination of the mobile app having a server and roInput make sense?
Sure, you can "push" messages Android->Roku with ECP `/input`, send the opposite way via http. No long or repetitive polling: even better.