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

CaptionStyle

Hi , can you please tell me on how to make changes in closedCaptions by changing the background , text color etc .Have tried using m.videoPlayer.captionStyle={"Text color":"Yellow"}
but there is no change .

Please suggest what should i do .
Thanks in advance
Thanks
Regards
Sechin Sunny
0 Kudos
18 REPLIES 18
RokuBen
Community Moderator
Community Moderator

Re: CaptionStyle

captionStyle doesn't exist on roVideoPlayer.  It's part of the Video node which is a Scene Graph type in SDK 2.  roVideoPlayer is part of SDK 1 which is deprecated and no longer supported for new channels or channel updates (see https://sdkdocs.roku.com/display/sdkdoc/roVideoPlayer)
0 Kudos
SECHIN_SUNNY
Visitor

Re: CaptionStyle

Hi ben , but i am talking about video node only , within scenegraph . I used this field stating 
m.videoplayer=m.top.findNode("video")
m.videoplayer.closedCaptions={"Text Background":"Yellow"} 
I changed different property and value which is given inSDK but no effect on the subtitle . Please let me know the correct parameters to be used to make the changes for the subtitle styling.

Thanks in advance
Thanks
Regards
Sechin Sunny
0 Kudos
RokuBen
Community Moderator
Community Moderator

Re: CaptionStyle

The property is called captionStyle.

m.videoplayer = m.top.findNode("video")
m.videoplayer.captionStyle["Background color"] = "Yellow"


should tell the caption engine to use a yellow background. Note: this won't override a user's choice in the closed caption UI -- if they've picked green on red, the caption engine will use that settings. This just overrides the defaults. You need to use the exact property names listed on https://sdkdocs.roku.com/display/sdkdoc/Video.
0 Kudos
SECHIN_SUNNY
Visitor

Re: CaptionStyle

"RokuBen" wrote:
The property is called captionStyle.

m.videoplayer = m.top.findNode("video")
m.videoplayer.captionStyle["Background color"] = "Yellow"


should tell the caption engine to use a yellow background.  Note: this won't override a user's choice in the closed caption UI -- if they've picked green on red, the caption engine will use that settings.  This just overrides the defaults.  You need to use the exact property names listed on https://sdkdocs.roku.com/display/sdkdoc/Video.

Thank you so much ben , you saved me . Thanks a lot
Thanks
Regards
Sechin Sunny
0 Kudos
SECHIN_SUNNY
Visitor

Re: CaptionStyle

Hi Ben i tried using it , but i got error instead , please can you advise me what wrong i  m doing and how to makes things work .
864:  SUb availableSubtitleTracks()
865:  'print"m.videoPlayer==>tracks==>"m.videoPlayer.availableSubtitleTracks
866:  if m.videoPlayer.availableSubtitleTracks.count()<>0
867:    m.subtitle_icon_group.visible=true
868:  else
869:    m.subtitle_icon_group.visible=false
870:  end if
871:
872:*   m.videoplayer.captionStyle["Background color"] = "Yellow"
873:  ENd SUb
Invalid value for left-side of expression. (runtime error &he4) in pkg:/componen
ts/baseVideoPLayer/baseVideoPLayer.brs(872)

Thanks in advance
Thanks
Regards
Sechin Sunny
0 Kudos
RokuBen
Community Moderator
Community Moderator

Re: CaptionStyle

The captionStyle attribute starts as invalid, so you need to assign an associative array to it first to be able to use the syntax I posted.

I also did some debugging on our side, and the attribute names we've posted are wrong.  The correct set is


  • Text/Font

  • Text/Effect

  • Text/Size

  • Text/Color

  • Text/Opacity

  • Background/Color

  • Background/Opacity

  • Window/Color

  • Window/Opacity


I'll ask that the developer docs get updated.  That would make your code now read

m.videoplayer = m.top.findNode("video")
m.videoplayer.captionStyle = { "Background/Color": "Yellow" }


Thanks for persisting with your questions.
0 Kudos
SECHIN_SUNNY
Visitor

Re: CaptionStyle

Thanks Ben , for the quick answer . It really worked fine .

I have 2 questions , please do help me , atleast provide me an hint . Let me ask you the first question :

In Roku Tv after the new update of 8.0 we have the tv guide , in the UI all the rows moves together with respect to the focus , how is it exactly possible in rowlist , or is it some other component belonging to arrayGrid . 

Thanks in advance
Sechin
Thanks
Regards
Sechin Sunny
0 Kudos
SECHIN_SUNNY
Visitor

Re: CaptionStyle

"SECHIN SUNNY" wrote:
Thanks Ben , for the quick answer . It really worked fine .

I have 2 questions , please do help me , atleast provide me an hint . Let me ask you the first question :

In Roku Tv after the new update of 8.0 we have the tv guide , in the UI all the rows moves together with respect to the focus , how is it exactly possible in rowlist , or is it some other component belonging to arrayGrid . 

Thanks in advance
Sechin

Hi ben please reply to this query , give me a hint on how u guys are managing in roku tv the tv guide , how all the rows move together with respect to the row in focus when u change each time section .
Thanks
Regards
Sechin Sunny
0 Kudos
RokuBen
Community Moderator
Community Moderator

Re: CaptionStyle

That is done with an internal component that's not published in the Brightscript SDK.
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.