Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 10

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
1 REPLY 1\
Level 11

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

0 Kudos