1

I am revamping my chromecast implementation to use the Companion Library (https://github.com/googlecast/CastCompanionLibrary-android)

Currently the only way to have the caption button visible on post KITKAT is to have the users enable captions through the accessibility settings on their device. Is there a way to force the caption button to be visible in VideoCastControllerActivity as our content is all international and 90% of the users will want subtitles.

TracksPreferenceManager (part of the companion library) uses the following code

@SuppressLint("NewApi")
public boolean isCaptionEnabled() {
    if (Utils.IS_KITKAT_OR_ABOVE) {
        CaptioningManager captioningManager =
                (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE);
        return captioningManager.isEnabled();
    } else {
        return mPreferenceAccessor.getBooleanFromPreference(
                mContext.getString(R.string.ccl_key_caption_enabled), false);
    }
}
Darussian
  • 1,573
  • 1
  • 16
  • 28
  • So if user hasn't enabled that setting in accessibility, you want to make the button visible visible but not enabled? – Ali Naddaf Apr 01 '16 at 16:38
  • If the MediaInfo object has MediaTracks id like for the button to be visible regardless of what the user has set in their accessibility options. I found a hacky way to do this but I was wondering if we could get this feature in an update as it seems like this is already possible for devices < lollipop – Darussian Apr 01 '16 at 17:26

0 Answers0