--- title: "Accessibility" slug: "081-core-accessibility" updated: 2025-05-23T22:31:13Z published: 2025-05-23T22:31:13Z canonical: "docs.developer.comcast.com/081-core-accessibility" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.developer.comcast.com/llms.txt > Use this file to discover all available pages before exploring further. # Accessibility **Accessibility Module 0.8.1 | Core SDK** ## Overview The `Accessibility` module provides access to the user/device settings for closed captioning and voice guidance. Apps **SHOULD** attempt o respect these settings, rather than manage and persist seprate settings, which would be different per-app. ## OpenRPC Firebolt APIs are maintained in the [rdkcentral/firebolt-core-sdk](https://github.com/rdkcentral/firebolt-core-sdk) GitHub repository. You can see this API in the [accessibility.json](https://github.com/rdkcentral/firebolt-core-sdk/blob/main/src/modules/accessibility.json) OpenRPC JSON-Schema document. ## Usage To use the Accessibility module, you can import it into your project from the Firebolt SDK: ``` import { Accessibility } from '@firebolt-js/sdk' ``` ## Methods ### closedCaptions This API is **deprecated** since version 0.6.0. Use `Accessibility.closedCaptionsSettings()` instead. Get the user's preferred closed-captions settings ``` function closedCaptions(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`ClosedCaptionsSettings`](/docs/081-core-accessibility#closedcaptionssettings) | the closed captions settings | **Examples** Getting the closed captions settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.closedCaptions() .then(closedCaptionsSettings => { console.log(closedCaptionsSettings) }) ``` Value of `closedCaptionsSettings`: ``` { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.closedCaptions", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } } ``` --- ### closedCaptionsSettings Get the user's preferred closed-captions settings To get the value, call the method with no parameters: ``` function closedCaptionsSettings(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`ClosedCaptionsSettings`](/docs/081-core-accessibility#closedcaptionssettings) | the closed captions settings | **Examples** Getting the closed captions settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.closedCaptionsSettings() .then(closedCaptionsSettings => { console.log(closedCaptionsSettings) }) ``` Value of `closedCaptionsSettings`: ``` { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.closedCaptionsSettings", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } } ``` To subscribe to notifications when the value changes, pass a function as the only parameter: ``` function closedCaptionsSettings(subscriber: (closedCaptionsSettings: ClosedCaptionsSettings) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for closedCaptionsSettings changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Accessibility.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `closedCaptionsSettings` | [`ClosedCaptionsSettings`](/docs/081-core-accessibility#closedcaptionssettings) | Yes | the closed captions settings | **Examples** Getting the closed captions settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.closedCaptionsSettings(closedCaptionsSettings => { // property value was changed console.log(closedCaptionsSettings) }).then(listenerId => { // you can clear this listener w/ Accessibility.clear(listenerId) }) ``` value of `closedCaptionsSettings`: ``` { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.onClosedCaptionsSettingsChanged", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": "1", "result": { "listening": "true" } } ``` ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "styles": { "fontFamily": "Monospace sans-serif", "fontSize": 1, "fontColor": "#ffffff", "fontEdge": "none", "fontEdgeColor": "#7F7F7F", "fontOpacity": 100, "backgroundColor": "#000000", "backgroundOpacity": 100, "textAlign": "center", "textAlignVertical": "middle" } } } ``` --- ### listen Listen for events from this module. To listen to a specific event pass the event name as the first parameter: ``` Accessibility.listen(event: string, (data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/081-core-accessibility#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Accessibility.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | To listen to all events from this module pass only a callback, without specifying an event name: ``` Accessibility.listen((event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/081-core-accessibility#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Accessibility.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. --- ### once Listen for only one occurance of an event from this module. The callback will be cleared after one event. To listen to a specific event pass the event name as the first parameter: ``` Accessibility.once(event: string, (data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event to listen for, see [Events](/docs/081-core-accessibility#events). | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Accessibility.clear(id)` | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | To listen to all events from this module pass only a callback, without specifying an event name: ``` Accessibility.once((event: string, data: any) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | *callback* | `function` | Yes | A function that will be invoked when the event occurs. The event data depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `event` | `string` | Yes | The event that has occured listen for, see [Events](/docs/081-core-accessibility#events). | | `data` | `any` | Yes | The event data, which depends on which event is firing, see [Events](/docs/081-core-accessibility#events). | Promise resolution: | Type | Description | | --- | --- | | `number` | Listener ID to clear the callback method and stop receiving the event, e.g. `Accessibility.clear(id)` | See [Listening for events](/docs/listening-for-events/) for more information and examples. --- ### voiceGuidance This API is **deprecated** since version 0.6.0. Use `Accessibility.voiceGuidanceSettings()` instead. Get the user's preferred voice guidance settings ``` function voiceGuidance(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`VoiceGuidanceSettings`](/docs/081-core-accessibility#voiceguidancesettings) | the voice guidance settings | **Examples** Getting the voice guidance settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.voiceGuidance() .then(settings => { console.log(settings) }) ``` Value of `settings`: ``` { "enabled": true, "speed": 5 } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.voiceGuidance", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "speed": 5 } } ``` --- ### voiceGuidanceSettings Get the user's preferred voice guidance settings To get the value, call the method with no parameters: ``` function voiceGuidanceSettings(): Promise ``` Promise resolution: | Type | Description | | --- | --- | | [`VoiceGuidanceSettings`](/docs/081-core-accessibility#voiceguidancesettings) | the voice guidance settings | **Examples** Getting the voice guidance settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.voiceGuidanceSettings() .then(settings => { console.log(settings) }) ``` Value of `settings`: ``` { "enabled": true, "speed": 5 } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.voiceGuidanceSettings", "params": {} } ``` Response: ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "speed": 5 } } ``` To subscribe to notifications when the value changes, pass a function as the only parameter: ``` function voiceGuidanceSettings(subscriber: (settings: VoiceGuidanceSettings) => void): Promise ``` Parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `subscriber` | `Function` | Yes | A callback that gets invoked when the value for voiceGuidanceSettings changes | Promise resolution: | Type | Summary | | --- | --- | | `listenerId` | The id of the listener that can be used with Accessibility.clear(listenerId) to unsubscribe | Callback parameters: | Param | Type | Required | Summary | | --- | --- | --- | --- | | `settings` | [`VoiceGuidanceSettings`](/docs/081-core-accessibility#voiceguidancesettings) | Yes | the voice guidance settings | **Examples** Getting the voice guidance settings JavaScript: ``` import { Accessibility } from '@firebolt-js/sdk' Accessibility.voiceGuidanceSettings(settings => { // property value was changed console.log(settings) }).then(listenerId => { // you can clear this listener w/ Accessibility.clear(listenerId) }) ``` value of `settings`: ``` { "enabled": true, "speed": 5 } ``` **JSON-RPC:** Request: ``` { "jsonrpc": "2.0", "id": 1, "method": "accessibility.onVoiceGuidanceSettingsChanged", "params": { "listen": true } } ``` Response: ``` { "jsonrpc": "2.0", "id": "1", "result": { "listening": "true" } } ``` ``` { "jsonrpc": "2.0", "id": 1, "result": { "enabled": true, "speed": 5 } } ``` --- ## Events ### Additional events The following events are documented as part of a related set of method APIs. For more information, follow the links under the "Documentation" column. | JavaScript | RPC | Payload | Documentation | | --- | --- | --- | --- | | closedCaptionsSettingsChanged | onClosedCaptionsSettingsChanged | [ClosedCaptionsSettings](/docs/081-core-accessibility#closedcaptionssettings) | [closedCaptionsSettings](/docs/081-core-accessibility#closedcaptionssettings) | | voiceGuidanceSettingsChanged | onVoiceGuidanceSettingsChanged | [VoiceGuidanceSettings](/docs/081-core-accessibility#voiceguidancesettings) | [voiceGuidanceSettings](/docs/081-core-accessibility#voiceguidancesettings) | ## Schemas ### ClosedCaptionsStyles The default styles to use when displaying closed-captions ``` type ClosedCaptionsStyles = { fontFamily?: string fontSize?: number fontColor?: string fontEdge?: string fontEdgeColor?: string fontOpacity?: number backgroundColor?: string backgroundOpacity?: number textAlign?: string textAlignVertical?: string } ``` --- ### ClosedCaptionsSettings ``` type ClosedCaptionsSettings = { enabled: boolean // Whether or not closed-captions should be enabled by default styles: ClosedCaptionsStyles // The default styles to use when displaying closed-captions } ``` --- ### VoiceGuidanceSettings ``` type VoiceGuidanceSettings = { enabled: boolean // Whether or not voice guidance should be enabled by default speed: number // The speed at which voice guidance speech will be read back to the user } ``` ---