Skip to main content
Version: 0.6.0-alpha.2

Accessibility Module


Version 0.6.0

OpenRPC

This document was generated from an OpenRPC JSON-Schema, and is intended to provide a human readable overview and examples of the methods contained in the module.

For the full schema, see the link below.

Schema
accessibility.json

Table of Contents

Usage

To use the Accessibility module, you can import it into your project from the Firebolt SDK:

import { Accessibility } from '@firebolt-js/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.

Events

Methods

closedCaptions

Get the user's preferred closed-captions settings

function closedCaptions(): Promise<ClosedCaptionsSettings>

Promise Resolution

TypeDescription
ClosedCaptionsSettingsthe 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 property value, use closedCaptionsSettings():

function closedCaptionsSettings(): Promise<ClosedCaptionsSettings>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
ClosedCaptionsSettingsthe 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 value

{
"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 the property value, use closedCaptionsSettings(value => { }):

function closedCaptionsSettings(callback: (closedCaptionsSettings: ClosedCaptionsSettings) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for closedCaptionsSettings changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Accessibility.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
closedCaptionsSettingsClosedCaptionsSettingstruethe closed captions settings

Examples

Getting the closed captions settings
JavaScript
Accessibility.closedCaptionsSettings(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"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"
}
}
}

voiceGuidance

Get the user's preferred voice guidance settings

function voiceGuidance(): Promise<VoiceGuidanceSettings>

Promise Resolution

TypeDescription
VoiceGuidanceSettingsthe 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 property value, use voiceGuidanceSettings():

function voiceGuidanceSettings(): Promise<VoiceGuidanceSettings>

Parameters

ParamTypeRequiredSummary

Promise Resolution

TypeSummary
VoiceGuidanceSettingsthe 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 value

{
"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 the property value, use voiceGuidanceSettings(value => { }):

function voiceGuidanceSettings(callback: (settings: VoiceGuidanceSettings) => any): Promise<boolean>

Parameters

ParamTypeRequiredSummary
callbackfunctionYesA callback that gets invoked when the value for voiceGuidanceSettings changes

Promise Resolution

TypeSummary
listenerIdThe id of the listener that can be used with Accessibility.clear(listenerId) to unsubscribe

Callback Parameters

ParamTypeRequiredSummary
settingsVoiceGuidanceSettingstruethe voice guidance settings

Examples

Getting the voice guidance settings
JavaScript
Accessibility.voiceGuidanceSettings(value => {
console.log(value)
}).then(response => {
console.log(response)
})

Value of response

{}

Value of value

{
"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
}
}

Schemas

ClosedCaptionsStyles

type ClosedCaptionsStyles = {
fontFamily?: string
fontSize?: number
fontColor?: string
fontEdge?: string
fontEdgeColor?: string
fontOpacity?: number
backgroundColor?: string
backgroundOpacity?: number
textAlign?: string
textAlignVertical?: string
}

Details

The default styles to use when displaying closed-captions


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
}