I'm having trouble disabling the remote control buttons like "fast forward", "pause", etc. in my Roku application. It is a very simple application that just has the one main scene, which only creates a video node that plays a live stream of our television channel. It was accepted by Roku accept that they require you to disable the trick play buttons like "fast forward" during a live stream. The documentation says this should be handled with the "onKeyEvent()" function. If the event is handled, it 'shouldn't' bubble up and be handled by the firmware. I can console log to prove that the function is firing but when I turn "handled" to true and return it, it seems to have no effect. all the buttons continue to fire and do their thing.
I have used their provided example and have even simplified it all the way down to just turning "handled" to true, unconditionally. (among other things) I have tried moving it from the video scene brs file to main (where everything is initialized) and moving it around but I am stumped. It fires when the buttons are pressed but returning true seems to do nothing.
The app only starts up, creates the video node and begins playing the stream. Other than firing a google analytics event, it does nothing else.
Roku's example: (https://sdkdocs.roku.com/display/sdkdoc/Handling+Application+Events#HandlingApplicationEvents-HandlingRemoteControlKeyPresses)
function onKeyEvent(key as String, press as Boolean) as Boolean
handled = false
if press then
if (key = "back") then
handled = false
else
if (m.warninglabel.visible = false)
m.warninglabel.visible="true"
else
if (key = "OK") then
m.warninglabel.visible="false"
end if
end if
handled = true
end if
end if
return handled
end function
Is there something am missing about this? If anyone knows how to disable these buttons, I would be more than grateful.