"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.
"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
"casolorz" wrote:
I was hoping there was some Roku provided or Open Source library that already did that. Is there one?
"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
"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?
"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.
"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?
"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.
"casolorz" wrote:
Would a combination of the mobile app having a server and roInput make sense?