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: 
ioan
Roku Guru

I need help modifying one of the examples to start a roScreen

In the example "Video List Markup" from the "Scene Graph XML Tutorial", when I select an item "itemSelected", I want to rewrite "playVideo" so it's creating a roScreen so I can draw my own images on it. Is it possible?

sub init()
  m.top.backgroundURI = "pkg:/images/rsgde_bg_hd.jpg"

  m.videolist = m.top.findNode("videoLabelList")
  m.videoinfo = m.top.findNode("infoLabel")
  m.videoposter = m.top.findNode("videoPoster") 
  m.video = m.top.findNode("exampleVideo")

  m.video.observeField("state", "controlvideoplay")

  m.readVideoContentTask = createObject("roSGNode", "ContentReader")
  m.readVideoContentTask.observeField("content", "showvideolist")
  m.readVideoContentTask.control = "RUN"   
 
  m.videolist.observeField("itemFocused", "setvideo")
  m.videolist.observeField("itemSelected", "playvideo")
end sub

Sub OnChangeXmlstringscene()
  m.readVideoContentTask.xmlstring = m.top.xmlstringscene
End Sub

sub showvideolist()
  m.videolist.content = m.readVideoContentTask.content
  m.videolist.setFocus(true)
end sub

sub setvideo()
  videocontent = m.videolist.content.getChild(m.videolist.itemFocused)
  m.videoposter.uri = videocontent.hdposterurl
  m.videoinfo.text = videocontent.description
  m.video.content = videocontent
end sub

sub playvideo()
  m.video.control = "play"
  m.video.visible = true
  m.video.setFocus(true)
end sub 

sub controlvideoplay()
  if (m.video.state = "finished") 
    m.video.control = "stop"
    m.videolist.setFocus(true)
    m.video.visible = false
  end if
end sub

function onKeyEvent(key as String, press as Boolean) as Boolean
  if press then
    if key = "back"
      if (m.video.state = "playing")
        m.video.control = "stop"
        m.videolist.setFocus(true)
        m.video.visible = false

        return true
      end if
    end if
  end if

  return false
end function



If it's not possible, how can I replace the video playing screen with a screen that allows me to draw my own jpg images on it?
https://github.com/e1ioan/
http://rokucam.com
0 Kudos
1 REPLY 1
EnTerr
Roku Guru

Re: I need help modifying one of the examples to start a roScreen

0 Kudos