List of usage examples for android.view.accessibility CaptioningManager addCaptioningChangeListener
public void addCaptioningChangeListener(@NonNull CaptioningChangeListener listener)
From source file:com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager.java
@SuppressLint("NewApi") private void registerCaptionListener(final Context context) { if (Utils.IS_KITKAT_OR_ABOVE) { CaptioningManager captioningManager = (CaptioningManager) context .getSystemService(Context.CAPTIONING_SERVICE); captioningManager.addCaptioningChangeListener(new CaptioningManager.CaptioningChangeListener() { @Override/*from w ww . ja v a 2s .com*/ public void onEnabledChanged(boolean enabled) { onTextTrackEnabledChanged(enabled); } @Override public void onUserStyleChanged(CaptioningManager.CaptionStyle userStyle) { onTextTrackStyleChanged(mTrackManager.getTextTrackStyle()); } @Override public void onFontScaleChanged(float fontScale) { onTextTrackStyleChanged(mTrackManager.getTextTrackStyle()); } @Override public void onLocaleChanged(Locale locale) { onTextTrackLocaleChanged(locale); } }); } }