Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
EnTerr
Level 11

Re: External Control of Netflix channel?

"TheEndless" wrote:

That can be simplified greatly...

if( params["trackIDs"] <> invalid ) then
playlist = params["trackIDs"].Tokenize(" ")
end if


Phew!
Glad to hear, i have never programmed BrightScript before and i got rather disappointed today by the lack of string functions (e.g. split() ) when skimming the reference manual.
0 Kudos
gonzotek
Level 8

Re: External Control of Netflix channel?

"lucasgonze" wrote:
And thanks for the incantations, EnTerr and TheEndless.

gonzotek, reading the remoku source was a big help. I appreciate the learning. In the end I used hardcoded hack forms like this one, so that I could focus on just the brightscript: http://pastebin.com/8RryduUv
No problem, glad to see the feature added into the Mog beta. Would it be ok with you/Mog to add the launch interface to remoku for end users now, or would it be better to wait until after this version of Mog leaves beta status? I have a testing version I keep locally where I'm already adding interfaces for channels that publicly support ecp launch params (right now it's just shoutcast and soon-to-be mog). I wouldn't want to make something public unless the developer is onboard first.

Cheers,
Cassidy
(aka Gonzotek Smiley Happy )
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
whaleface
Level 7

Re: External Control of Netflix channel?

Ok, here is my proof of concept google chrome extension. This works like a champ for me. It adds 'Roku' links to album and playlist pages, then tries to find all the tracks in the page and adds Roku links next to those too. It doesn't work everywhere (for instance the dynamic search boxes), so you have to browse to an album or playlist's page directly to make it work.

Example: On http://mog.com/albums/mn44159503/el-guincho/pop-negro I get a Roku link next to the album title that plays all tracks in the album, and individual Roku links for each song. Same deal for http://mog.com/playlists/86773.

Go the extension's options to set your Roku's IP address first.

It does uglify mog.com somewhat. Here's the source in case anybody who is better at js and html than me wants to make it prettier/more useful.

Btw, I cribbed the Roku-contacting parts from remoku, so thanks for that app. Smiley Happy If somebody could try this out and let me know if it works, that would be great. I thought I might have cross-origin problems with hitting the Roku's ip without putting explicit permissions in the extension's settings, but it doesn't seem to mind?
0 Kudos
lucasgonze
Level 7

Re: External Control of Netflix channel?

Cassidy/gonzotek, I'd love it if you added those interfaces to Remoku. It's hard for us to QA these things beyond just having developers use them. It's interesting to see that whaleface also cribbed source from Remoku - it turns out to be a great way to learn ECP hacking.

We'll push the feature out to production next time we have a batch of user-visible features which merit in-house QA time.

whaleface, I'm really psyched to see your hack. Is the only modification to the MOG UI that it adds the blue "(Roku)" link? That doesn't look so bad, all things considering. I know from experience that modifying page layouts is a can of worms... Might as well just get started.

I haven't gotten time to hook up the Roku today, so haven't been able to test the extension fully. But it has been smooth so far.

I'll be demoing MOG Roku hacks at NY Music Hack Day next weekend and will show this off. How does it detect a MOG ID? Is it possible to have your extension detect MOG IDs in tracks outside of mog.com? One way to do that is to look for links in the form http://mog.com/tracks/mn44159509/el-gui ... gro/bombay ....
0 Kudos
whaleface
Level 7

Re: External Control of Netflix channel?

"lucasgonze" wrote:
whaleface, I'm really psyched to see your hack. Is the only modification to the MOG UI that it adds the blue "(Roku)" link? That doesn't look so bad, all things considering. I know from experience that modifying page layouts is a can of worms... Might as well just get started.


yes, it just adds the roku links next to the album/playlist header and each track. it's a bit ugly because they can sometimes wrap to the next line or be off-centered, etc. originally I wanted to get them in the dropdown play buttons but I couldn't get that working quickly.

"lucasgonze" wrote:
I haven't gotten time to hook up the Roku today, so haven't been able to test the extension fully. But it has been smooth so far.


great! please let me know if the actual roku interaction doesn't work because like I said I was suspicious of the permissions thing. but I was using it all weekend and it really seems to work well. even sending a playlist with 80+ tracks to the roku works fine.

"lucasgonze" wrote:
I'll be demoing MOG Roku hacks at NY Music Hack Day next weekend and will show this off. How does it detect a MOG ID? Is it possible to have your extension detect MOG IDs in tracks outside of mog.com? One way to do that is to look for links in the form http://mog.com/tracks/mn44159509/el-gui ... gro/bombay ....


sounds awesome. I'm actually new to chrome extensions but I don't see any reason it couldn't do that. it currently checks the page URL to figure out if you're on an album or playlist page, then searches the DOM for the relevant elements. it pulls the track IDs out from the 'new Mog.Track' links using regular expressions, but it could just as easily pull them out of mog.com links. I'm not sure how much free time I'll have since I have a business trip to prepare for but if I get a chance I'll hack on it some more.
0 Kudos
lucasgonze
Level 7

Re: External Control of Netflix channel?

I just did a test against a live device and nothing happened on the device.

My guess is that setting the IP in the config screen isn't working.
0 Kudos
whaleface
Level 7

Re: External Control of Netflix channel?

"lucasgonze" wrote:
I just did a test against a live device and nothing happened on the device.

My guess is that setting the IP in the config screen isn't working.


well, darn. try grabbing the source from here and edit manifest.json to have the following:

"permissions": [
"http://your-roku-ip-address:8060/*"
],

then do 'load unpacked extension' from the chrome extensions page and see if that fixes it. the app id is always 2049 right? you could also try hard-coding your ip in background.html.
0 Kudos
TheEndless
Level 9

Re: External Control of Netflix channel?

For what it's worth, I've put up a simple SHOUTcast custom URL launcher here... http://www.permanence.com/roku/shoutcast.htm
Very simple, but it gets the job done.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
whaleface
Level 7

Re: External Control of Netflix channel?

I uploaded a new version of the extension here that gives it permissions to do cross-origin requests anywhere, which gives you the slightly scary message that it can "access your data on all websites". I'm not sure how else to do it though when the IP it needs to hit is configurable.
0 Kudos
lucasgonze
Level 7

Re: External Control of Netflix channel?

I wonder if there's a way to have your Roku tell the extension what its IP is? Is there any Brightscript API for that?
0 Kudos