Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling remote (trick play) buttons in a Roku live streaming application video node?

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.

like image 748
Anon Mouse Avatar asked Nov 27 '25 18:11

Anon Mouse


2 Answers

I wonder why did you not use "enableTrickPlay" and "enableUI" fields of the Video node for the purpose. Please check : https://sdkdocs.roku.com/display/sdkdoc/Video under "UI Fields"

like image 115
Keshav Goel Avatar answered Nov 30 '25 22:11

Keshav Goel


You don't need to do in onKeyEvent function as you have mentioned in your question.

Just set "Live" field value to true in content meta-data for video node, as mentioned in documentation https://sdkdocs.roku.com/display/sdkdoc/Content+Meta-Data

If will handle the video controls for your live content.

You can find the sample video player code in https://github.com/rokudev/simple-videoplayer-channel

like image 45
Abhishek Avatar answered Nov 30 '25 21:11

Abhishek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!