This is my panel component
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<component name="VideoScreen" extends="Panel"
xsi:noNamespaceSchemaLocation="http://rokudev.roku.com/rokudev/schema/RokuSceneGraph.xsd">
<script type="text/brightscript" uri="pkg:/components/Screens/Video/VideoScreen.brs" />
<interface>
<field id="videoURL" type="String" onChange="play"></field>
<field id="videoTitle" type="String"></field>
</interface>
<children>
<Group id="groupSignInScreen" translation="[0, -173]">
<Video id="VideoPlayer" width="1920" height="1080" translation="[0,0]" />
</Group>
</children>
</component>
In the brs file for above I do following:
Code: Select all
sub init()
m.top.panelSize = "full"
m.top.leftPosition = 0
m.top.isFullScreen = true
m.video = m.top.findNode("VideoPlayer")
m.video.observeField("state", "onVideoPlaybackFinished")
end sub
sub play()
setVideo()
end sub
function setVideo() as void
videoContent = createObject("RoSGNode", "ContentNode")
videoContent.url = "http://roku.cpl.delvenetworks.com/media/59021fabe3b645968e382ac726cd6c7b/decbe34b64ea4ca281dc09997d0f23fd/aac0cfc54ae74fdfbb3ba9a2ef4c7080/117_segment_2_twitch__nw_060515.mp4"
videoContent.title = "Test Video"
videoContent.streamformat = "mp4"
m.video.content = videoContent
m.video.setFocus(true)
m.video.control = "play"
end function
function onVideoPlaybackFinished()
print m.video.state
end function
Can anyone tell me where I am going wrong? If I perform everything in a Scene, it works fine. I do see the controls visible on my video. But when I do it on a Panel, it's not showing up!