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

Fullscreen by pressing OK

I am using Custom Video Player and I want the Video to Fullscreen when I push the "OK" button, instead of the "DOWN" button.


'If the <UP> key is pressed, jump out of this context:
else if msg.isRemoteKeyPressed()
index = msg.GetIndex()
print "Remote button pressed: " + index.tostr()
if index = 2 '<UP>
return
else if index = 3 '<OK> (toggle fullscreen)
if m.paint = PaintFullscreenCanvas
m.setup = SetupFramedCanvas
m.paint = PaintFramedCanvas
rect = m.layout.left
else
m.setup = SetupFullscreenCanvas
m.paint = PaintFullscreenCanvas
rect = { x:0, y:0, w:0, h:0 } 'fullscreen
m.player.SetDestinationRect(0, 0, 0, 0) 'fullscreen
end if
m.setup()
m.player.SetDestinationRect(rect)
else if index = 4 or index = 8 '<LEFT> or <REV>
m.position = m.position - 60
m.player.Seek(m.position * 1000)
else if index = 5 or index = 9 '<RIGHT> or <FWD>
m.position = m.position + 60
m.player.Seek(m.position * 1000)
else if index = 13 '<PAUSE/PLAY>
if m.paused m.player.Resume() else m.player.Pause()
end if


Can anyone help, when I type <OK> inside where <DOWN> is, it doesn't even load the ZIP.
0 Kudos
1 REPLY 1
destruk
Binge Watcher

Re: Fullscreen by pressing OK

An apostrophe " ' " is the same as a REM statement - it tells the compiler to ignore the rest of the line.
So changing ' <DOWN> to ' <OK> won't accomplish anything

However, the Down button is 3, the OK button is 6, so if you change the =3 to =6 then it will look for the ok button press.

If you remove the apostraphe itself, the compiler will not understand what the comment means -- <OK> isn't a valid keyword or variable or statement/routine.
0 Kudos