To comply with accessibility standards, including the European Accessibility Act (EEA), and to deliver an inclusive experience for users with disabilities, Titan OS provides essential accessibility features. As an app developer with an app on Titan OS, integrating these features into your app will enable it to respond to TV settings and ensure an accessible experience for all users.

Supported Platforms: These features are supported on 2024-2025 Philips EU TV models, as well as upcoming models from other manufacturers.

Under Development: These APIs are under active development and may undergo changes in the near future.

Below is a reference for the TitanSDK.accessibility interface methods.


Text-to-Speech

Provides functionality for converting text into spoken audio.

speak

Initiates text-to-speech synthesis for the provided text string.

TitanSDK.accessibility.speak(text: string | string[], options?: TTSOptions): Promise<void>

Parameters:

  • text: The string or an array of string of text to be spoken.
  • options: Optional TTS configuration. (Note: This parameter is currently under development and its structure is likely to change.)

Returns:

  • A Promise<void> that resolves when the speech request has been successfully initiated.

Throws:

  • TitanSDKError with code FEATURE_UNSUPPORTED if the text-to-speech feature is not available on the current platform.
  • TitanSDKError with code TTS_ERROR if a general failure occurs during speech synthesis initiation.

stopSpeaking

Immediately stops any text-to-speech audio currently being played by the SDK.

TitanSDK.accessibility.stopSpeaking(): Promise<void>

Returns:

  • A Promise<void> that resolves once the speech has been successfully stopped.

Throws:

  • TitanSDKError with code FEATURE_UNSUPPORTED if the text-to-speech feature is not available on the current platform.

Accessibility Settings

Allows retrieving and monitoring system accessibility preferences.

getSettings

Retrieves the current accessibility settings relevant to the SDK.

TitanSDK.accessibility.getSettings(): Promise<AccessibilitySettings>

Returns:

  • A Promise<AccessibilitySettings> that resolves with an object containing the current settings.

Throws:

  • TitanSDKError with code PLATFORM_ERROR if the settings cannot be retrieved from the underlying platform.

AccessibilitySettings Type

Defines the structure of the accessibility settings object returned by getSettings and provided by onSettingsChanged.

type AccessibilitySettings = {
  ttsEnabled: boolean; // Indicates if Text-to-Speech features are generally enabled system-wide.
  magnificationEnabled: boolean; // Indicates if screen magnification is currently active.
  magnificationLevel: number; // The current magnification level, or null if not applicable/enabled. ATTENTION: this is very likely to change.
};

Events

Provides mechanisms to subscribe to accessibility-related events.

onSettingsChanged

Subscribes a listener function to be called whenever relevant accessibility settings change.

TitanSDK.accessibility.onSettingsChanged(
  listener: (settings: AccessibilitySettings) => void
): () => void

Parameters:

  • listener: A callback function that will be invoked with the updated AccessibilitySettings object when a change occurs.

Returns:

  • A function that, when called, unsubscribes the provided listener, preventing it from receiving further updates.

Example Usage

This example demonstrates how to subscribe to setting changes, apply them, and clean up the subscription.

// Define a function to handle settings updates
function updateAccessibilityFeatures(settings: AccessibilitySettings) {
  console.log("Applying new settings to UI:", settings);
  // Add logic here to modify your application's behavior or appearance
  // based on the new ttsEnabled or magnificationEnabled/magnificationLevel values.
}

// Subscribe to changes in accessibility settings
const unsubscribe = TitanSDK.accessibility.onSettingsChanged((newSettings) => {
  console.log("Accessibility settings changed:", newSettings);
  // Update application UI based on new settings
  updateAccessibilityFeatures(newSettings);
});

// ... later in your application lifecycle ...

// Call unsubscribe() to clean up the listener when it's no longer needed
// (e.g., when a component unmounts or the feature is disabled).
unsubscribe();

Was this page helpful?