แนวทางปฏิบัติแนะนำเกี่ยวกับการช่วยเหลือพิเศษสำหรับ Android TV
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คู่มือนี้จะแนะนำแนวทางปฏิบัติที่ดีที่สุดสำหรับการช่วยเหลือพิเศษใน Android TV และให้
คำแนะนำสำหรับทั้งแอปที่มาพร้อมเครื่องและแอปที่ไม่ได้มาพร้อมเครื่อง
เหตุใดการช่วยเหลือพิเศษจึงสำคัญต่อแอปทีวีของฉัน
ความบกพร่องทางสายตาเป็นเรื่องที่พบได้บ่อยในกลุ่มประชากรที่ดูทีวี
ผู้คนทั่วโลกประมาณ 2.2 พันล้านคน
มีภาวะสายตาผิดปกติ
ตามข้อมูลขององค์การอนามัยโลก (WHO) ในสหรัฐอเมริกา ชาวอเมริกันอายุ 18 ปีขึ้นไป 32 ล้านคนมีการสูญเสียการมองเห็นอย่างมาก ตามการสำรวจสัมภาษณ์ด้านสุขภาพแห่งชาติปี 2018
ในยุโรป การประมาณการ
ชี้ให้เห็นว่ามีผู้พิการทางสายตาและผู้ที่มีสายตาเลือนราง30 ล้านคน ตามข้อมูลของสหภาพคนตาบอดแห่งยุโรป (EBU)
ที่สำคัญที่สุดคือผู้ใช้ที่มีความบกพร่องทางสายตาสามารถเพลิดเพลินกับเนื้อหาสื่อ
ได้มากพอๆ กับผู้ใช้ที่มีสายตาปกติ แบบสำรวจปี 2017 ที่ Comcast ว่าจ้างแสดงให้เห็นว่าผู้ใช้ที่ตาบอดหรือมีสายตาเลือนราง 96% ดูทีวีเป็นประจำ โดย 81% ดูมากกว่า 1 ชั่วโมงต่อวัน อย่างไรก็ตาม 65% ยังรายงานว่า
พบปัญหาในการค้นหารายการที่กำลังออกอากาศทางทีวี และในแบบสำรวจปี 2020 ในสหราชอาณาจักร
ผู้พิการ 80% กล่าวว่าเคยพบปัญหาด้านการช่วยเหลือพิเศษกับวิดีโอ
ในบริการสตรีมมิงแบบออนดีมานด์
แม้ว่าเทคโนโลยีความช่วยเหลือจะช่วยผู้ใช้ที่มีสายตาเลือนรางได้ แต่การสนับสนุนการช่วยเหลือพิเศษในเส้นทางการค้นพบเนื้อหาสำหรับแอปทีวีก็เป็นสิ่งสำคัญ
เช่น ให้ความสำคัญกับการให้คำแนะนำในการไปยังส่วนต่างๆ และการติดป้ายกำกับองค์ประกอบอย่างเหมาะสม รวมถึงตรวจสอบว่าแอปในทีวีทำงานได้ดีกับฟีเจอร์การช่วยเหลือพิเศษ เช่น TalkBack ขั้นตอนเหล่านี้ช่วยปรับปรุงประสบการณ์ของผู้ใช้ที่มีความบกพร่องทางการมองเห็นได้อย่างมาก
ก้าวแรกในการปรับปรุงการช่วยเหลือพิเศษคือการรับรู้ คู่มือนี้จะช่วยให้คุณและทีมค้นพบปัญหาด้านการช่วยเหลือพิเศษในแอปทีวี
แหล่งข้อมูลการช่วยเหลือพิเศษของ Android
ดูข้อมูลเพิ่มเติมเกี่ยวกับการช่วยเหลือพิเศษใน Android ได้ที่แหล่งข้อมูลการพัฒนาการช่วยเหลือพิเศษ
อัตราส่วนข้อความ
แอป Android TV ควรเคารพค่ากําหนดของผู้ใช้ในการปรับขนาดข้อความโดยรองรับความหนาแน่นของพิกเซลที่แตกต่างกัน
โปรดระมัดระวังเป็นพิเศษในเรื่องต่อไปนี้
คุณเปลี่ยนขนาดข้อความได้ด้วยคำสั่งต่อไปนี้
adb shell settings put system font_scale 1.2f
ใน Android 12 ขึ้นไป ผู้ใช้สามารถเปลี่ยนการปรับขนาดข้อความได้จากการตั้งค่าอุปกรณ์
รูปแบบแป้นพิมพ์
ใน Android 13 (API ระดับ 33) ขึ้นไป คุณสามารถใช้
getKeyCodeForKeyLocation()
เพื่อ
ค้นหารหัสแป้นสำหรับ
ตำแหน่งแป้นที่คาดไว้
การดำเนินการนี้อาจจำเป็นในกรณีที่ผู้ใช้ได้แมปตำแหน่งคีย์บางตำแหน่งใหม่ หรือหากผู้ใช้ใช้แป้นพิมพ์ที่มีเลย์เอาต์ไม่ปกติ
เสียงบรรยาย
ใน Android 13 (API ระดับ 33) ขึ้นไป ค่ากำหนดการช่วยเหลือพิเศษใหม่ทั้งระบบ
ช่วยให้ผู้ใช้เปิดใช้เสียงบรรยายในทุกแอปได้ แอป Android TV สามารถตรวจสอบค่ากำหนดของผู้ใช้ได้โดยการค้นหาด้วย isAudioDescriptionRequested()
Kotlin
private lateinit var accessibilityManager: AccessibilityManager
// In onCreate():
accessibilityManager = getSystemService(AccessibilityManager::class.java)
// Where your media player is initialized
if (am.isAudioDescriptionRequested) {
// User has requested to enable audio descriptions
}
Java
private AccessibilityManager accessibilityManager;
// In onCreate():
accessibilityManager = getSystemService(AccessibilityManager.class);
// Where your media player is initialized
if(accessibilityManager.isAudioDescriptionRequested()) {
// User has requested to enable audio descriptions
}
แอป Android TV สามารถตรวจสอบได้เมื่อค่ากำหนดของผู้ใช้เปลี่ยนแปลงโดย
เพิ่ม Listener ไปยัง
AccessibilityManager
Kotlin
private val listener =
AccessibilityManager.AudioDescriptionRequestedChangeListener { enabled ->
// Preference changed; reflect its state in your media player
}
override fun onStart() {
super.onStart()
accessibilityManager.addAudioDescriptionRequestedChangeListener(mainExecutor, listener)
}
override fun onStop() {
super.onStop()
accessibilityManager.removeAudioDescriptionRequestedChangeListener(listener)
}
Java
private AccessibilityManager.AudioDescriptionRequestedChangeListener listener = enabled -> {
// Preference changed; reflect its state in your media player
};
@Override
protected void onStart() {
super.onStart();
accessibilityManager.addAudioDescriptionRequestedChangeListener(getMainExecutor(), listener);
}
@Override
protected void onStop() {
super.onStop();
accessibilityManager.removeAudioDescriptionRequestedChangeListener(listener);
}
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-21 UTC"],[],[],null,["# Accessibility best practices for Android TV\n\nThis guide provides best practices for accessibility on Android TV and provides\nrecommendations for both native and non-native apps.\n\nWhy is accessibility important for my TV app?\n---------------------------------------------\n\nVision impairments are not uncommon among the TV-watching population.\nAn estimated [2.2 billion people globally](https://www.who.int/health-topics/blindness-and-vision-loss#tab=tab_1)\nhave a vision impairment, according\nto the World Health Organization (WHO). In the US, 32 million Americans age 18 and older have experienced\nsignificant vision loss,\naccording to the [2018 National Health Interview Survey](https://www.afb.org/research-and-initiatives/statistics/adults).\nIn Europe, the estimates\npoint to [30 million](http://www.euroblind.org/about-blindness-and-partial-sight/facts-and-figures#:%7E:text=Statistics,sighted%20persons%20as%20blind%20persons)\nblind and partially sighted persons, according to the European Blind Union (EBU).\n\nMost importantly, users with vision impairments enjoy media content\njust as much as their fully sighted peers. A [2017 survey](https://www.afb.org/research-and-initiatives/statistics/adults) commissioned by Comcast\nshowed that 96% of users who are blind or have low vision regularly watch\nTV, with 81% watching more than an hour per day. However, 65% also reported\nencountering problems with looking up what's on TV. And in a [2020 survey in the\nUK](https://bighack.org/video-on-demand-streaming-and-accessibility-the-big-hack-survey-feedback/),\n80% of disabled people said they had experienced accessibility issues with video\non-demand streaming services.\n\nWhile assistive technologies can and do help users with low vision, it's\nimportant to support accessibility in content discovery journeys for TV apps.\nFor example, pay extra attention to providing navigation guidance and\nproperly labeling elements, and ensure that TV apps work well with accessibility\nfeatures like TalkBack. These steps can significantly improve the experience for\nusers with vision impairments.\n\nThe first step toward improving accessibility is awareness. This guide can\nhelp you and your team to uncover accessibility issues with your TV app.\n\n### Android accessibility resources\n\nTo learn more about accessibility on Android, see our [accessibility development resources](/guide/topics/ui/accessibility).\n\nText scaling\n------------\n\nAndroid TV apps should respect the user's preference for text scaling by [supporting different pixel densities](/training/multiscreen/screendensities#TaskUseDP).\n\nTake special care to:\n\n- Use `wrap_content` for dimensions in UI components.\n- Ensure that layouts rearrange components as their dimensions change depending on the text scale.\n- Ensure that components still fit on the screen at larger text scales.\n- Don't use sp text size units for components that are not flexible.\n- Check the value of `FONT_SCALE` for adjustment in custom views:\n\n // Checking font scale with Context\n val scale = resources.configuration.fontScale\n Log.d(TAG, \"Text scale is: \" + scale)\n\nThe text scale can be changed with the following command: \n\n adb shell settings put system font_scale 1.2f\n\nOn Android 12 and above, users can alter the text scaling from the device\nsettings.\n\nKeyboard layouts\n----------------\n\nIn Android 13 (API level 33) and higher, you can use\n[`getKeyCodeForKeyLocation()`](/reference/android/view/InputDevice#getKeyCodeForKeyLocation(int))\nto\n[look up the keycodes](/training/tv/games#keyboard-layouts) for\nexpected key locations.\nThis might be necessary if the user has re-mapped some key locations or if they\nare using a keyboard that does not have a typical layout.\n\nAudio description\n-----------------\n\nIn Android 13 (API level 33) and higher, a new system-wide accessibility preference\nlets users enable audio descriptions across all apps. Android TV apps can\ncheck the user's preference by querying it with\n[`isAudioDescriptionRequested()`](/reference/android/view/accessibility/AccessibilityManager#isAudioDescriptionRequested()). \n\n### Kotlin\n\n```kotlin\nprivate lateinit var accessibilityManager: AccessibilityManager\n\n// In onCreate():\naccessibilityManager = getSystemService(AccessibilityManager::class.java)\n\n// Where your media player is initialized\nif (am.isAudioDescriptionRequested) {\n // User has requested to enable audio descriptions\n}\n```\n\n### Java\n\n```java\nprivate AccessibilityManager accessibilityManager;\n\n// In onCreate():\naccessibilityManager = getSystemService(AccessibilityManager.class);\n\n// Where your media player is initialized\nif(accessibilityManager.isAudioDescriptionRequested()) {\n // User has requested to enable audio descriptions\n}\n```\n\nAndroid TV apps can monitor when a user's preference changes by\nadding a listener to\n[`AccessibilityManager`](/reference/android/view/accessibility/AccessibilityManager): \n\n### Kotlin\n\n```kotlin\nprivate val listener =\n AccessibilityManager.AudioDescriptionRequestedChangeListener { enabled -\u003e\n // Preference changed; reflect its state in your media player\n }\n\noverride fun onStart() {\n super.onStart()\n\n accessibilityManager.addAudioDescriptionRequestedChangeListener(mainExecutor, listener)\n}\n\noverride fun onStop() {\n super.onStop()\n\n accessibilityManager.removeAudioDescriptionRequestedChangeListener(listener)\n}\n```\n\n### Java\n\n```java\nprivate AccessibilityManager.AudioDescriptionRequestedChangeListener listener = enabled -\u003e {\n // Preference changed; reflect its state in your media player\n};\n\n@Override\nprotected void onStart() {\n super.onStart();\n\n accessibilityManager.addAudioDescriptionRequestedChangeListener(getMainExecutor(), listener);\n}\n\n@Override\nprotected void onStop() {\n super.onStop();\n\n accessibilityManager.removeAudioDescriptionRequestedChangeListener(listener);\n}\n```"]]