public class CaptioningManager
extends Object
| java.lang.Object | |
| android.view.accessibility.CaptioningManager | |
包含访问和监视首选视频字幕状态和视觉属性的方法。
要获得字幕管理器的句柄,请执行以下操作:
CaptioningManager captioningManager =
(CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);
Nested classes |
|
|---|---|
class |
CaptioningManager.CaptionStyle 指定视频标题的视觉属性,包括前景和背景颜色,边缘属性和字体。 |
class |
CaptioningManager.CaptioningChangeListener 监听器用于更改字幕属性,包括启用状态和用户样式偏好。 |
公共方法(Public methods) |
|
|---|---|
void |
addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener listener) 为用户的首选字幕启用状态和可视属性中的更改添加一个侦听器。 |
final float |
getFontScale() |
final Locale |
getLocale() |
CaptioningManager.CaptionStyle |
getUserStyle() |
final boolean |
isEnabled() |
void |
removeCaptioningChangeListener(CaptioningManager.CaptioningChangeListener listener) 删除先前使用 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
void addCaptioningChangeListener (CaptioningManager.CaptioningChangeListener listener)
为用户的首选字幕启用状态和可视属性中的更改添加一个侦听器。
| 参数(Parameters) | |
|---|---|
listener |
CaptioningManager.CaptioningChangeListener: the listener to add |
float getFontScale ()
| 返回(Returns) | |
|---|---|
float |
the user's preferred font scaling factor for video captions, or 1 if not specified |
Locale getLocale ()
| 返回(Returns) | |
|---|---|
Locale |
the locale for the user's preferred captioning language, or null if not specified |
CaptioningManager.CaptionStyle getUserStyle ()
| 返回(Returns) | |
|---|---|
CaptioningManager.CaptionStyle |
the user's preferred visual properties for captions as a CaptioningManager.CaptionStyle, or the default style if not specified |
boolean isEnabled ()
| 返回(Returns) | |
|---|---|
boolean |
the user's preferred captioning enabled state |
void removeCaptioningChangeListener (CaptioningManager.CaptioningChangeListener listener)
删除先前使用 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener)添加的侦听 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener) 。
| 参数(Parameters) | |
|---|---|
listener |
CaptioningManager.CaptioningChangeListener: the listener to remove |