Use register example with video player

Hello Experts:

I have a 2 questions regarding to register example and video player example that is shipped with roku sdk.

  1. I want to integrate register example with video player example. What is the best place to show the user the registration screen?

  2. If the better option is to display screen just before playing the channel, then post some sample code to do it.

It depends. If all of your content requires the user to be linked to an account, then the first time into the channel is probably the best option. If You have free content that doesn’t require a linked account, then you can put off linking until the user tries to use functionality that requires the linking.

Thank you for replying RokuPatrick.

I need all my content to be Linked to a user account.

Here is the function in videoplayer example where i call the doRegistration() method..


Function showHomeScreen(screen) As Integer

    if validateParam(screen, "roPosterScreen", "showHomeScreen") = false return -1

    initCategoryList()
    screen.SetContentList(m.Categories.Kids)
    screen.SetFocusedListItem(3)
    screen.Show()

    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roPosterScreenEvent" then
            print "showHomeScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
            if msg.isListFocused() then
                print "list focused | index = "; msg.GetIndex(); " | category = "; m.curCategory
            else if msg.isListItemSelected() then
                print "list item selected | index = "; msg.GetIndex()
				regIndex = doRegistration()
				if regIndex = 0 then
					print "We are registered. Proceed"
					kid = m.Categories.Kids[msg.GetIndex()]
					if kid.type = "special_category" then
						displaySpecialCategoryScreen()
					else
						displayCategoryPosterScreen(kid)
					end if
				end if
            else if msg.isScreenClosed() then
                return -1
            end if
        end If
    end while

    return 0

End Function

But when i try to connect to my website, retreive code screen shows for a fraction and then an error message came showing the text:

Cant connect to the video service.
Any suggestions?

Ok. I have solved my problem. There was some problem with my web application.