Setting Focus on the Video Node
You must set focus on the Video node while playback is occurring for the trick play bar and some other user interface options to be used. After playback has finished, you will generally want to set focus back on the user interface element (usually a list or grid or custom video "details" screen) from which the user selected the video.
<component name = "PanelExample" extends = "Panel" initialFocus="exampleVideo">
<interface >
<field id = "description" type = "string" onChange = "showdescription" />
</interface>
<script type = "text/brightscript" >
<![CDATA[
sub init()
m.top.panelSize = "full"
m.top.focusable = true
m.top.hasNextPanel = true
m.top.isFullScreen = false
end sub
sub showdescription()
videocontent = createObject("RoSGNode", "ContentNode")
videocontent.title = "Example Video"
print videocontent.title
videocontent.streamformat = "mp4"
'videocontent.url = "http://roku.cpl.delvenetworks.com/media/59021fabe3b645968e382ac726cd6c7b/f8de8daf2ba34aeb90edc55b2d380c3f/b228eeaba0f248c48e01e158f99cd96e/rr_123_segment_1_072715.mp4"
videocontent.url = m.top.description
print m.top.description
m.video = m.top.findNode("exampleVideo")
m.video.content = videocontent
m.video.setFocus(true)
print m.video.hasFocus()
m.video.control = "play"
m.video.loop = true
print "state"
[size=85][font=Helvetica Neue, Helvetica, Arial, sans-serif] end sub[/font][/size]
</script>
<children >
<Rectangle
id = "infoRectangle"
translation = "[ 0, 10 ]"
height = "460"
width = "1020"
color = "0x101010C0">
<Video id = "exampleVideo" height = "560"
width = "1020"/>
</Rectangle>
</children>
</component>
"the_mace" wrote:
After some playing around, I found the issue that my Video node was down below my top content node and that evidently caused issues. I moved to using a Video node at the top of the tree and then everything behaved normally (controls worked and are there on first play). Not sure why it has that quirk but in case someone else runs into it...
We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.
Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality.
In the meantime, for additional assistance, visit our Support Site.
Thanks for your patience — we’re excited to share what’s next!