@capacitor/screen-reader 4.0.2-nightly-20220920T151236.0 → 4.0.2-nightly-20220921T150756.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.capacitorjs.plugins.screenreader;
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
|
+
import android.media.AudioAttributes;
|
|
4
5
|
import android.speech.tts.TextToSpeech;
|
|
5
6
|
import android.view.accessibility.AccessibilityManager;
|
|
6
7
|
import java.util.ArrayList;
|
|
@@ -50,6 +51,10 @@ public class ScreenReader {
|
|
|
50
51
|
new TextToSpeech(
|
|
51
52
|
context,
|
|
52
53
|
status -> {
|
|
54
|
+
AudioAttributes attributes = new AudioAttributes.Builder()
|
|
55
|
+
.setUsage(AudioAttributes.USAGE_ASSISTANCE_ACCESSIBILITY)
|
|
56
|
+
.build();
|
|
57
|
+
textToSpeech.setAudioAttributes(attributes);
|
|
53
58
|
textToSpeech.setLanguage(locale);
|
|
54
59
|
textToSpeech.speak(text, TextToSpeech.QUEUE_FLUSH, null, "capacitor-screen-reader" + System.currentTimeMillis());
|
|
55
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/screen-reader",
|
|
3
|
-
"version": "4.0.2-nightly-
|
|
3
|
+
"version": "4.0.2-nightly-20220921T150756.0",
|
|
4
4
|
"description": "The Screen Reader API provides access to TalkBack/VoiceOver/etc. and provides simple text-to-speech capabilities for visual accessibility.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "2eb0e7e6db9d3f6a684d2c9a0e2e7ec94d5dfa63"
|
|
83
83
|
}
|