title: Setting caption styles on Roku Scene Graph Video node via code in channel application
body: <p>I am developing a Roku channel app. I am having trouble applying styles to the subtitles for a Scene Graph <code>Video</code> node.</p>
  
  <p>If I set caption styles globally via the system's Settings screen, the subtitles do appear stylized over my full-screen, focused Scene Graph <code>Video</code> node (background color, text color, text edge effect, they all work as expected.) However, I cannot replicate this via code on my channel app.</p>
  
  <p>I understand that Scene Graph <code>Video</code> node's <code>captionStyle</code> property is only available since firmware version 8.0. My Roku Device has such exact version, and so does a second, much newer, Roku device I have tested this on.</p>
  
  <p>Here is my BrightScript code (I have added a firmware version check just to be able to tell if the positive branch of the <code>if</code> statement does execute):</p>
  
  <pre><code>m.video.globalCaptionMode = "On"
  m.video.subtitleTrack = params.subtitlesUrl
  
  print "Caption Style before our customizations: "; FormatJson(m.video.captionStyle) ' Prints null
  
  firmwareVersion = GetFirmwareVersion()
  
  if firmwareVersion &gt;= 8 then
  
      captionStyle = {
          "Background Color": "Yellow"
      }
  
      m.video.captionStyle = captionStyle
  
      print "Subtitles Style set on Video node: "; FormatJson(m.video.captionStyle) ' Prints the assoc array as expected
  
  else        
      print "Caption Style not supported on firmware version: "; firmwareVersion
  end if
  </code></pre>
  
  <p>Please note that the first <code>print</code> statement that includes <code>m.video.captionStyle</code>, before applying my customizations, prints <code>null</code>. I would expect it to display the current global system settings, at least (if the property is intended for reading and not just writing, as some properties are.) My guess is that the <code>captionStyle</code> property does not belong to the <code>Video</code> node directly, yet I am unable to find any examples on the official Roku SDK documentation or elsewhere (this site included.)</p>
  
  <p>A second guess is that perhaps the keys on the <code>captionStyle</code> associative array should not be specified as a string value (this associative array literal style is also new, but the BrightScript Eclipse plug-in does not complain, nor does the Roku itself during actual execution.) That is, instead of:</p>
  
  <pre><code>captionStyle = {
      "Background Color": "Yellow"
  }
  </code></pre>
  
  <p>The entry may have to set as this: </p>
  
  <pre><code>captionStyle = {
      backgroundColor: "Yellow"
  }
  </code></pre>
  
  <p>But it does not work either. By reading the Roku SDK documentation for the <code>captionStyle</code> property (<a href="https://sdkdocs.roku.com/display/sdkdoc/Video" rel="nofollow noreferrer">https://sdkdocs.roku.com/display/sdkdoc/Video</a>) I would expect it to be specified as a string (including spaces), in fact.</p>
  
  <p>Any ideas? Thanks.</p>