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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
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() = "pkg:/images/rsgde_bg_hd.jpg"

  m.videolist ="videoLabelList")
  m.videoinfo ="infoLabel")
  m.videoposter ="videoPoster") ="exampleVideo")"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 =
End Sub

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

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

sub playvideo() = "play" = true
end sub 

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

function onKeyEvent(key as String, press as Boolean) as Boolean
  if press then
    if key = "back"
      if ( = "playing") = "stop"
        m.videolist.setFocus(true) = 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?
0 Kudos
Roku Guru

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

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.