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

Video Playback

How to handle video resume and play in brighscript?
0 Kudos
1 REPLY 1
norcaljohnny
Roku Guru

Re: Video Playback

Your question is very generic and so I can only give an example as a generalization.

function onKeyEvent(key as String, press as Boolean) as Boolean
    if press then
      if key = "play"
        if (m.video.state = "playing")
            m.video.control = "pause"
          else if (m.video.state = "paused")
            m.video.control = "resume"
            return true
          end if
        end if
      end if
    end if
  return false
end function
0 Kudos