does anybody have the code for linking roku device to websit

Roku's free SDK allows developers to build channels and applications and publish them to the Roku Channel Store. Register for the Developer Program at http://www.roku.com/developer

Moderators: RokuDouglas, RokuKen, RokuRyan, RokuJamesL, RokuChris, RokuJoel

does anybody have the code for linking roku device to websit

Postby Biju » Sun Jan 29, 2012 11:48 pm

does anybody have the code for linking roku device to website for restricting user to view my private channel
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm

Re: does anybody have the code for linking roku device to we

Postby joetesta » Mon Jan 30, 2012 4:26 pm

yes in the example applications that come with the SDK, look for the one called 'register' and merge it into your channel.
joetesta
 
Posts: 136
Joined: Wed Apr 20, 2011 11:48 am

Re: does anybody have the code for linking roku device to we

Postby Biju » Mon Jan 30, 2012 10:52 pm

joetesta wrote:yes in the example applications that come with the SDK, look for the one called 'register' and merge it into your channel.

How to merge it into my channel im? do you have the sample code for it?
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm

Re: does anybody have the code for linking roku device to we

Postby joetesta » Tue Jan 31, 2012 10:57 am

Biju wrote:
joetesta wrote:yes in the example applications that come with the SDK, look for the one called 'register' and merge it into your channel.

How to merge it into my channel im? do you have the sample code for it?


the sample code is in the example application. for your custom app you probably have to figure it out or hire someone who can do it.
joetesta
 
Posts: 136
Joined: Wed Apr 20, 2011 11:48 am

Re: does anybody have the code for linking roku device to we

Postby destruk » Tue Jan 31, 2012 12:25 pm

Or you could join the roku Premium Developer Program, where roku does all required linking and billing for you without you needing to have it in your app. Their cost is 30% of whatever you charge - last time I checked.
destruk
 
Posts: 1782
Joined: Sat Dec 18, 2010 4:58 pm

Re: does anybody have the code for linking roku device to we

Postby RokuJoel » Tue Jan 31, 2012 2:49 pm

Biju, here is a little thing I whipped up this morning which might solve your short-term private channel linking issue. I haven't tested it, but it should work:

On your website, you create a text file of all the serial numbers, each on its own line.
on the roku, In the very top of your channel, in sub main(), put in the following:

sub main()
Code: Select all
    xfer=createobject("rourltransfer")
    xfer.seturl("http://mywebserver.com/serialnumbers.txt") 'the url and path to your file
    list=xfer.gettostring().tokenize(chr(10))
    di=createobject("rodeviceinfo")
    myserial=di.getdeviceuniqueID()
    ?myserial
    linked=false
    for each number in list
        if number.left(number.instr(chr(13)))=myserial or number=myserial then
            linked=true
        end if
    end for
    if linked=false then
        dialog=createobject("roonelinedialog")
        dialog.settitle("Serial number: "+myserial)
        ?"my SN=";myserial
        dialog.show()
        sleep(20000)
        dialog.close()
        return
    end if

end sub

Note that this has only been tested with a text file created by windows Notepad.

So essentially, if someone launches the app and their serial is not in your text file, it will display their serial number for 20 seconds and exit, otherwise, it should continue on to allow them access to your content.
RokuJoel
 
Posts: 1085
Joined: Mon Nov 14, 2011 5:22 pm

Re: does anybody have the code for linking roku device to we

Postby Biju » Tue Jan 31, 2012 10:29 pm

RokuJoel wrote:Biju, here is a little thing I whipped up this morning which might solve your short-term private channel linking issue. I haven't tested it, but it should work:

On your website, you create a text file of all the serial numbers, each on its own line.
on the roku, In the very top of your channel, in sub main(), put in the following:

sub main()
Code: Select all
    xfer=createobject("rourltransfer")
    xfer.seturl("http://mywebserver.com/serialnumbers.txt") 'the url and path to your file
    list=xfer.gettostring().tokenize(chr(10))
    di=createobject("rodeviceinfo")
    myserial=di.getdeviceuniqueID()
    ?myserial
    linked=false
    for each number in list
        if number.left(number.instr(chr(13)))=myserial or number=myserial then
            linked=true
        end if
    end for
    if linked=false then
        dialog=createobject("roonelinedialog")
        dialog.settitle("Serial number: "+myserial)
        ?"my SN=";myserial
        dialog.show()
        sleep(20000)
        dialog.close()
        return
    end if

end sub

Note that this has only been tested with a text file created by windows Notepad.

So essentially, if someone launches the app and their serial is not in your text file, it will display their serial number for 20 seconds and exit, otherwise, it should continue on to allow them access to your content.

Thank you joel, but i didnt understand in which file on the roku i have to put these codes. is it in appmain.brs or somewhere else?
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm

Re: does anybody have the code for linking roku device to we

Postby RokuJoel » Wed Feb 01, 2012 10:44 am

Depends on which sample application you based your project on. If it is the videoplayer example then it would go in appMain.brs, right at the top, immediately after Sub Main()

You have to have the serialnumbers.txt file on your server before you launch the project. It doesn't have to have any content yet, but it needs to be there.

- Joel
RokuJoel
 
Posts: 1085
Joined: Mon Nov 14, 2011 5:22 pm

Re: does anybody have the code for linking roku device to we

Postby Biju » Thu Feb 02, 2012 12:18 am

RokuJoel wrote:Depends on which sample application you based your project on. If it is the videoplayer example then it would go in appMain.brs, right at the top, immediately after Sub Main()

You have to have the serialnumbers.txt file on your server before you launch the project. It doesn't have to have any content yet, but it needs to be there.

- Joel

Than you Joel for supporting i'll try this sample. Thank you
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm

Re: does anybody have the code for linking roku device to we

Postby bandal » Thu Feb 02, 2012 9:31 am

I can confirm it does work. Thanks
bandal
 
Posts: 264
Joined: Sat Oct 15, 2011 2:17 pm

Re: does anybody have the code for linking roku device to we

Postby Biju » Sun Feb 05, 2012 12:15 am

yes it did. can i add youtube on my private channel?
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm

Re: does anybody have the code for linking roku device to we

Postby bandal » Sun Feb 05, 2012 9:06 am

You can if you want. RateRix is one channel for that and is private.
bandal
 
Posts: 264
Joined: Sat Oct 15, 2011 2:17 pm

Re: does anybody have the code for linking roku device to we

Postby YungBlood » Sun Feb 05, 2012 1:51 pm

From what I understand, there are legal issues regarding youtube & ads. If you try play videos from youtube without displaying their ads, they get upset and can delete your account & videos. This has been discussed in much more detail in other theads.
YungBlood

Bringing more fun to Roku!
YungBlood
 
Posts: 132
Joined: Wed Jul 07, 2010 10:05 pm
Location: California

Re: does anybody have the code for linking roku device to we

Postby Biju » Mon Feb 06, 2012 10:30 pm

how can i add youtube as a category as other videos in my private channel
Biju
 
Posts: 28
Joined: Sun Jan 15, 2012 10:07 pm


Return to Roku Developer Program

Who is online

Users browsing this forum: newchannel and 5 guests