Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ssaguiar
Streaming Star

How to make a channel like Youtube?

Hi to all

I am working on a player which will play some recorded videos e those videos are received using HLS.

At this time, I am able to play them. I use a RowList to show the existing recorded videos.

When we click on one of them, we open the player and start playing it.

I have 2 questions:

1 - how can I make the player interface like the Youtube one (with the menu buttons and so)?

2 - Why the OnkeyEvent don't capture the "OK" key press (only the release of it)? I ask this because I want to show a <Rectangle> when I press the OK button, while playing the video. But the ok fires only on the release of the button.

Some of the code:

XML:

   <children>
		<Video
			id = "Video"
			translation = "[0,0]"
			width = "1920"
			height = "1080"
			loop = "false"
			visible = "false" >

				<Rectangle
					id = "videoOverlayMenu"
					translation = "[0, 0]"
					width = "1920"
					height = "1080"
					color = "0x000000BD"
					opacity = "1.0"
					visible = "false" >

					<Label
						id = "overlayMenuLabel"
						width = "120"
						height = "40"
						vertAlign = "center"
						horizAlign = "center"
						numLines = "1"
						maxLines = "1"
						wrap = "false"
						text = "MENU"
						color = "0xFFFFFFC0"
						opacity = "1.0"
						translation = "[1800,780]"
						visible = "false" >
					</Label>
				</Rectangle>
		</Video>
</children>

 

brs:

     m.videoOverlayMenu = m.top.findNode("videoOverlayMenu")
     m.overlayMenuLabel = m.top.findNode("overlayMenuLabel")
.
.
.
function OnkeyEvent(key as String, press as Boolean) as Boolean
    print "MainScene -> key: "; key
    print "MainScene -> key pressed: "; press
    result = false
    if press
        ' handle "back" key press
        if (key = "back") then
            numberOfScreens = m.screenStack.Count()
            ' close top screen if there are two or more screens in the screen stack
            if (numberOfScreens > 1) then
                CloseScreen(invalid)
                result = true
            end if
        else if(key = "OK") then
            print "key OK pressed"
        end if
    else
        if (key = "OK" AND m.videoPlayer.visible = true) then
            print "key = 'OK' AND m.videoPlayer.visible = true"
            m.videoPlayer.trickplaybar.visible = true

            if(m.videoOverlayMenu.visible = true) then
                m.videoOverlayMenu.visible = false
                m.overlayMenuLabel.visible = false
            else
                m.videoOverlayMenu.visible = true
                m.overlayMenuLabel.visible = true
            end if
            result = true
        end if
    end if
    return result
end function

 

The OK key is never captured on the press event.

 

Anybody can help me?

 

Thanks to all

 

0 Kudos