does anybody have the code for linking roku device to websit

does anybody have the code for linking roku device to website for restricting user to view my private channel

yes in the example applications that come with the SDK, look for the one called ‘register’ and merge it into your channel.

“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” 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.

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.

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()


    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” 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()


    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?

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” 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

I can confirm it does work. Thanks

yes it did. can i add youtube on my private channel?

You can if you want. RateRix is one channel for that and is private.

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.

how can i add youtube as a category as other videos in my private channel