Most visited

Recently visited

Added in API level 19

CaptioningManager

public class CaptioningManager
extends Object

java.lang.Object
   ↳ android.view.accessibility.CaptioningManager


包含访问和监视首选视频字幕状态和视觉属性的方法。

要获得字幕管理器的句柄,请执行以下操作:

CaptioningManager captioningManager =
        (CaptioningManager) context.getSystemService(Context.CAPTIONING_SERVICE);

Summary

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)

删除先前使用 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener)添加的侦听 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener)

Inherited methods

From class java.lang.Object

Public methods

addCaptioningChangeListener

Added in API level 19
void addCaptioningChangeListener (CaptioningManager.CaptioningChangeListener listener)

为用户的首选字幕启用状态和可视属性中的更改添加一个侦听器。

Parameters
listener CaptioningManager.CaptioningChangeListener: the listener to add

getFontScale

Added in API level 19
float getFontScale ()

Returns
float the user's preferred font scaling factor for video captions, or 1 if not specified

getLocale

Added in API level 19
Locale getLocale ()

Returns
Locale the locale for the user's preferred captioning language, or null if not specified

getUserStyle

Added in API level 19
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

isEnabled

Added in API level 19
boolean isEnabled ()

Returns
boolean the user's preferred captioning enabled state

removeCaptioningChangeListener

Added in API level 19
void removeCaptioningChangeListener (CaptioningManager.CaptioningChangeListener listener)

删除先前使用 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener)添加的侦听 addCaptioningChangeListener(CaptioningManager.CaptioningChangeListener)

Parameters
listener CaptioningManager.CaptioningChangeListener: the listener to remove

Hooray!