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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Detecting if the Closed Caption Menu is Opened

Hi everyone,

I'm dealing with an issue that affects lower end Rokus only (I can reproduce on a Roku Stick), and the Closed Caption dialog in a Video Component.

1) Video Playback starts.
2) Show the closed captions dialog
3) Press Back.

Expected: Closed Caption Dialog is dismissed and playback continues.  This occurs on Roku Premiere+ as we don't get the back key press when the options menu is opened.
Actual: We get a back key press and we exit the player.

I'm trying to find a way to ignore the back key press if the CC options dialog is visible, but so far I've been unsuccessful at finding a way to know that the dialog is opened.
I've tried looking at these options:
1) I tried to listen for key events to see if I could detect the options key press, but to no avail. I only get an options key event when closing the menu, not when the menu gets opened.
2) I tried to look for a dialog option to see if it exists or not, but I couldn't find any options on the video component:

Is there a way to know that this dialog is open? I can't find obvious ways to make it work.
0 Kudos

Re: Detecting if the Closed Caption Menu is Opened

Hello, Im having the same issue, were you able to fix this?

0 Kudos
Roku Guru

Re: Detecting if the Closed Caption Menu is Opened


You can read rodeviceinfoevent and use the appFocus field within GetInfo().



It is set to False when the System Overlay takes focus and True when the channel regains focus



That is what is called a "System Overlay". 🙂

Roku Guru

Re: Detecting if the Closed Caption Menu is Opened

And for custom dialogs you could just listen to "wasClosed"

dialog.observeField("wasClosed", "dialogWasClosed").

And do what u intended to!

0 Kudos