@capacitor/screen-reader
スクリーンリーダーAPIは、TalkBack/VoiceOver/などへのアクセスを提供し、視覚的なアクセシビリティのための簡単なテキスト読み上げ機能を提供します。
Install
npm install @capacitor/screen-reader
npx cap sync
Example
import { ScreenReader } from '@capacitor/screen-reader';
ScreenReader.addListener('stateChange', ({ value }) => {
console.log(`Screen reader is now ${value ? 'on' : 'off'}`);
});
const checkScreenReaderEnabled = async () => {
const { value } = await ScreenReader.isEnabled();
console.log('Voice over enabled? ' + value);
};
const sayHello = async () => {
await ScreenReader.speak({ value: 'Hello World!' });
};