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: 
hclapp_1
Visitor

RSG Video options - play, pause controls and prebuffer not displaying

Hi Team, 
   I have tried to display the video controls but i ends with fail. Only satisfaction is video is working without controls. Anyone Please help me on this to display the video controls (play, pause, mute and prebuffer).

My Code:

XML:
<Rectangle    id = "infoRectangle"    height = "510"    width = "420"    color = "167C80"    translation = "[0,45]" >
    <Video id = "exampleVideo"   height = "230" width = "420" enableUI="true" />
</Rectangle>

Interface:
  <interface >

    <field id = "videourl" type = "string" onChange = "showdescription" />
  </interface>

Onchange Function "showdescription":
sub showdescription()
      videocontent = createObject("RoSGNode", "ContentNode")
      videocontent.title = "Example Video"
      videocontent.streamformat = "mp4"
      'videocontent.url = "http://roku.cpl.delvenetworks.com/media/59021fabe3b645968e382ac726cd6c7b/f8de8daf2ba34aeb90edc55b2d380c3f/b228eeaba0f248c48e01e158f99cd96e/rr_123_segment_1_072715.mp4"
      videocontent.url = m.top.videourl
      print m.top.videourl
      m.video = m.top.findNode("exampleVideo")
      m.video.content = videocontent
      m.video.setFocus(true)
      m.video.control = "stop"
      m.video.loop = true
    end sub

 

Keyevent Function:
function onKeyEvent(key as String,press as Boolean) as Boolean
      if press then
        if key = "back"
        m.infoImage.visible = true
          print "key press"
          print key
          print m.video.state
          if (m.video.state = "playing")
            m.video.control = "stop"

          end if
       end if
       if key = "options"
         print "key press"
         print key
         m.video.control = "play"
         m.infoImage.visible = false
      end if
    end if
      return false
    end function
0 Kudos
2 REPLIES 2
the_mace
Channel Surfer

Re: RSG Video options - play, pause controls and prebuffer not displaying

Did you ever find a solution to this? I have a similar issue going on.

On the first play of an asset, the controls/prebuffering are not showing. If I exit the asset and then pick a different one (or even pick the same one I did before) then the controls are shown as expected. When they're missing they show very briefly on the screen and then are covered by a black screen until playback starts.

There seems to be some state of the video that is being set that makes it work for the next ones but not the first.
0 Kudos
the_mace
Channel Surfer

Re: RSG Video options - play, pause controls and prebuffer not displaying

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...
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.